Hello ,
Im trying to send some data via UART1 serial from tiva-c launchpad and it seems like the data is send but the interrupt is not called.
Here is my code
#include <stdbool.h> #include <stdint.h> #include <inc/hw_memmap.h> #include <driverlib/sysctl.h> #include <driverlib/gpio.h> #include <inc/hw_ints.h> #include <driverlib/interrupt.h> #include <driverlib/uart.h> #include "driverlib/pin_map.h" void UARTIntHandler(void); int main() { int data=1; SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); //enable peripheral clock for UART0 SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); GPIOPinConfigure( GPIO_PB0_U1RX ); GPIOPinConfigure( GPIO_PB1_U1TX ); GPIOPinTypeUART( GPIO_PORTB_BASE , GPIO_PIN_0 | GPIO_PIN_1 ); //disable UART0 UARTDisable(UART1_BASE); //configure divisor and format UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 2400, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); //enable FIFO UARTFIFOEnable(UART1_BASE); //is enabled automatically when UARTEnable() is called //enable individual UART interrupt source UARTIntEnable(UART1_BASE, UART_INT_RX | UART_INT_RT); //enable UART0 interrupt UARTIntRegister(UART1_BASE, UARTIntHandler); //IntEnable(INT_UART0); //enable processor interrupt IntMasterEnable(); //enable UART0 UARTEnable(UART1_BASE); UARTCharPut(UART1_BASE,data) ; while(1); } void UARTIntHandler(void) { uint32_t UIstatus = UARTIntStatus(UART0_BASE, true); UARTIntClear(UART0_BASE, UIstatus); }