Other Parts Discussed in Thread: TM4C123GH6PM
Greetings:
I am moving some code from an LM4F120XL launchpad to the TM4C123GXL launchpad and moving from Stellaris to Tiva. This code worked on the 120 but I have not been successful in getting it to run on the 123. The problem is getting interrupts to work using GPIOIntRegister. Interrupts for timers and UARTs work fine through the startup_css.c vectors. The problem is with GPIO interrupts which are never being recognized. I'm afraid this may be a pin configuration issue.
In the Properties -> General setting I have selected Tiva TM4C123GH6PM as the device .In the Properties->Target Build -> Arm Compiler -> Predefined Symbols I have entered PART_TM4C123GH6PM and TARGET_IS_BLIZZARD_RA1. I have tried other variants such as _RB1 but have not been successful.
The project builds and links without errors. However, the interrup handlers loaded via GPIOIntRegister are never called.
Here are the includes:
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/pin_map.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/timer.h"
#include "driverlib/fpu.h"
#include "driverlib/uart.h"
#include "driverlib/debug.h"
#include "driverlib/rom.h"
Here is the code segment in question:
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
// Port B Pin 6 and Pin 7 Setup
GPIOIntRegister(GPIO_PORTB_BASE, PortBPin6IntHandler); // start things on rising edge
GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 |GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_6, GPIO_RISING_EDGE);
GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_FALLING_EDGE);
GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_4, GPIO_RISING_EDGE);
GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_5, GPIO_FALLING_EDGE);
GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_2, GPIO_RISING_EDGE);
GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_3, GPIO_FALLING_EDGE);
GPIOIntClear(GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
GPIOIntDisable(GPIO_PORTB_BASE, GPIO_PIN_3 | GPIO_PIN_5 | GPIO_PIN_7);
GPIOIntEnable(GPIO_PORTB_BASE, GPIO_PIN_6);
//GPIOIntClear(GPIO_PORTB_BASE, GPIO_PIN_6 );
IntMasterEnable();
The oscilloscope confirms the signals are reaching the appropriate Port B pins. The interrupt service routine is never called. Again, this code worked on the LM4C120. The only changes were changing the GPIOPinIntEnable, Disable, Clear, etc. to GPIOIntEnable per the Migration Instruction document.
Sure would appreciate some help. I have run out of ideas.
Thanks,
Dan