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.

EXTERNAL INTERRUPT on GPIO F28069

Other Parts Discussed in Thread: CONTROLSUITE

Hi everyone,

my intent is to "read" the tachometer signal from a 12V fan by using external interrupts on GPIO-0.  I have some trouble to understand how does it works.

As first, my intent is just connect my GPIO-0 to a 3.3V signal and toggle a LED. Below ONLY the main steps that I do in my program:

  InitPieCtrl();

 InitPieVectTable();

EALLOW;

     GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 0; //0-GPIO  LED
     GpioCtrlRegs.GPADIR.bit.GPIO31 = 1; //1-output

    GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0;         // GPIO
    GpioCtrlRegs.GPADIR.bit.GPIO0 = 0;          // input
    GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 0;   // Xint1 is GPIO 0
 EDIS;

    XIntruptRegs.XINT1CR.bit.POLARITY = 1;      // Rising edge interrupt
    XIntruptRegs.XINT1CR.bit.ENABLE = 1;        // Enable Xint1


Once done that, becouse I use DSP BIOS, I enable the PIE INT 1.4 (that correspond to the XINT1) with a function called "count" that is something like this:

Uint32 cont=0;
void count(void){
    GpioDataRegs.GPATOGGLE.bit.GPIO31 = 1;
    cont++;
}


Now the problem is that, even if I supply the GPIO.0 with 3.3V the LED do not toggle and nothing happen. Where am I doing wrong?

Hope for an answer,

Best,

Andrea

  • Hi Andrea,

    Andrea Rendine said:
    my intent is to "read" the tachometer signal from a 12V fan by using external interrupts on GPIO-0.  I have some trouble to understand how does it works.

    This can be very well achieved by eCAP peripheral instead of GPIO as External interrupts.

    Andrea Rendine said:
    Now the problem is that, even if I supply the GPIO.0 with 3.3V the LED do not toggle and nothing happen. Where am I doing wrong?

    How is your external interrupt configured? Interrupt on rising edge or falling edge? Please refer the example code:

    C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_examples_ccsv5\external_interrupt

    Regards,

    Gautam

  • Hi Gautam,

    I've never used the eCAP peripheral and actually I don't know how I can implement it with the DSP BIOS interrupt.

    My signal is a PWM pulse (or just I can use a BUTTON to simulate a pulse, but again it doesn't work)  and I set the:    

        XIntruptRegs.XINT1CR.bit.POLARITY = 1;      // Rising edge interrupt
        XIntruptRegs.XINT1CR.bit.ENABLE = 1;        // Enable Xint1

    I think that do not work becouse I was wrong something on DSP BIOS.

    I have read on the datasheet of F28069 and I enabled HWI->PIE.INTERRUPTS->PIE_INT1.4 and set my function _count that simply "count" each time an interrupt comes, but the value is always 0 and I think that never happen the interrupt.

    Can you help me in someway about the code?

    Thanks,


    Andrea

  • Andrea, is DSP bios your requirement? or its a pre-written code that you're modifying?
  • Gautam, 

    actually is a pre-written code but is necessary the usage of the DSP BIOS.

    Best, 

    Andrea