A possible bug in PWM HAL drivers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-05 09:47 AM
Hi,
I just generated two identical PWN pulses using two separated identical timers in the STM32F407 chip. After the MCU resets or a momnet after the MCU startup, both PWM pulses overlap each other as naturally should be (First picture).
But as time passes (few seconds) one of the pulses starts to make phase shift (Second picture). After the MCU reset, both pulses come together and overlap again.
It is weird isn't it?!!!! This could be a bug in the HAL drivers. I have used HAL_TIM_PWM_Start() for the both timers
as I mentioned everything on both timers are identical which also leads to an identical frequency. Therefore the reason of this gradual phase shift must be investigated.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-05 03:01 PM
Alright. I re-checked again and I confirm that a very small difference was causing this. I had a great doubt also because it is very unlikely for the HAL to contain such bugs and that was the reason I mentioned a possible bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-05 12:25 PM
Try change oscilloscope
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-05 12:32 PM
'
as I mentioned everything on both timers are identical which also leads to an identical frequency.'
maybe to you but not to us.
you said that both timers are identically programmed - you didn't show that;
you hoped that both timers are identically configured - you didn't show that;
unless you can show identical register values, we cannot be sure that both timers are identical.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-05 02:46 PM
Oscilloscope does not have any problem. I have a function generator either and I can confirm that oscilloscope is healthy.
:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-05 03:01 PM
Alright. I re-checked again and I confirm that a very small difference was causing this. I had a great doubt also because it is very unlikely for the HAL to contain such bugs and that was the reason I mentioned a possible bug.