2021-11-26 12:41 AM
Hello, i am using stm32h723zg nucleo board in my project. my system clock frequency 480 MHZ, that means it does an instruction for about 2,08 ns as well but the time i measure
9-10 ns , That's too much.(application ; Writing adc value to another variable in an adc interrupt.)
2021-11-26 12:43 AM
2021-11-26 01:22 AM
Only you can say what's too slow for a specific application.
But I do have some comments:
Hope this helps,
Danish
2021-11-26 01:47 AM
Isn't the whole point of BSRR that you can blind write it?
Check the clock settings, and speed of the bus the GPIO is on.
Check optimization settings.
Perhaps measure clocks with DWT CYCCNT?
2021-11-26 03:03 AM
thank u , your ansver. I think u misunderstood me, I measure GPIO Set-reset
approximately 60-70ns takes time so "sina=ADC2->DR" ,means it takes 30 ns
,it(sina=ADC2->DR) is 2 instraction so 1 instruction is 15ns and frequency is 66MHZ
But my mcu frequency is 480 MHZ ... i don't understand this case.
2021-11-26 03:06 AM
I checked what you said
2021-11-26 03:51 AM
This is not an 8-bit microcontroller with tight uniform timing across the whole chip; rather, it's an SoC with all its complexity resulting in complex timing.
In 'H7, ADC2 is on AHB1, which is slave on the D2 AHB bus matrix. The read command of ADC->DR from processor has to traverse through the AXI matrix to the D1-to-D2 bus, there through the D2 AHB matrix to the AHB1 bus, and then the read out data have to traverse back. This all involves arbitration latencies and resynchronizations (and D2 runs at max. 240MHz). So, executing the 2 instructions may have taken 2 system clocks, but then there was an extra dozen of clocks to perform the actual read.
The high clock provides only computational power, it won't handle peripherals magically fast.
JW
2021-11-26 04:11 AM
What Tesla DeLorean meant was you don't need to the read part of
GPIOA->BSRR |= 0x00010000;
It's faster to do (and has exactly the same effect)
GPIOA->BSRR = 0x00010000;
2021-11-26 04:21 AM
i understand it, but this time is very big,,, because ı try same code with stm32f4 so stm32f4 faster than stm32h7 ,, I'm so confused because of this
2021-11-26 05:07 AM
> ı try same code with stm32f4 so stm32f4 faster than stm32h7
That's exactly what I am talking about. 'H7 is good for crunching numbers, making huge calculations, playing with pictures i.e. data which stay within the AXI domain. It is worse than 'F4 in handling peripherals.
Try to offload as much real work as possible to hardware, i.e. DMA, automatic functions of hardware etc.
JW