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.

TMS320F28335: TMS320F28335 Gpio speed

Part Number: TMS320F28335

Hello ,

I am using XINT1 to generate an external interrupt from a square wave of frequency of 100 kHz. I have an ISR in my code which will be enabled when XINT1 senses any transition. In that ISR, I am toggling a GPIO pin any observing its output on my oscilloscope. The issue, I am facing is that the low to high transition for GPIO pin is delayed by 250 ns and i want my GPIO to switch as fast as possible. Can anyone help ? How fast can the GPIO switch in TMS320F28335?

Thanks

Nikhil

  • "The maximum toggling frequency of the GPIO pin is 20 MHz for the F281x devices and
    25 MHz for the F280x/F28xxx devices." (from SPRAAS1C "Hardware Design Guide)
  • Thanks for the reply Todd.

    I am facing an issue, that whenever my input signal (square wave of 100 kHz) at GPIO pin( which i have configured as XINT1) makes transition from low to high, why my GPIO pin (which i have configured as an output ) is taking 250 ns to make transition from low to high.
  • I wonder if that has to do with the interrupt service routine - there is some latency involved before getting to the first line of an interrupt service routine. You may be seeing something related to that. Have you seen the write-up on interrupts in the F28335 of C2000 Archived Workshops? processors.wiki.ti.com/.../C2000_Archived_Workshops -> F28335 -> Student Guide -> Chapter 4 (Interrupts) [as I remember...]
  • Hello Todd, 

    I read the interrupt part of the archived workshop. I found that external interrupt takes a minimum of 16 cycles (100ns) before going into the ISR. That may explain one part of the delay. I suppose the other part of the delay is because of the involved wait states. 

    Thanks for your help Todd.

    Regards

    Nikhil

  • Nikhil,

    Can you describe your desired system behavior? There may be other approaches depending on your end goal.

    -Tommy
  • Hi Tommy,

    I am using an external interrupt (frequency of 100 kHz) to toggle the state of a GPIO30 ( configured as an output pin).

    This is my code:

    //GPIO30 as an output 

    GpioCtrlRegs.GPAMUX2.bit.GPIO30 = 0; //GPIO30
    GpioCtrlRegs.GPADIR.bit.GPIO30 = 1; //Output

    //GPIO21 as an input

    GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0; // GPIO
    GpioCtrlRegs.GPADIR.bit.GPIO21 = 0; // input
    GpioCtrlRegs.GPAQSEL2.bit.GPIO21 = 0; // Xint1 Synch to SYSCLKOUT only

    //GPIO21 is XINT1


    GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 0x0015; // Xint1 is GPIO0
    XIntruptRegs.XINT1CR.bit.POLARITY = 01; // XINT1 Polarity configuration
    XIntruptRegs.XINT1CR.bit.ENABLE = 1; //enable Xint1

     EDIS;

    interrupt void xint1_isr(void)
    {
    counterxint++ ;

    GpioDataRegs.GPATOGGLE.bit.GPIO30=1;

    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;

    EINT;

    }

    The blue curve represents the external interrupt and yellow curve represents output of my GPIO30. I wanted to reduce the time gap between them as low as possible.

  • Nikhil,

    Do you think that the EPWM would work for you? The EPWM hardware trip response latency should be quicker than an XINT+software response.

    -Tommy
  • No. EPWM wont work, because i have to use an external signal (my sense signal from a control board) to generate an interrupt.

    Regards
    Nikhil