Hi, everyone,
I am pretty new to nRF52 development. Right now, I have an issue with the SAADC trigger by RTC, which I follow this example. The issue that I have right now is that it only works when I use the programmer to power it, which is a DAP Link programmer. If I power it with CR2032, it draws 5 mA and not advertise itself. It only draws 0.5 mA if I do not initialize the SAADC. It is still not working even I plug it back to the programmer to power it. I have to uncomment the lfclk_config() and rtc_config. Also, in the example, it calls saadc_init() in the main function. In my case, it doesn't work if I do that.
// My main function
bool erase_bonds;
// Initialize.
saadc_init();
log_init();
timers_init();
gpio_config();
//lfclk_config(); //Configure low frequency 32kHz clock
//rtc_config(); //Configure RTC. The RTC will generate periodic interrupts. Requires 32kHz clock to operate.
power_management_init();
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
//saadc_init();
// #ifdef UART_PRINTING_ENABLED
// uint32_t err_code = NRF_LOG_INIT(NULL);
// APP_ERROR_CHECK(err_code); //Configure Logging. LOGGING is used to show the SAADC sampled result. Default is UART, but RTT can be configured in sdk_config.h
// NRF_LOG_DEFAULT_BACKENDS_INIT();
// NRF_LOG_INFO("\n\rSAADC Low Power Example.\r\n");
//#endif //UART_PRINTING_ENABLED
//
//#ifdef UART_PRINTING_ENABLED
// //Configure UART. UART is used to show the SAADC sampled result.
// NRF_LOG_INFO("\n\rSAADC HAL simple example.\r\n");
//#endif //UART_PRINTING_ENABLED
// Start execution.
NRF_LOG_INFO("started.");
application_timers_start();
advertising_start(erase_bonds);
// Enter main loop.
for (;;)
{
idle_state_handle();
}
Thank you in advance
Jack