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

SAADC Sampling Frequency at 200kHz

Hi,

Aim :- To Configure SAADC Sampling Rate at 200Khz.

SAADC Configuration :-
1. The resolution, oversample, interrupt priority and low power mode are set as 12 bit, OFF, 6 and ON respectively.
2. We have enabled 5 channels in scan mode with acquisition time 3us and pin_p select to respective pins, rest all the channel config parameters are set to default.
3. PPI is used for sampling with the buffer value set to 5.
we are able to sample all the channels at a maximum frequency of 30khz

Problem :- when we go beyond 30khz the sampling doesn't happen.
Verification :- Toggled a LED in SAADC callback function and observed the frequencies on an oscilloscope.

Please let us know what would be the reason?

Thanks,

Parents
  • Hello,

    Problem :- when we go beyond 30khz the sampling doesn't happen.
    We have enabled 5 channels in scan mode with acquisition time 3us

    The total conversion time will increase as you increase the number of channels to sample according to the formula from the SAADC peripheral documentation

    When multiple channels are enabled, they are sampled successively in a sequence starting with the lowest channel number. The time it takes to sample all enabled channels is given as follows:

    Total time < Sum(CH[x].tACQ+tCONV), x is the number of enabled channels

    This is because each channel is samples separately in a sequence during the scan of all enabled channels.

    Verification :- Toggled a LED in SAADC callback function and observed the frequencies on an oscilloscope.

    In general this method is ok for visualizing how often a callback is triggered, but I recommend that you set the LED/pin to toggle using PPI to connect it directly to the triggering event. This will avoid the issue of the CPU being busy with another higher priority task at the time of the event generation, skewing you measurements. I do not know if this is already how you have implemented this, but I mention it here just in case for future reference.

    Best regards,
    Karl

Reply
  • Hello,

    Problem :- when we go beyond 30khz the sampling doesn't happen.
    We have enabled 5 channels in scan mode with acquisition time 3us

    The total conversion time will increase as you increase the number of channels to sample according to the formula from the SAADC peripheral documentation

    When multiple channels are enabled, they are sampled successively in a sequence starting with the lowest channel number. The time it takes to sample all enabled channels is given as follows:

    Total time < Sum(CH[x].tACQ+tCONV), x is the number of enabled channels

    This is because each channel is samples separately in a sequence during the scan of all enabled channels.

    Verification :- Toggled a LED in SAADC callback function and observed the frequencies on an oscilloscope.

    In general this method is ok for visualizing how often a callback is triggered, but I recommend that you set the LED/pin to toggle using PPI to connect it directly to the triggering event. This will avoid the issue of the CPU being busy with another higher priority task at the time of the event generation, skewing you measurements. I do not know if this is already how you have implemented this, but I mention it here just in case for future reference.

    Best regards,
    Karl

Children
  • Thank you for timely response, we are able to sample at 200Khz after modifying these parameters.

    We have enabled 5 channels in scan mode with acquisition time 3us and pin_p select to respective pins, rest all the channel config parameters are set to default.

    Enabling only a single channel on which we wanted a sampling rate of 200kHz.

    1. The resolution, oversample, interrupt priority and low power mode are set as 12 bit, OFF, 6 and ON respectively.

    Disabling low power mode for that particular channel on which we wanted a sampling rate of 200KHz

    PPI is used for sampling with the buffer value set to 5.

    Modifying the buffer value from 5 to 200.

    Thanks,
    Sakib

Related