This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GPIO toggling speed with RM48L952 CNCD

Other Parts Discussed in Thread: RM48L952

I wanted to look at the speed of execution of the RM48L952 so I took the Hercules control card and connected an output SPICLK0 to my oscilloscope. I then wrote code to operate this pin as a GPIO and toggled it thus: (not actual code)

while (1)

{

             SetGPIO

             ResetGPIO


}

I expected that the signal will toggle at a very high speed somewhere in a few nano seconds, computing from the 220 MHz speed of the processor. But to my surprise I found that the actual level was about 250 nano seconds i.e. instruction speed of only 4 MHz. 

I saw the disassembly of my code and found that there are about 8-10 instructions in each call - i.e. 32 - 40 MHz at one clock per instruction. Where am I making a mistake in this computation?

  • Vaidyanatha,

    It takes roughly 22 to 25 cycles to access the GIO register;   it is not local to the CPU like the Flash and SRAM are but it is on the AXI bus and across some interconnect that runs usually at 1/2 the CPU clock.  That interface has the ability to do things like write combining so its not the lowest latency but its able to yield higher bandwidth.

    On this device, the peripherals are fairly sophisticated (MibSPI, MibADC, N2HET, USB, Ethernet) and can operate autonomously.   There is are also transfer units and a DMA.  The CPU itself is optimized to execute algorithms from flash and SRAM.  And the interfaces to memory are twice as wide and have the ability to operate in parallel, compared to a Cortex M class processor.

    Hope that this helps explain things better.   If you want to benchmark an algorithm, you can still use the GPIO method (roughly) if you subtract out the time to access the GPIO.   There is also a PMU unit for benchmarking that can count many events including just a pure cycle count.   It takes about 6 cycles to access because it is on a coprocessor interface instead of a memory interface.

    Best Regards,

    Anthony

  • Anthony,

    thanks for the explanation. I was expecting the same architecture as other microcontrollers and hence thought that 220 MHz will mean faster access to hardware too.

    Vaidi.