Skip to main content
Graduate
April 12, 2024
Solved

stm32h7 fastest gpio read using DMA

  • April 12, 2024
  • 2 replies
  • 1076 views

I would like read the gpio lines at fastest speed. 

As example it is possible to read first 4 ports by reading:

uint16_t ports0123=GPIOC->IDR&0x000F; (it is very fast, takes 28 tics)
It is possible to read ports GPIO_PIN_0-15 by connecting GPIOC->IDR to a DMA?

and a fast DMA?

 

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

    You can do it, but you may be unpleasantly surprised by how slow it is.

    While that article talks about toggling (i.e. write), most of what's written there applies to reads, too.

    You may try to experiment with the BDMA which in the same clock domain as GPIO, but don't have too high expectations.

    JW

    2 replies

    Technical Moderator
    April 12, 2024

    Hello

    It is possible to read ports GPIO_PIN_0-15 by connecting GPIOC->IDR to a DMA?

    Nothing prevents you to do it.

    Super User
    April 12, 2024

    You can do it, but you may be unpleasantly surprised by how slow it is.

    While that article talks about toggling (i.e. write), most of what's written there applies to reads, too.

    You may try to experiment with the BDMA which in the same clock domain as GPIO, but don't have too high expectations.

    JW