nRF52832 Multiple ADC with different rates

I need to use both AIN0 and AIN1 of nRF52832. AIN0 is measuring once per minute and AIN1 is measuring once per second. What would be the best approach for this? Thanks

Parents
  • This depends a bit I guess on wheter you are using nRF5 SDK or nRF Connect SDK. but for the nRF5 SDK you for instance use an app_timer without timeout of 1second, then in the timeout handler you increment a counter, and then start the ADC sampling of AIN1, and shortly after in the ADC callback handler you have the AIN1 sample value available. You can in the ADC callback handler also check the counter, and if(counter%60) you can also trigger sampling of AIN0, wait for yet another ADC callback handler for the AIN0 sample value.

    Best regards,
    Kenneth

Reply
  • This depends a bit I guess on wheter you are using nRF5 SDK or nRF Connect SDK. but for the nRF5 SDK you for instance use an app_timer without timeout of 1second, then in the timeout handler you increment a counter, and then start the ADC sampling of AIN1, and shortly after in the ADC callback handler you have the AIN1 sample value available. You can in the ADC callback handler also check the counter, and if(counter%60) you can also trigger sampling of AIN0, wait for yet another ADC callback handler for the AIN0 sample value.

    Best regards,
    Kenneth

Children
Related