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