Skip to main content
armindavatgaran
Associate III
November 9, 2016
Question

stm32f3/4 maximum gpio read write operation

  • November 9, 2016
  • 2 replies
  • 905 views
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?

    This topic has been closed for replies.

    2 replies

    troy1818
    Associate III
    November 10, 2016
    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.

    Seb
    ST Employee
    December 10, 2016
    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...