Sampling two analog signals using SAADC at two different rate


I am working on one application in which I want to sample ECG at 1000 samples per second continuously and battery value at 15 seconds interval. I am configuring two channels of SAADC two do this task. but as there only one callback function I can have, I may loose any one signal samples after 15 seconds. I want Battery value to be samples at every 15 seconds and ECG continuously at 1000 samples per second.

How can achieve this task? Can anyone help me in this regards?

  • This is not trivial using the driver, so I will try to explain how it should work with the SAADC peripheral.

    You can enable or disable a channel by configuring the PSELP field, as the specification says:

    A channel is considered enabled if CH[n].PSELP is set. If more than one channel, CH[n], is enabled, the ADC enters scan mode.

    Enable the battery measurement channel every 15000 ECG sample and disable it when you have received the measurement.

    You also have to configure RESULT.MAXCNT to allow for two samples to be stored in RAM when you enable the battery measurement channel.