LPC2388 UART2 Issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC2388 UART2 Issue

Jump to solution
2,057 Views
danzarate
Contributor I

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

Labels (1)
0 Kudos
Reply
1 Solution
1,945 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Dan,

If you route the uart2 pins to P2.8/P2.9, what is the result?

BTW, can you enter uart2 transmitter ISR? can you see the signal of uart2 TXD via scope?

Hope it can help you

BR

XiangJun Rong

pastedImage_4.png

View solution in original post

0 Kudos
Reply
2 Replies
1,946 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Dan,

If you route the uart2 pins to P2.8/P2.9, what is the result?

BTW, can you enter uart2 transmitter ISR? can you see the signal of uart2 TXD via scope?

Hope it can help you

BR

XiangJun Rong

pastedImage_4.png

0 Kudos
Reply
1,945 Views
danzarate
Contributor I

XiangJun,

Switching to P2.8 and P2.9 for the pins worked! The issue was actually on my side as I just misread a schematic. I did not notice the 2nd pair of TXD2/RXD2. I can also see that the code is going into the transmitter ISR. All verified with a scope. Thank you!

Dan

0 Kudos
Reply