Lpc1769 uart

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

Lpc1769 uart

1,732 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcuguy on Wed May 18 10:43:09 MST 2011
Hello.  I am trying to use UART0 on the LPC1769.  I have a serial cable connected to RxD0 and TxD0 and ground.  This cable is connected to a Belkin USB to serial that is connected into a USB port on my PC.  I am able to download code onto the board, but the terminal displaying the output always displays random characters.  Any ideas on how to get it to display the actual text I'm printing out.  I tried just about every baud rate so I don't think that's the problem anymore.  Thanks for any help.
0 Kudos
18 Replies

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by samfar19 on Wed Mar 05 04:56:06 MST 2014
hello There!
Does anyone use sample code(lpc1788) RS232/UART?
I am trying to this sample code but it doesn't work if you know somebody pls give me some idea. my pc is putty to lpc1788.

BR
Sami
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 18 17:27:36 MST 2011

Quote: jharwood
I think that they take the PHY's link and activity LED signals down to the MagJack which usually have integrated LEDs.



That was what I thought but was not sure.
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Wed May 18 17:07:07 MST 2011

Quote: larryvc


@Zero, What are the wires at pins J6-30 and J6-31used for on your board in this picture?




I think that they take the PHY's link and activity LED signals down to the MagJack which usually have integrated LEDs.
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 18 16:55:40 MST 2011
@mcuguy, Excuse me for going off topic but I want to ask Zero a question and other than creating a new thread there is no IM on the forum.

@Zero, What are the wires at pins J6-30 and J6-31used for on your board in this picture?

http://www.flickr.com/photos/58892165@N08/5419968233/
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 18 15:14:27 MST 2011
If you are old (and brave) enough to use a knife, you can look inside your USB-RS232 converter.

A lot of them are including an USB to serial (TTL) bridge and a serial to RS232 converter.

Pictures below show a cheap version with PL2303 USB to serial chip.

Took me about 30 minutes to remove serial to RS232 chip and connect new TxD / RxD / GND wires.

http://www.flickr.com/photos/58892165@N08/5734567133/

http://www.flickr.com/photos/58892165@N08/5734566999/
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcuguy on Wed May 18 13:46:47 MST 2011
Yes, it's an LPCXpresso LPC1769 board.  I'll have to try one of the other methods you mentioned.  This UART became more difficult than I thought it would be, but thanks for the pointers.
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 18 13:30:39 MST 2011
You can get an FTDI cable or breakout adapter at places like Sparkfun or Adafruit Industries.  The have both 3.3V and 5V versions available.  Either one will work.

I would remove the serial connector from the LPC1769.  It will be easier to connect these adapters without it.

You never said if this an LPCXpresso1769 board or a board of your own design. I'm assuming the former, am I right about this?
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcuguy on Wed May 18 12:49:17 MST 2011
Well thanks guys.  That seems like it would be the problem.  So would you recommend a better way to connect the LPC1769 to a terminal for viewing printf's or should I get a different converter (like MAX3221)?
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 18 12:42:05 MST 2011

Quote: Zero
Come on, that's nonsense!

USB<->Serial means USB<->RS232.

RS232 levels can destroy your MCU, so don't connect your MCU to RS232 !!



My last post was to let him know about the signal levels being too high but didn't have time to explain the rest.  Cable internet was going offline for a while.

Thanks Zero.
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcuguy on Wed May 18 12:40:54 MST 2011
Hmmm I believe it is. The Rx pin coming from the PC has a constant 9.1V and it drops to 8.6V when I type something to send to the LPC board.  The Tx pin from the PC reads 0V and the Tx pin coming out of the LPC board reads 3.1V.
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 18 12:31:15 MST 2011
Come on, that's nonsense!

USB<->Serial means USB<->RS232.

RS232 levels can destroy your MCU, so don't connect your MCU to RS232 !!

Fortunately a lot of modern USB to RS232 converters are to weak to destroy your MCU :mad:

You need something like a MAX3221 to convert levels:

http://www.maxim-ic.com/datasheet/index.mvp/id/1069

Or you use a Pseudo-RS232:

http://dave.fraildream.net/micro/periph/232-ttl.html

This circuits also inverts (that's the reason why a direct connection will not work, even if it doesn't destroy your MCU).
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 18 12:21:50 MST 2011
Are the 9V signals getting to UART0 on the LPC1769?

See user manual:

[SIZE=5]UM10360[/SIZE]

7.1.1 LPC17xx pin description

I/O pins on the LPC17xx are 5V tolerant and have input hysteresis unless indicated in the
table below.
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcuguy on Wed May 18 12:16:32 MST 2011
The setup I have is a USB cable from the PC to the USB port on the LPC1769.  Then I have a serial cable connected to RxD0, TxD0, and GND on the LPC1769 that connects to an extended serial cable that connects into the serial port of the Belkin F5u409.  The USB end of the Belkin is connected into the USB port on the PC.
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 18 12:06:19 MST 2011

Quote: mcuguy
Thanks for the response.  I am using the LPC-Link to download code.  The signal levels at the end of the USB adaptor seem to be correct.  I tested and got just over 9V on the receiver pin from the cable when sending from the PC.



Is that connected to UART0 on the LPC1769 directly or through a MAX232 chip or equivalent?

Can someone else on the forum follow up on this as I will be offline for a while?
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcuguy on Wed May 18 12:02:29 MST 2011
Thanks for the response.  I am using the LPC-Link to download code.  The signal levels at the end of the USB adaptor seem to be correct.  I tested and got just over 9V on the receiver pin from the cable when sending from the PC.
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 18 12:00:17 MST 2011
You might want to try the values given in this post by jharwood.

http://knowledgebase.nxp.com/showpost.php?p=7292&postcount=5
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 18 11:09:42 MST 2011

Quote: mcuguy
... I have a serial cable connected to RxD0 and TxD0 and ground.  This cable is connected to a Belkin USB to serial that is connected into a USB port on my PC.  I am able to download code onto the board...



For clarification:

Are you downloading code through UART0?

What are the signal levels at the serial end of the USB adapter cable?
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed May 18 11:01:30 MST 2011
Hi mcuguy,

Read this post and the rest of the thread.   I was able to get dependable UART0 communications up to 921600.

http://knowledgebase.nxp.com/showpost.php?p=6592&postcount=12

Change these values in your CMSISv1p30_LPC17xx ---    system_LPC17xx.c file.  Ignore the CMSISv2 stuff mentioned in the thread.

HTH,
Larry
0 Kudos