Hello, everyone
I'm having a problem while trying to detect a 'rising edge' interrupt on pin PB1. (I'm using a TM4C123G, as I stated in another post, which I'll soon update, as soon as I get this part working).
I've read numerous posts, the part's datasheet, the errata, the peripheral Driver manual, everything I could find... but still can't manage to work around this issue.
This is the code I use to configure GPIO's PB1 as an interrupt source for Rising Edge signals:
void InitializeSensor(void) { ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); //PORT B ROM_SysCtlDelay(3); GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_1); //PB1 // GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_1, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPD); ROM_GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_1, GPIO_RISING_EDGE); GPIOIntEnable(GPIO_PORTB_BASE, GPIO_PIN_1); ROM_IntEnable(INT_GPIOB); }
This is my Interrupt Handler Routine:
void GPIOBInthandler(void) { unsigned long ulStatus; ulStatus = GPIOIntStatus(GPIO_PORTB_BASE, true); GPIOIntClear(GPIO_PORTB_BASE, GPIO_PIN_1); //Clear Interrupt if((ulStatus & GPIO_PIN_1)==GPIO_PIN_1) { SensorCounter++; } }
And finally, this is the circuit I've used to generate the digital signal:
Some clarifications:
i) I've connected every other PORTB input to GND through a 100ohm resistor, so they don't generate "false" interrupts.
ii) I've used 100 ohm in R2, so I can use the "Weak Pull Down" option.
iii) I've correctly added the Interrupt Handler in the Startup file.
iv) The digital "high" signal voltage level, is around 3V (As PB1 can stand up to 3.6V)
v) I've checked the errata, but It doesn't mention any failure regarding PB1 input.
When I execute the program, I'm having the interruption permanently triggered, even when there isn't any voltage present in PB1.
When I DO trigger the sensor, (i.e, obtain the 3V in the pin), I don't get any response at all..
I'd appreciate any feedback on this matter.
Kind Regards,
Martín