Hi Support,
I have encountered a problem, using a simple for-loop for copying data from mibspi rx ram to main ram.
I transmit 64 bytes and it needs 19 µs. The Hercules runs with 100 MHz.
The loop looks like this:
for( i = headerSize; i < lenTransfer; i++ )
{
*(pData++) = mibspiRAM1->rx[i].data;
}
In disassembly:
636: for( i = headerSize; i < lenTransfer; i++ )
637: {
0x00007A28 E1A01005 MOV r1,r5
0x00007A2C EA000004 B 0x00007A44
638: *(pData++) = mibspiRAM1->rx[i].data;
639: }
640:
0x00007A30 E59F7424 LDR r7,[pc,#1060] ; @0x00007E5C
0x00007A34 E0877101 ADD r7,r7,r1,LSL #2
0x00007A38 E1D770B0 LDRH r7,[r7,#0]
0x00007A3C E4C67001 STRB r7,[r6],#1
0x00007A40 E2811001 ADD r1,r1,#1
0x00007A44 E1510002 CMP r1,r2
0x00007A48 3AFFFFF8 BCC 0x00007A30
Why this few instructions need 19 µs ?
Best regards
Falk