I can run the SAADC example and read the analog inputs fine, now I've modified the code to simply read the adc with the blocking nrf_drv_saadc_sample_convert call
All I get back is 0's on the read....using the same input AIN1 in the example program with a callback works and shows values?
One thing I note, if I change the config to have a acquisition time of 3us it reads values...but anything higher (like the default 40us) it reads 0?
in Main I do these steps:
nrf_saadc_channel_config_t cfg = NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN1);
nrf_drv_saadc_channel_init(NRF_SAADC_INPUT_AIN1,&cfg);
while(1)
{
nrf_pwr_mgmt_run();
retval = nrf_drv_saadc_sample_convert(NRF_SAADC_INPUT_AIN1,&myval);
if (retval == NRF_SUCCESS)
{
NRF_LOG_INFO("TESTING ch1=%d ",myval);
}
NRF_LOG_FLUSH();
}