cc2541 , uart1
I have done my uart init in this way but not get any interrupt
void uart_init(void)
{
// Enable UART on channel 1 alternate 1, 115200,8/N/1 w/o flow control
URX1IE = 1; // enable receive interrupt on UART1
// UART pins on p0.2, p0.3, p0.4, p0.5 (CTS/RTS/TXD/RXD respectively)
P0SEL |= BIT(2) | BIT(3) | BIT(4) | BIT(5); //BIT(2) | BIT(3) |
P2DIR |= BIT(6); // UART1 has priority in Port0
U1BAUD = BAUD_M; // baud mantissa
U1GCR = BAUD_E; // baud exponent
//U1UCR = BIT(1); // stop bit state is high, and flow is disabled (set BIT(6) to enable)
U1UCR = 0x82;
U1CSR = BIT(7) | BIT(6); // set USART mode to UART, and enable
EA = 1;
#pragma vector=URX1_VECTOR
__interrupt void uart1_rx_isr(void)
{
}