stm32l152 Timer problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2013-04-22 2:40 AM
Posted on April 22, 2013 at 11:40
Hello,
I modify the demo code in STM32L1xx_StdPeriph_Lib_V1.2.0 --> TIM --> OCToggle. I reconfigured the TIM3_CH3 CCR3_Val to 40 to generate 200KHz square waveform. The output frequency measured is only 122Hz. But while I change TIM3_CH3 CCR_Val to 400, it can generate 20KHz square waveform. Could you help find what the rootcause would be? Thanks. B.R. Jin
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2013-04-22 4:22 AM
Posted on April 22, 2013 at 13:22
Without looking at the example, I don't have it to hand, it is likely that the rate of the interrupt exceeds the saturating point of the processor.
For high rates (>several hundred KHz) you want the HARDWARE to do the work, which would mean using the PERIOD value and one of the output modes. PMW modes with PERIOD/PULSE configuration being particularly effective. You will be limited to one frequency per timer, but could get different dutys for different channels.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
