Hello to All
I have some doubts about the internal clock speed of DSP programming.
The original program that is running in one of my company boards uses a TMS320C6413-500 and it was not written by me.
This DSP configures the PLL using input ports and in this board we are using a 50 Mhz clock with a x10 multiplier.
I check the internal PLL registers of the DSP and everthing seems ok, at least the x10 value is correctly assigned in the DSP register
I am making small modifications in this code, but since I waiting for the emulador, I am testing the performance of the code using GPIO ports and a logic analyzer.
I notice, that a small GPIO logic switch between 0 and 1 and then return to 0 takes about 60 ns seconds.
The Code is the first thing that I execute in the program, but I also test it in the middle of the code.
I define new macros also shown bellow to speed up the logic switch, but I intend to use the orignal ones in the CSL library, but the original ones take more than 200 ns
Bellow is the code that I am using to access the GPIO 0 and 3
hGpio = GPIO_open(GPIO_DEV0,GPIO_OPEN_RESET);
GPIO_configArgs(hGpio,
GPGC_GP0_3, // gpgc Global control register value
GPEN_GP0_3, // gpen GPIO Enable register value
GPDIR_GP0_3, // gpdir GPIO Direction register value
GPVAL_GP0_3, // gpval GPIO Value register value
GPHM_GP0_3, // gphm GPIO High Mask register value
GPLM_GP0_3, // gplm GPIO Low Mask register value
GPPOL_GP0_3 // gppol GPIO Interrupt Polarity register value
);
GPIO_pinEnable(hGpio,GPIO_PIN0 | GPIO_PIN3); // old DMA0/1
// from here
GPIO_pinSet(GPIO_PIN0);
GPIO_pinSet(GPIO_PIN3);
error = 1; // dummy code to avoid compile to optimize code and remove the switch from 0 -> 1 -> 0
GPIO_pinReset(GPIO_PIN3);
GPIO_pinReset(GPIO_PIN0);
// to here = 60ns
The macros above are defined as
#define GPIO_pinSet(Pin) *((UINT32 *) 0x01B00008) |= Pin
#define
If the clock was running at 50 MHZ with instruction cycle of 20 ns, 60 ns to do these instrunctions could be fare, but at 2ns per instrunction is difficult to me to believe that it takes 30 instructions to switch from 0->1->0
best regards
Nuno