We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have problem with UART.LPC2378 is sended data to computer. I use: MSEL=5,NSEL=1,CCLKsel=4->cclk=(12*5*2)/4=30MHz PCLK_UART2=cclk this is my programe: #include <LPC23xx.H> #define tem (1<<6)
void tao(void) { unsigned long Fdiv; PCONP=0x03000000; PINSEL0 = 0x00000050; /* RxD0 and TxD0 */
U2LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */ Fdiv = ( 30000000 / 16 ) / 9600 ; /*baud rate */ U2DLM = Fdiv / 256; U2DLL = Fdiv % 256; U2LCR = 0x03; /* DLAB = 0 */ U2FCR = 0x07; /* Enable and reset TX and RX FIFO. */ } int main(void) {int i,a; char c[]="tran luc"; tao(); a=200; while(a) {i=0; while (c[i]) {U2THR=c[i]; i++; } U2THR=0xA; U2THR=0xD; while (!(U2THR & tem)); a--; } }
sorry.LPC2378 isn't sended to mycomputer.can You help me?