This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377S: What is the maximum output frequency of GPIO of DSP28377S?

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

Hi ,

I got a a question about GPIO output of 28377S  : 

In the datasheet , I saw GPIO CLK is equal to SYSCLK, so I test the GPIO max frequency like this:

C code

...

GpioDataRegs.GPDSET.bit.GPIO96 = 1;
GpioDataRegs.GPDCLEAR.bit.GPIO96 = 1;

...

and

...

GpioDataRegs.GPDSET.bit.GPIO96 = 1;
__asm (" nop");
__asm (" nop");
GpioDataRegs.GPDCLEAR.bit.GPIO96 = 1;

...

Pulse wide is the same, 36ns!

If it is equal to SYSCLK, then the maximum frequency of GPIO should theoretically be 200MHz, then the pulse time in the waveform should be 5ns, but it is 36ns after the test. Why?

  • This is probably due to the way that the Ccode that you have written is being translated to assembly.

    I have tested it with back to back writes to the registers, which take a couple assembly instructions resulting in ~25nS wide pulses. Then adding two NOP instructions I see that pulse width grow to ~35nS. This was tested on F28388D, but there should be not functional differences.

            gpioDataReg[GPIO_GPxSET_INDEX] = 0x0001;
    
            gpioDataReg[GPIO_GPxCLEAR_INDEX] = 0x0001;
    
            gpioDataReg[GPIO_GPxSET_INDEX] = 0x0001;
            asm (" nop");
            asm (" nop");
            gpioDataReg[GPIO_GPxCLEAR_INDEX] = 0x0001;
            asm (" nop");
            asm (" nop");
            gpioDataReg[GPIO_GPxSET_INDEX] = 0x0001;
            asm (" nop");
            asm (" nop");
            asm (" nop");
            asm (" nop");
            asm (" nop");
            gpioDataReg[GPIO_GPxCLEAR_INDEX] = 0x0001;

    The issue is that the processor is having to toggle the register value, the PWM may be able to get a smaller pulse out, but not too much smaller.

    Regards,
    Cody 

  • Hi ,

    Thanks!

    How to write my code? If I want GPIO send out the fastest 50% pulse?

    It seems to add asm ("nop");  in the code, sometimes the time between high level and low level is not fixed, it seems to be changing

  • Fei,

    using the CPU to continually toggle the GPIOs like that is not practical, every instruction cycle would be dedicate to toggling GPIOs.

    If its a single pulse write a few lines of assembly to toggle the bits. If you need multiple pulses look at using the PWM module.

    C2000ware examples C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2837xs\examples\cpu1\epwm 

    If you need to make an even more narrow pulse I would recommend try using two HRPWM pulses combined though external logic. The HRPWMs have a minimum pulse width, but the resolution of the pulse edge is very small. Using some simple discrete logic you should be able to turn on the output with one HRPWM and turn off the output with another HRPWM.

    Regards,
    Cody 

  • Thanks,  Cody!

    Very useful!