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

ADC how to use plural measure?

SDK13, nRf52.

I want measure at one time batt level and data from AIN0.

How to configure ADC for this measure? I mean void saadc_init(void);

Parents
  • Hi,

    Please have a look at this answer. I also attached a similar example for SDK 13.0.0:

    saadc_blocking_simple.zip

    [EDIT]:

    It is possible to sample channels at different sample interval, but this is not supported by the driver. In general, each scan mode will be enabled with multiple channels enabled, and each channel will be sampled. You are therefore required to disable the "slow" channel between its sample interval.

    Attached you can find an example of how to sample two channels without using scan mode. The example will sample the battery channel every 5000ms, while the signal channel is set to sample every 5ms.

    saadc_sample_two_channels.zip

    The example is only tested with PCA10040 board and Keil IDE, but it should work with other compilers without huge modifications.

    Let me know if you have any questions regaring the example.

    You can also find some information about sampling channels at different sample rates in this Devzone post, but this use registers directly instead of the driver, and does not contain a complete working example.

    Best regards,

    Jørgen

  • Hi! Looked. But I mean, how to use at same different time period measure from BATT and from AIN0 AIN1...

    Is it possible? Or each time I should reinit ADC?

Reply Children
No Data
Related