STM32L412 GPIO toggle from hardware without using dedicated timer as AF on that pin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-17 2:12 AM
Hello,
I run into problem for selecting TIM2 as my pwm output. As it turns out, it is only output capable. But I need to get processor independent 3kHz 50:50 PWM signal with no AF functional PWM.
Any simple idea how can I toggle with 50% 3kHz duty cycle this GPIO? (PA15 on STM32L412C8)
I Am thinking of using DMA, just have no idea how to do that, since I can't use ODR register,I have multiple pins that should not change, and with BRR BSRR, well, it is two address, so what ? Do ping pong DMA with single transfer and circular buffer ?
Any ideas are welcome :)
Solved! Go to Solution.
- Labels:
-
GPIO-EXTI
-
STM32L4 series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-17 5:45 AM
Hi,
I found the problem, I was looking at LPTIM2 instead of TIM2
No problems in this case :) Thank you all !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-17 2:22 AM
PA15 is TIM2_CH1and can do PWM . All other solutions wll give you at least Jitteror even missing cycles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-17 4:34 AM
First, like Uwe already said...
Second, read what a BSRR register is. At least read it's name!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-17 5:45 AM
Hi,
I found the problem, I was looking at LPTIM2 instead of TIM2
No problems in this case :) Thank you all !
