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.

RM44L920: Peripheral register access slow

Part Number: RM44L920
Other Parts Discussed in Thread: TMS570LC4357

Hello,

I am using the RM44L920 Hercules microcontroller. Currently, I am in the process of measuring the performance of Interrupt Service Routines (ISRs).


The clocks are set as follows:
GCLK: 160 MHz
HCLK: 160 MHz
RTI1CLK: 80 MHz
VCLK1: 80 MHz
VCLK2: 80 MHz
VCLK4: 80 MHz

I have observed that a simple ISR takes considerably more time, approximately 2 to 4 microseconds, than initially anticipated.

It has come to my attention that access to various registers, including peripheral, DMA, and system registers, is notably sluggish. A read operation from these registers consumes approximately 155 nanoseconds (fast ~25 cpu clocks).

To illustrate this, I’ve setup this simple example:
I have created a project with a main C file.

In this project, there are two functions for measuring

uint32_t test_load_from_IO(void);

-Loads a value from the SCI Receiver Data Register (SCIRD) 300 times and measure the execution time in milliseconds.
The cumulative time for 300 read accesses to the register amounts to 46 microseconds. On average, each read access to register takes approximately 155ns, fast 25 cpu clocks.

uint32_t test_load_from_memory(void);

-Loads a value from the memory 300 times and measure the execution time in milliseconds.
The total time required for 300 memory loading operations is 2 microseconds. On average, each loading from memory takes approximately 6,66ns, fast 1 cpu clock.

uart configured with Baudrate: 460800bps. Data bits: 8 bits. Parity: no parity. Stop bits: 1 bit.
uart is used to send the measure results.

rti configured with
.frequency of the free running counter0 = 1MHz
.compare 0 value = 1000
rti is used to measure the execution time in microsecond.
Our ISRs must access to registers, which has the potential to impact the overall performance of our project, or may cause overrun error by receiving UART/SPI data.
I would like to know if there are tricks to make the access to register faster.

Thank You for the help

Regards,SimpleProject.zip

Chunyan

  • Hi Chunyan,

    Apologies for the delay in response, here in India we got couple of holidays.

    Now i started working on your issue, and will provide an update ASAP.

    --
    Thanks & regards,
    Jagadish.

  • Hi Chunyan,

    I tested your project and i could see the behavior you mentioned. I don't find any documents related to why accessing to the peripheral memory is slow in compared with RAM and Flash.

    I will again further investigate and will provide an update.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thank you for your reply. I comprehend that it may take several CPU cycles to read or write peripheral registers due to the ARM BUS architecture (AHB, APB, etc.). However, around 25 CPU clock cycles seem excessive. Is this level of delay typical for this processor? Are there any tricks to make it faster?

    Thanks and regards,

    Chunyan

  • Hi Chunyan,

    However, around 25 CPU clock cycles seem excessive. Is this level of delay typical for this processor? Are there any tricks to make it faster?

    I tested on other Hercules device(TMS570LC4357) and the delay looks same. And a i also tried with different MPU settings for the peripheral region but no improvement in the delay and it is same.

    So, i don't think we can make it faster and it is just a limitation.

    --
    Thanks & regards,
    Jagadish.