Hi there,
I am trying to get an accelerometer to trigger an interrupt on PC6 when new data is available.
However, when trying to make this run it will only fire once. The accelerometer datasheet says that the pin will be cleared when the registers are read. I am out of ideas.
Thanks in advance.
Thomas.
I've created this function to initiate the pin:
void intSetup()
{
IntMasterEnable();
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, GPIO_PIN_6);
GPIOPadConfigSet(GPIO_PORTC_BASE,GPIO_PIN_6,GPIO_STRENGTH_8MA,GPIO_PIN_TYPE_STD_WPD);
GPIOIntClear(GPIO_PORTC_BASE, GPIO_PIN_6);
GPIOIntTypeSet(GPIO_PORTC_BASE, GPIO_PIN_6,
GPIO_RISING_EDGE);
GPIOIntEnable(GPIO_PORTC_BASE, GPIO_PIN_6);
IntEnable(INT_GPIOC);
}
And the interrupt is:
void accelInt(void){
//clear the time interrupt
GPIOIntClear(GPIO_PORTC_BASE, GPIO_PIN_6);
datacollected++;
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0);
readAccData(accelG);
bufferX[i]=accelG[0];
bufferY[i]=accelG[1];
bufferZ[i]=accelG[2];
i++;
if(i==1024){
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 4);
i=0;
}}
I have also editted startup_css.c
extern void accelInt(void);
accelInt, // GPIO Port C
etc