STM32F407 - how fast an interrupt can be and how fast can I read/write GPIO register
I am new with the STM32 MCU and this is my first project
I am using a STM32F407VGT6
I started a project that read a 16bit parallel on PDx GPIO. The data is placed by an external device and a signal is set to low for 400ns. I connected that signal on PB1 and enable an interrupt on it.
The code inside the interrupt:
1 - set output pin PC9 to 0
2 - read the GPIOD (al 16 bit)
3 - shift once (divide by 2)
4 - output the result into the MCU DAC.
5 - set output pin PC9 to 0
I use PC9 on an oscilloscope to see how much each line of code is taking.
And I am very surprised by how slow the code is running at.
First, it take 6us for the interruption to be triggered
Then 3us to read PDx registry
1us to shift
4us to output to DAC
I was hopping the interrupt would be much faster. At least to read the PDx registry within the 400ns. 400s is the time I have to read the GPIO. This is how long the data stay on the 16 bus.
To get me going, I used 2 latching buffers 74LS374 in order to give me more time. But I was hopping the STM32 would be fast enough to read within the 400ns or even faster.
Am I missing something?
I did not start using the DMA. Would that help?
My second project was to emulate a ROM and be able to read the bus, fetch a 8 bit data from RAM and output it to another GPIO port. All within 200ns. But it seems I will not be able to do that. ether.
I attached the code of my interrupt and the timings I get.
Many thanks for your help.
