cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f3/4 maximum gpio read write operation

armindavatgaran
Associate III
Posted on November 09, 2016 at 18:55

Hello

As i inspected through assembly instructions, it is possible to read 16 bits gpio port with 2 cpu cycles and write with 4 cpu cycles, beside of electrical considerations, is it possible to achieve reading and writing with 1 cpu cycle? what is it's related assembly instruction?

2 REPLIES 2
troy1818
Senior
Posted on November 10, 2016 at 10:40

If you are asking us if you can read and write GPIO port with the same freq. as the CPU is running at, the answer is a definite NO. It would be wise not having too high expectations when it comes to reading and writing GPIO ports on stm32 device.

Posted on December 10, 2016 at 20:03

Microcontrollers are usually not as real time as an FPGA or an ASIC. If something must be toggled by SW every cycle, what would happen if an interrupt would pop-up? To get high toggling HW speed, it is better to use STM32 HW peripherals. For example SPI, FMC (a read/write on its memory space would make some toggle at high speed), DMA to GPIO ports (with some less jitter than pure SW flavour), etc...