Skip to main content
HTajb.1
Associate III
August 27, 2020
Solved

How to toggle a GPIO pin very fast in STM32H750?

  • August 27, 2020
  • 19 replies
  • 14233 views

Dera Sir/Madam,

I chose STM32H750VBT6(LQFP-100 package-Revision Y-Max core clock=400MHz) for my project,based on my requirements .

Everything was fine,until I perceived that: this magnificent MCU is not capable of toggling a GPIO pin faster than 30 ns(roughly estimation).I should emphasize that to reach this speed I had to ignore using HAL_GPIO_WritePin&HAL_GPIO_TogglePin and use GPIOx->BSRR directly in my program in a very very simple loop . 

If I can decrease this time to 15 ns(or less),I will reach my goal .

I searched on the Internet and found a very useful discussion in this link:

https://community.st.com/s/question/0D50X00009cdgGjSAI/stm32h7xx-fast-gpio-toggle

It seems that the H7 series has a limit to do so ,intrinsically.

Here are my questions:

1-If I use assembly language directly,can I reach this speed (15 ns)?

2-If I use Revision V of this chip(LQFP-100 package),will it solve my problem(Considering internal HW differences with Revision Y,maybe)?

3-Necessary settings were done in my program(Enabling Cell compensation and...),but none of them were useful.Since this chip is still new to me,maybe I don't know about the right settings or the sequence of the right settings. Can anybody help me about this ?

Your consideration is highly appreciated.

This topic has been closed for replies.
Best answer by waclawek.jan

Welcome to the wonderful world of 32 bits.

In 'H7, GPIO is at a bus clocked max. 240MHz, removed from processor through 3 (three) busmatrices. This is not your tightly coupled 8-bitter with clean and straightforward timing, anymore. In fact, despite optically 2 orders of magnitude faster, the "control granularity" remained roughly the same, only number crunching capability is increasing.

For control, you have to resort to hardware. Use a timer to toggle a pin.

JW

19 replies

Andreas Bolsch
Lead III
December 20, 2020

The M0+ has optionally a special IOPORT für direct access to GPIOs. On the G0xx, toggling up to 32 MHz (at 64 MHz clock) is possible due to this special feature. A really nice combination would be a dual core M4/M0+ or M7/M0+ with this feature. Unfortunately neither WL nor WB include that in their M0+ cores ...