Hello,
I use PWM driver in my application and want to trigger ADC with it on falling edges. How can I accomplished this ?
PWM driver in mcuconf.h use TIM1 but I cant figure out which CCR it use and how to configure ADC CR2 to start conversion.
Triggering ADC with PWM timer Topic is solved
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Triggering ADC with PWM timer
Hi,
This matter should be covered in the STM32 Reference Manual, could you make more specific questions?
Giovanni
This matter should be covered in the STM32 Reference Manual, could you make more specific questions?
Giovanni
Re: Triggering ADC with PWM timer
Thank you for quick response Giovanni.
I just found in ADC Registers how to setup ADC to be triggered with timer event just don't know much details about PWM Driver and how it use TIM1 and which CC event I should use to trigger ADC. In mcuconf.h I have STM32_PWM_USE_TIM1 set to TRUE and I use channels 0-2 to output PWM but cant figure out which event of TIM1 I should use. I have 3 available options CC1, CC2 and CC3.
I just found in ADC Registers how to setup ADC to be triggered with timer event just don't know much details about PWM Driver and how it use TIM1 and which CC event I should use to trigger ADC. In mcuconf.h I have STM32_PWM_USE_TIM1 set to TRUE and I use channels 0-2 to output PWM but cant figure out which event of TIM1 I should use. I have 3 available options CC1, CC2 and CC3.
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Triggering ADC with PWM timer
The PWM driver uses comparators for operation, so it is the compare events.
giovanni
giovanni
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Triggering ADC with PWM timer
Correct, each channel is physically implemented using a comparator. Use the ADC trigger associated to the comparator used by your PWM channel.
Giovanni
Giovanni