Hi all ! Now I am making a communication between two LPC2368 chips (one on MCB2300 Ver3.1 board, one on LPC236x_DevMaster Board). On MCB2300 board I use UART2 as Receiver, the UART3 on remain board I use as Transmitter. I use two difference port because now I test the both port on MCB2300 board only. I run code and saw : * These is interrupt at Transmitter, but no signal come-out TXD3 pin. * Nothing on RXD2.
Below is my code.
int main (void) { for ( i = 0; i < BUFSIZE; i++ )// Initialize TX value { Receive_UART2_Buffer[i] = 0; Transmit_UART3_Buffer[i] = i; } lcd_init(); lcd_clear(); UARTInit(2, 115200);/* baud rate setting for UART2*/ UARTInit(3, 115200);/* baud rate setting for UART3*/ while (1) { Check_TEMT = (U3LSR >> 6)&0x01; //Checks the UnTHR and UnTSR in UART3 are empty or not if ( (Check_TEMT)&(Int_Empty_TX_Done)) //The UnTHR and UnTSR are empty and UART3_ISR completed { j++; Int_Empty_TX_Done = 0 ; // Un-set global flag UART3_Send((BYTE *)Transmit_UART3_Buffer, 1 ); // Send 1byte when both thUnTHR and UnTSR are empty }
in UART_int() function I turned on already PCONP register and PINSEL0 for UART2/3 function
PCONP |= (0x01<<25); // Turn on UART3 power PINSEL0 |= (0x02<<0); // Set P0.0 as TXD3 PINSEL0 |= (0x02<<2); // Set P0.1 as RXD3 PCONP |= (0x01<<24); // Turn on UART2 power PINSEL0 |= (0x01<<22); // Set P0.11 as RXD2 PINSEL0 |= (0x01<<20); // Set P0.10 as TXD2
and in ISR_function
void UART3Handler (void) __irq { U3FCR |= (0x01<<2) ; // TX FIFO Reset Int_Empty_TX_Done = 1 ; VICVectAddr = 0; /* Acknowledge Interrupt */ }
I printed the value of "j" on LCD, I saw it is increased, meaning the UART3 ( Transmitter ) interrupted. Anybody can show me where my mistake ? And help me slove it. Thanks everybody.