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.

TM4C1231H6PM: Can't get interrupt to work on port A

Part Number: TM4C1231H6PM
Other Parts Discussed in Thread: EK-TM4C123GXL

I have several interrupts on other ports that work fine, but I can't get the interrupt to work on port A.  The following works:

    // B0 In  RmtRxd
    // B1 Out RmtTxd
    // B2 Out SCL        LCD
    // B3 I/O SDA        LCD
    // B4 In  Mode Switch
    // B5 In  Lock Switch
    // B6 In  TP37        PU
    // B7 In  TP15        PU

    // I2C0 & UART1//

    GPIO_PORTB_AFSEL_R |=   0x0F;        // Alt Funct:  I2C0 and UART1.
    GPIO_PORTB_PCTL_R  &= ~(0x00001111);    // Mux Pins to I2C0 and UART1.
    GPIO_PORTB_PCTL_R  |=   0x00001111;        //
    GPIO_PORTB_ODR_R   |=   0x08;        // Open Drain Pads.

    GPIO_PORTB_DATA_R = 0x02;            // Outputs High.
    GPIO_PORTB_PUR_R  = 0xC0;            // Pullups.
    GPIO_PORTB_DIR_R  = 0x02;            // Outputs.
    GPIO_PORTB_DEN_R  = 0xFF;            // All On.

    IntRegister(INT_GPIOB, PortB_Interrupt);            // Register Interrupt Handler.
    GPIO_PORTB_IBE_R  = MODE_BUTTON_BIT | LOCK_BUTTON_BIT;    // Interrupt on both edges.
    GPIO_PORTB_IM_R   = MODE_BUTTON_BIT | LOCK_BUTTON_BIT;    // Enable Interrupts.

Note that MODE_BUTTON_BIT is 0x10 and LOCK_BUTTON_BIT is 0x20.

But the following does not work:

    // A0 In  RxD/
    // A1 Out TxD/
    // A2 In  TP33        PU
    // A3 In  BattPwrSense          v6.0
    // A4 In  TP35        PU
    // A5 In  TP36        PU
    // A6 (Out) SCL2        USB
    // A7 (I/O) SDA2        USB  PU


    GPIO_PORTA_AFSEL_R = 0x03;                // Alt Funct:  UART0.
    GPIO_PORTA_PCTL_R  = 0x00000011;        //

    GPIO_PORTA_PUR_R  = 0xB4;            // Pullups.

    GPIO_PORTA_DEN_R  = 0x0B;            // All On.

    IntRegister(INT_GPIOA, PortA_Interrupt);// Register Interrupt Handler.
    GPIO_PORTA_IBE_R = PA_SW_SENSE_BIT;     // Interrupt on both edges.
    GPIO_PORTA_IM_R  = PA_SW_SENSE_BIT;     // Enable Interrupts.

Thanks, Doug

P.S., I'm using the Sourcery CodeBench IDE if it matters.

  • Hello Doug,

    We don't support applications which use register level calls/commands, please use our TivaWare software package which handles that level of control for you already. There are already examples for interrupts included, once you install TivaWare you can find one at [Install Path]\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c123gxl\interrupts

    TivaWare was written to provide a plethora of API's to allow you to setup TM4C devices and enable applications without needing to worry about all the minor details of how to initialize/configure peripherals. Because we invested so much time into making TivaWare usable for all applications customers face, we do not support register level code anymore. Therefore to get support with TM4C devices, we ask that you use TivaWare as your starting point. If you are having challenges with that, we'll be happy to try and help you through them.

    You can download the latest TivaWare version from: http://www.ti.com/tool/sw-tm4c