// Configure the pins for UART usePUAPAR |= ((PRIMARY_FUNCTION_Q << BIT_0_Q_SHIFT) | (PRIMARY_FUNCTION_Q << BIT_1_Q_SHIFT)); // Set TX/RX on UA// Enter interrupt handlerIC_ICR_0_13 = UART0_INTERRUPT_PRIORITY; // define interrupt level and priorityfnSetIntHandler(UART0_VECTOR, (unsigned char *)_SCI0_Interrupt); // enter the handler routineIC_IMRL_0 &= ~(UART0_PIF_INT_L | MASK_ALL_INT); // unmask interrupt source//configure speed and mode...// enable rx (tx is enabled only during transmission)UCR_0 = UART_RX_ENABLE;UIMR_UISR_0 = (ucEnabledState[Channel] |= (UART_RXRDY_MASK)); // this register can not be read so we keep a backup of its content!!// interrupt on character receptionstatic __interrupt__ void _SCI0_Interrupt(void){ unsigned char ucState; while ((ucState = (UIMR_UISR_0 & UART_INTERRUPTS)) != 0) { // while interrupts present if (ucState & UART_RXRDY_MASK) { fnSciRxByte(UTB_RB_0, 0); // receive data interrupt - read the byte } if (ucState & UART_TXRDY_MASK) { fnSciTxByte(0); // transmit data empty interrupt - write next byte } }}