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

Sync between PWM and SAADC

Hi,

I'm looking for a basic example to sync PWM pulses with SAADC using software API

There is an example of it?

Parents
  • Hi,

    There are a few different options:

    • Connect a GPIO input pin to the PWM output pin, and use PPI to trigger SAADC sampling when there is a transition in the PWM signal. This would give you a predictable delay of a few 16 MHz clock cycles which may or may not be a problem. I suspect this is the best option.
    • Use the EGU and PPI to trigger the start task for both SAADC and PWM. This would start them at the exact same time, but I suspect this is not what you want in this case (by looking at the image).
Reply
  • Hi,

    There are a few different options:

    • Connect a GPIO input pin to the PWM output pin, and use PPI to trigger SAADC sampling when there is a transition in the PWM signal. This would give you a predictable delay of a few 16 MHz clock cycles which may or may not be a problem. I suspect this is the best option.
    • Use the EGU and PPI to trigger the start task for both SAADC and PWM. This would start them at the exact same time, but I suspect this is not what you want in this case (by looking at the image).
Children
Related