Hello,
I would like to sample the SAADC at the center of the PWM. How can I do it ?
Thank you in advance.
Hello,
I would like to sample the SAADC at the center of the PWM. How can I do it ?
Thank you in advance.
Hi,
There is no events generated in the center of the PWM signal that can be used to trigger the SAADC sampling. If you know the timing from the edge until the center, you could use a TIMER/RTC to trigger the sampling, but this depends on your application. Are you using the PWM peripheral? What is the configuration of the output channels?
Best regards,
Jørgen
Hi,
There is no events generated in the center of the PWM signal that can be used to trigger the SAADC sampling. If you know the timing from the edge until the center, you could use a TIMER/RTC to trigger the sampling, but this depends on your application. Are you using the PWM peripheral? What is the configuration of the output channels?
Best regards,
Jørgen
It is possible to create a pseudo event in the center of the PWM signal by using a very narrow pulse on one of the spare PWM channels in waveform mode, assuming only a single (or two) PWM outputs are being used, that is. For ADC sampling that would probably work well.
Hello Hmolesworth,
Have you got an example just to show me, please ?
Many thanks.
Hello Jorgen,
I am new in Nordic device, and in fact, I would like to generate 6 PWMs center aligned for my BLDC with trigger ADC sampling on these PWMs.
I thought to do 2 PWMs (positive and negative) with dead time per channel, and now to use a trigger as hmolesworth said, to read the current.
Is it possible ? How do I have to proceed, please ?
Is it the dead time is possible with Nordic device ?
Thank you in advance.
Best regards.
See this post about PWM dead time.
I'm not sure if you will be able to achieve this with the available instances, if you need to control all the 6 PWMs individually and you require the center signal for each to sample SAADC. There is only events for start and end of each sequence, not for each compare/output, limiting your ability to get events for the center signal. You could of course connect the output pin from the PWM to a GPIOTE input pin which will generate the events on rising signal but this will require a lot of extra GPIOs.
Many thanks for your reply.
I am going to try, I succeed to generate my 6 PWMs sync with this thread, it remains me the PWM1 channel 2&3, and the PWM2 of free.
https://devzone.nordicsemi.com/f/nordic-q-a/68822/pwm-sync
Now I have to try sync SAADC with all this.
if you have a idea ?