This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

multiple saadc

i read devzone.nordicsemi.com/.../ that simple multiple saadc-s is not so easy. I also looked at github.com/.../ble_app_uart__saadc_timer_driven__scan_mode to use multiple channels but didn't understand how to separate what comes from what channel.

So i decided to make it maybe a more clean way. To init the saadc, read value and then uninit it. Is this a good approach?

Parents
  • Hi,

    If you don't want to sample channels on different intervals, you need to init, read value and then uninit the SAADC, as you propose.

    If you have multiple channels enable, all channels will be samples each time the start sample task is called. The result for each channel will be stored in the buffer, e.g., result of channel 0 stored in buffer[0], result of channel 1 in buffer[1] etc., as described in this answer. To make the results manageable, you should set the buffer size to a multiple of the number of active channels.

    Best regards,

    Jørgen

Reply
  • Hi,

    If you don't want to sample channels on different intervals, you need to init, read value and then uninit the SAADC, as you propose.

    If you have multiple channels enable, all channels will be samples each time the start sample task is called. The result for each channel will be stored in the buffer, e.g., result of channel 0 stored in buffer[0], result of channel 1 in buffer[1] etc., as described in this answer. To make the results manageable, you should set the buffer size to a multiple of the number of active channels.

    Best regards,

    Jørgen

Children
No Data
Related