This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TM4C123 UART1_Handler

Hi All;

I'm using uvision compiler. Below A portion of my code regarding UART1 RX interrupt.

I was using reading flags. I want to use interrupt.

I didn't get an interrupt. What is wrong?

#define UART_INT_EN *((unsigned long int *)(0xE000E100))

#define UART_INT_DIS *((unsigned long int *)(0xE000E180))

void UART1_Handler(void){

char_rxdata = (unsigned char)UART1-> DR;

UART1-> DR= char_rxdata;

UART1->ICR &=~(1u<<4); //UARTICR

}

void main(void){

UART_INT_EN |=(1u<<6); // Enable UART1 interrupt

UART1->IM |=(1u<<4); //UART Interrupt Mask (UARTIM) /

 

while(1);

}

  • For what processor?

    Any chance you need to enable some clocks, configure some pins, or set a baud rate?

    Typically writing a UART data register clears pending status automatically.

    Find some better examples for your processor and review available documentation.