Speed Limit of the ''HAL_GPIO_TogglePin'' ?!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-06 7:28 AM
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-06 7:44 AM
The interrupt service routine takes too long to execute, that's what limits the 'maximum frequency' here.
This question is reocurring here quite often, e.g.
https://community.st.com/0D50X00009XkW8YSAV
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-06 7:42 AM
Don't generate interrupts at this rate, you'll saturate the processor. The TIM provides ways to toggle or pulse pins into the 10's MHz
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-06 7:44 AM
The interrupt service routine takes too long to execute, that's what limits the 'maximum frequency' here.
This question is reocurring here quite often, e.g.
https://community.st.com/0D50X00009XkW8YSAV
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-06 10:15 AM
the reason why I'm doing this because I want to generate pulses with a full control over their freq, duty and phase. the PWM can fix two of them but I could not find a satisfactory method to control the phase (in relation to another PWM signal)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-06 10:47 AM
Use master-slave arrangement of timers to control phase.
There are also the combined outputs in the newer STM32's timers, e.g. in L4.
If you are desperate, 1MHz interrupt toggling a pin in a 'F4 might be viable, but only if you very well know what are you doing - and using Cube does not really indicate that.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-06 10:59 AM
I will try your suggestion but using the Cube should not lead to the slower operation of the timer or GPIO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-07-06 11:19 AM
Actually I had done this many times in few traditional 8 bit MCUs and so I can not understand why this can not happen here, apart from the fact that pulse generation using interrupt is an efficient method or not.
