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