Hello,
I've just tried on a C6678-EVM this simple GPIO example for interrupts (http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/160712.aspx).
Everything works fine, but having a closer look on the GPIO with an oscilloscope, two strange behaviours appeared:
-"Edge detection": it's only possible to generate an interrupt (e.g. rising edge detection) if the GPIO is toggeled from 0 - 1 - 0. Only switch the GPIO from 0 - 1 will not lead to an edge detection. Same proceedure for falling edge. Do I have a wrong understanding of the edge detection?
-Furthermore using the CSL API instead of writing to the registers directly (see below) will result in a faster toggeling of the GPIO. With CSL the whole toggle (0 - 1 - 0) lasts 360 ns, with writing into registers 5.2 us. Also the fast toggeling with CSL is not recognized as an interrupt. But I think 360 ns are long enough, aren't they?
Thanks for clarifying!
Best Regards,
Bernd
#define GPIO_INTERRUPT_TRIGGER (0)
CSL_GPIO_clearOutputData(GPIOHandle, GPIO_INTERRUPT_TRIGGER);
CSL_GPIO_setOutputData(GPIOHandle, GPIO_INTERRUPT_TRIGGER);
CSL_GPIO_clearOutputData(GPIOHandle, GPIO_INTERRUPT_TRIGGER);
#define GPIO_CFG_BASE (0x02320000)
#define GPIO_REG_OUT_DATA (0x14)
*(unsigned int*)(GPIO_CFG_BASE+GPIO_REG_OUT_DATA) &= 0xFFFFFFFE;
*(unsigned int*)(GPIO_CFG_BASE+GPIO_REG_OUT_DATA) |= 0x1;
*(unsigned int*)(GPIO_CFG_BASE+GPIO_REG_OUT_DATA) &= 0xFFFFFFFE;