Hi All,
I am pretty new to TMS320C6678 programming.I know this subject was discussed multiple times but I am not sure I am able to solve this myself so her it goes.
At the moment I am trying to detemine the GPIO speed on TMS320C6678, TMDSEVM6678LE evaluation board. The code I am using is at the end of this post. Basically I flip one of the GPIO pins (through CSL_GPIO_setOutputData/CSL_GPIO_clearOutputData) and observe the output on the oscilloscope. I measure the length of the positive pulse on pin 15 for two cases:
1) the CSL_GPIO_setOutputData is immediately followed by CSL_GPIO_clearOutputData on GPIO pin 15
2) The CSL_GPIO_getInputData is inserted on other pin (say pin 5) between CSL_GPIO_setOutputData and CSL_GPIO_clearOutputData
For the first case, I am getting the pulse length of 100ns (50ns per single flip), and for the second case I am getting 1.2us (1200ns), which means the read actually takes 25 times more time than the write!!
I understand (or so it seems) that the read speed is defined by GPIO latching clock speed by manipulating some PLL registers. However I am not sure how to increase this speed (~250ns read would satisfy my needs). So here are my questions:
1. How to calculate and set the GPIO clock speed and is there a reference manual on the subject for this particular device?
2 Can this be done programmatically or this info should be in .cmd or .cfg or GEL file?
3. If this can be done programmatically, is there an API for this within MCSDK bundle and what particular module I should look for?
4. If it is possible, can somebody give a code snippet?
Any help on this subject would be greatly appreciated.
Best Regards,
Alex
P.S. here is the code I have been using for testing:
#include <ti/csl/csl_gpio.h>
#include <ti\csl\csl_gpioAux.h>
#include <ti/csl/csl_tmr.h>
#include <ti/csl/csl_tmrAux.h>
#include <ti/csl/src/intc/csl_intc.h>
#include <ti/csl/src/intc/csl_intcAux.h>
void main(void)
{
int i,j;
Uint8 dat;
CSL_GpioHandle ghGpio;
unsigned int DataArr[4];
/* Initialize GPIO module */
ghGpio = CSL_GPIO_open(0);
CSL_GPIO_setPinDirOutput (ghGpio, 15);
for (i=0;i<14;i++)
CSL_GPIO_setPinDirInput (ghGpio, i);
for (i=0;i<10000000;i++)
{
CSL_GPIO_setOutputData (ghGpio, 15); // 50ns
CSL_GPIO_getInputData(ghGpio,5,&dat); //1.2 us !!!
CSL_GPIO_clearOutputData (ghGpio, 15); //50ns
//some delay
for(j=0;j<200;j++)
{
DataArr[j % 4]=0;
}
}
}