How to use RS485 in LPC1768

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

How to use RS485 in LPC1768

2,704 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ajmalm543 on Thu Nov 08 21:21:41 MST 2012
Haii all
I want to use a RS485 interface in my project using LPC 1768..datasheet says that UART1 of lpc1768 is rs485 compatible but uart1 has only one Rx and Tx lines available.So how can it be used as rs485.does it support halfduplex or fullduplex mode?
i have one more query.can the modem control lines of uart1 be used with any other uart??
thankyou.
7 Replies

1,372 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by graynomad on Sun Nov 11 22:54:59 MST 2012
RS-422 and 485 are electrical specifications, they do not specify the duplexness, number of lines etc AFAIK. (422 is +-6v and 485 is +12-7v)

RS-422 is normally full-duplex (and I think the original drivers don't allow for half-duplex although most people use 485 chips that do)

RS-485 is [B]normally [/B]half-duplex but can be either, it's totally up to the application and the transceivers are available in both styles.
0 Kudos

1,372 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Sun Nov 11 22:42:37 MST 2012

Quote: fjrg76


The point here is that RS485 uses three lines, Tx,Rx, and Dir. In the LPC1227 the Dir pin is multiplexed in the ~RTS pin for the UART0. Your uC must have something similar.



http://en.wikipedia.org/wiki/RS-485
ST485
0 Kudos

1,372 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by graynomad on Sun Nov 11 22:27:53 MST 2012
The RTS pin is used for automatic line reversal in RS485 mode. Have a look at the RS485CTRL register (that's on the 1227, may have a different name on the 1768) for the control bits.

There are other RS485 regs as well that you will need to look into.
0 Kudos

1,372 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ajmalm543 on Sun Nov 11 21:28:37 MST 2012
Half duplex or full duplex is not a big issue.
The doubt is about the differential set of lines that are to be used for rs485 communication.
uart1 has rx,tx and the codem control lines.out of these, which are to be used for rs485 communication?
0 Kudos

1,372 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Sat Nov 10 12:09:40 MST 2012
If it's full-duplex, then it becomes RS422 :D and it would all about your underlying hardware, e.g., you can use two RS485 chips to get the RS422 interface.

The point here is that RS485 uses three lines, Tx,Rx, and Dir. In the LPC1227 the Dir pin is multiplexed in the ~RTS pin for the UART0. Your uC must have something similar.
0 Kudos

1,372 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by js-nxp on Sat Nov 10 01:41:57 MST 2012

Quote:
Can the RS485 be full-duplex?

Not by definiton, even though you CAN make it work full duplex it would then be more like RS422.
0 Kudos

1,372 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Fri Nov 09 23:44:06 MST 2012

Quote: ajmalm543
Haii all
I want to use a RS485 interface in my project using LPC 1768..datasheet says that UART1 of lpc1768 is rs485 compatible but uart1 has only one Rx and Tx lines available.So how can it be used as rs485.does it support halfduplex or fullduplex mode?
i have one more query.can the modem control lines of uart1 be used with any other uart??
thankyou.



How many lines uses the RS485 interface?
Can the RS485 be full-duplex?

You might answer those question before going further =)

The modem control lines only works with its UART, it means, you can't exchange them between uarts, but what you can actually do is to use the multiplexed lines (when those control lines are replicated in different pins).
0 Kudos