Hi all,
I am looking to get UART2 working on the LPC2388 microcontroller.
Currently, UART0 and UART1 works on it as they are provided in the sample code bundle (using uVision -- the first link under Embedded Software):
Arm7™ with 512 kB flash, 98 kB SRAM, Ethernet, USB 2.0 Device/Host/OTG, CAN, and 10-bit ADC | NXP
After going through the datasheet and user's manual (also given by the link above under the Documentation tab), I made some additions to include UART2 functionality. I can provide snippets of code upon request, but in short, here are the additions I made to start:
- I am enabling UART2 within the PCONP register (PCONP |= 0x01000000)
- I am enabling TXD2 and RXD2 within the PINSEL0 register (PINSEL0 |= 0x00500000)
- I am installing the interrupt handler using UART2's number (it's #defined as 28 in the header file given by NXP)
- The way I am initializing UART2 is the same way the sample code is initializing UART0 and UART1, with the exception of the registers (it's U2***, instead of U1*** and U0***).
- The way I am creating UART2's handler is the same way the sample code is creating the handlers for UART0 and UART1 (once again, with the exception of the registers)
- The way I am sending out UART2's data is the same way the sample code is sending out the data for UART0 and UART1 ("")
Here some other notes that may/may not help:
- Same baud rates and frequencies are being used
- I have confirmed that data is going into U2THR register (well, sort of.)
- The code seems like it is sending out the data, but I am not receiving it on the other side (RealTerm)
- I see data coming out for UART0 and UART1, but nothing for UART2
- Code is not being blocked anywhere
I did not see anything unique to UART2 in the user's manual that was not apparent in UART0 and UART1 other than the fact that it is off by default. I know that using an oscilloscope is one of the next options, but I want to rule out everything software related before it comes to that point.
Any insight on this is greatly appreciated.
Thank you,
Dan