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.

CCS/TMS320F28379D: TMS320F28379D

Part Number: TMS320F28379D

Tool/software: Code Composer Studio

Hello, 

My task needs to toggle GPIO pin fast a possible (limit  is 50 nano sec), but now I measured toggle period as 156 nano.

My example activates CPU1 only : CSYSCLK 200Mhz 

The GPIO toggle function is placed into RAM. Only GPIO63  (GPIOB group) is in use.

The following function runs in example (for measurement):

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma CODE_SECTION(CalulateAnsMeasureNano, ".TI.ramfunc");

void CalulateAnsMeasureNano(void)
{
// Idle loop

for(;;)
{
GpioDataRegs.GPBDAT.bit.GPIO63 = 0;
GpioDataRegs.GPBDAT.bit.GPIO63 = 1;

}

/////////////////////////////////////////////////////////////////////////////////////

How to activate the GPIO pin switch faster ?

Thanks in advance,

AlexP 

  • Hi Alex,

    Two suggestions -

    1) You should use SET and CLEAR register instead of DAT register.

    2) Instead of writing particular bit (that is READ MODIFY WRITE operation), write full 32bit register (use .all).

    That should bring the number down.

    Regards,

    Vivek Singh

  • Hi Vivek, 

     it's very helpful for me - I made 1)2) and now I have toggle period 78 nano instead 156,

    But I need less of 50 nano.... 

    May be GPIO63 is slow ? May any other pin will be faster ?

    Thank you very much for your assistance ,

    AlexP

  • AlexP,

    This is because of GPIO register access time. If you look at assembly, how many instruction you have for GPIO write?

    Regards,

    Vivek Singh

  • Hello Vivek,

    The following fragment is derived from TMS320F28379D specification (documents SPRS880K –DECEMBER 2013–REVISED NOVEMBER 2018) :

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    5.9.6.1 GPIO - Output Timing

    Table 5-23 shows the general-purpose output switching characteristics. Figure 5-12 shows the generalpurpose
    output timing.
    Table 5-23. General-Purpose Output Switching Characteristics
    over recommended operating conditions (unless otherwise noted)

                                             PARAMETER                                                                               MIN   MAX  UNIT
    tr(GPO)                            Rise time, GPIO switching low to high                 All GPIOs                   8(1)    ns
    tf(GPO)                            Fall time, GPIO switching high to low                   All GPIOs                  8(1)    ns
    tfGPO                              Toggling frequency, GPO pins                                                                25      MHz

    (1) Rise time and fall time vary with load. These values assume a 40-pF load.

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 

    Is written that "toggling frequency, GPO pins  = 25  MHz" -  How I can I implement this (25 +/-) toggle in program?

     Sincerely,

    AlexP

  • Hi Alex,

    That number is from IO toggle capability but actual toggle frq will depend on GPIO access time and code execution. Can you post the snapshot of your assembly code.

    Regards,

    Vivek Singh

  • Hello Vivek,

    Excuse me , I mistook ...

    This is toggle fragment :

      

  • Alex,

    Why don't you write into GPxTOGGLE register instead. That will be just one write to toggle the output and should give you better result.

    Regards.

    Vivek Singh