Hi,
the problem I am facing is to do 1 million GPIO outputs periodically (one output every 40ns).
Doing this is ok for 10,000 outputs per period: There is a continuous pulse sequence.
But when the number is raised to 50,000 outputs, there are pulses missing in the sequence like this (yellow signal):
The problem has been discussed before, when MMU and Caching had not yet been enabled.
I am aware that there are some BUS systems between the core and the output pins and that the signal slightly jitters. But that
doesn't explain to me why it is ok for 10000 outputs but not for 50000 ore more. It would be nice to find a workaround.
This is the programme, main() is relatively short:
int main(void) {
MUX_EVM(); // pin-multiplexing
MMUConfigAndEnable(); // these 2 functions have been derived
CacheEnable(0x03); // from the uartEdma_Cache.c example from Starterware
InitGpio2(); // 4 pins as output
InitGpio3();
InitSanst(); // fills InstrTable[] with asm instructions
// (read double word from memory and output to GPIO2),
// fills ValTable[] with unsigned integers that shall be output
while(1) {
Delay(10000000);
GPIOPinWrite(SOC_GPIO_3_REGS, 4, GPIO_PIN_HIGH); // pos. going edge to trigger a scope
Ping((unsigned int) ValTable, GPIO2 + GPIO_DATAOUT, (unsigned int) InstrTable);
GPIOPinWrite(SOC_GPIO_3_REGS, 4, GPIO_PIN_LOW); // clear trigger pulse
}
}
Ping() is the function that reads the unsigned integers from ValTable[] and writes them to GPIO2.
That is pure assembler code.
At first I thought that the data in ValTable[] might have been corrupted. But that is not the case.
The next idea was that something might be wrong with MMUConfigAndEnable().
The board has 512MB of DDR SDRAM at address 0x8000 0000 and with
#define START_ADDR_DDR (0x80000000)
#define NUM_SECTIONS_DDR (512)
I would thing (but I am not sure) that the memory is set up correctly in MMUConfigAndEnable():
REGION regionDdr = {
MMU_PGTYPE_SECTION, START_ADDR_DDR, NUM_SECTIONS_DDR,
MMU_MEMTYPE_NORMAL_NON_SHAREABLE(MMU_CACHE_WT_NOWA,MMU_CACHE_WB_WA),
MMU_REGION_NON_SECURE, MMU_AP_PRV_RW_USR_RW,
(unsigned int*)pageTable
};
Does anybody know why that pulse sequence is not steady any longer?
Any hint is welcome!
Thank you!
Regards,
Martin H.