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.

TM4C1233E6PZ: Automatic enable and disable interrupt in TM4C1233E6PZ or not?

Part Number: TM4C1233E6PZ

Tool/software:

I am using TM4C1233E6PZ controller and i am using 3 interrupts

  1. uart isr
  2. gpio isr
  3. timer isr   

I just want to know that these ISR automatically handle enable and disable global interrupt or not?

Actually i want that if any ISR is already triggered then no other ISR should be triggered.

My ISR is :-


extern "C" void DEBUGUARTIntHandler(void)
{
    uint32_t ui32Status;
    // Get the interrrupt status. //
    ui32Status = UARTIntStatus(UART4_BASE, true);
    static int msglen=0,datacnt=0;

    char tmpudr;
    UARTIntClear(UART4_BASE, ui32Status);
    // Loop while there are characters in the receive FIFO. //
    while(UARTCharsAvail(DEBUG_UART_BASE))
    {
        tmpudr = UARTCharGetNonBlocking(UART4_BASE);

        UARTCharPutNonBlocking(UART4_BASE, tmpudr);
		// data handling
    }

}

void SysTickIntHandler(void)
{
    // static uint16_t ADC_RAW = 0;

    if(u32DelayCounter != 0U)
    {
        u32DelayCounter--;
    } 
}  

extern "C" void GPIODIntHandler(void)
{
    uint8_t inputPinSts = 0;
    uint32_t EXTI_Sts = GPIOIntStatus(GPIO_PORTD_BASE, true);


    GPIOIntClear(GPIO_PORTD_BASE, EXTI_Sts);


    if(EXTI_Sts)
    {
        EXTI_Sts = 0;
        inputPinSts = GPIOPinRead(GPIO_PORTD_BASE, GPIO_PIN_2)/GPIO_PIN_2;

        if(inputPinSts)
        {
           // GPIOPinWrite(LED_PORT_BASE, LED2_PIN, GPIO_HIGH);
           GPIOPinWrite(LED_PORT_BASE, LED2_PIN, LED2_PIN);

        }
        else
        {
            GPIOPinWrite(LED_PORT_BASE, LED2_PIN, GPIO_LOW);
           // GPIOPinWrite(LED_PORT_BASE, LED2_PIN, LED2_PIN);
        }
    }
}

  • Hi,

      No, the hardware will not automatically disable other interrupts when you are in a ISR. You will need to do that yourself in the application. Please refer to the Interrupts table in the datasheet. As you can see UART4 is at vector 76 and GPIOD (if this the port you are using) is at 19. I don't know which timer you use, but they are starting at vector 35. The GPIOD will have priority than Timer and UART4. In another word, if you are servicing UART4 ISR and an GPIOD interrupt is received, it will preempt UART4 and jumps to GPIOD ISR. If you want to prevent other interrupts from preempting your current ISR, you can manually disable all interrupts. Below code is an example to disable all interrupts. But you need to be careful that other interrupts that do not get serviced in time may create other problems for you. For example, you GPIO may miss an edge on the interrupt. It is up to your application on how to handle the situations. 

    //
    // Disable all processor interrupts. Instead of disabling them
    // one at a time, a direct write to NVIC is done to disable all
    // peripheral interrupts.
    //
    HWREG(NVIC_DIS0) = 0xffffffff;
    HWREG(NVIC_DIS1) = 0xffffffff;
    HWREG(NVIC_DIS2) = 0xffffffff;
    HWREG(NVIC_DIS3) = 0xffffffff;