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.
Hi all I am using MCB2300 development kit ,on this kit i have two UART 0 and 1 where i have uart0 as working but my uart 1,2,3 is not responding ...i dont know y ...??. i just copied the uart0 function and used to initialized other uart 1,2,3 but failed to send any data out ...can any one tel me wts the problem...
hi ..
this is the uart0 initialization part
void init_UART0 (void) { PINSEL0 |= 0x00000050; U0FDR = 0; U0LCR = 0x83; U0DLL = 78; U0DLM = 0; U0LCR = 0x03; U0FCR = 0x03; U0IER = 0x00000005; VICIntEnable = (1 << 6); VICVectAddr6 = (unsigned long)UART0_IRQHandler; VICVectCntl6 = 15; }
//this is the initialization of uart1
void init_UART1 (void) { PINSEL0 |= 0x40000000; PINSEL1 |= 0x00000001; U1FDR = 0; U1LCR = 0x83; U1DLL = 78; U1DLM = 0; U1LCR = 0x03; U1FCR = 0x03; }
// THIS IS THE INITIALIZATION OF UART2
void init_UART2 (void) { PINSEL0 |= 0x00500000; U2FDR = 0; U2LCR = 0x83; U2DLL = 78; U2DLM = 0; U2LCR = 0x03; U2FCR = 0x03; }
// THIS IS THE INITIALIZATION FOR UART3
void init_UART3 (void) { PINSEL0 |= 0x0000000A; U3FDR = 0; U3LCR = 0x83; U3DLL = 78; U3DLM = 0; U3LCR = 0x03; U3FCR = 0x03; }
so out of this the uart 0 and 1 is working fine throught simulation and i get the data out from my comport and able to see it on the hyperterminal in PC .
but when i try to initialize the UART2 and 3 i am not able to get any pulse out i checked with the CRO.while similating i dont get the values changed for the UxLCR,UxFCR..nothing changes during the simulation while for the UART 0 and 1 i could c the changes in the table ...during the data sending out it hangs in the loop while (!(U3LSR & 0x20)); U3THR = data; like the LCR bit doesnt get set to transmit the data so it hangs in this while loop...
plz suggest
Please read the posting instructions for code - available just about the textbox where you enter your message.
In your first post, UART0 worked but not UART1 .. 3.
In your next post, UART0 and UART1 works, but not UART2 or UART3.
Is it intentional that only UART0 is interrupt-driven? It isn't too fun to poll several serial ports, unless you use very low baudrates.
You have noted that UART1 is different from UART0, 2 and 3, since it has modem interface lines.
Have you verified the contents of the TER register? Without transmit enable, no data will be sent.
"Please read the posting instructions for code - available just about (sic) the textbox where you enter your message."
That should read, "...just above the textbox..."
but it shouldn't need to be pointed out at all - it is really quite clear!
To get anywhere as a programmer - especially an embedded programmer - you need to learn to read documentation carefully, and pay attention to details like these...!
"you need to learn to read documentation carefully, and pay attention to details like these...!"
That is to say, "The OP needs to learn..."
I think I have too much to do at work right now. Too many strange posts - I really can't see where the "about" came from...
To get working UART2 and USERt3 on LPC you need to turn on the power for the UART2 and 3 in the PCON register. They are off by default for UART2/3.
Regards
Suvidh
hi Suvidh
thanks for the information ....yes they are off by default ....
Yes, that is an interesting point - especially since in one post the UART1 works, and on one post UART1 doesn't work.