Reply by naderus2000 October 3, 20072007-10-03
Hi,
in 9 bit recive(slave mode) with lpc2000 uart how can I detect the
state of 9th bit(parity bit is 1 or 0)?

An Engineer's Guide to the LPC2100 Series

Reply by Gennady Palitsky November 22, 20062006-11-22
Thanks to everyone who responded to my 9 bit UART problem.
I think I have quite clear understanding of possibilities now.

So the only problem for me now is availability of Keil's MCB2300 board.
The say it will be available sometimes in December.

And - have anybody heard anything on LPC24xx release ?

Gennady

----- Original Message -----
From: Martin Honeywill
To: l...
Sent: Tuesday, November 21, 2006 7:25 AM
Subject: [lpc2000] Re: 9 bit uart - correction
--- In l..., "gen_4p" wrote:
> Question: have anybody tried to implement 9 bit uart protocol on LPCs?
>

Hi Gennady,

Yes I have done this on an LPC2129, I believe the UART is the same in
the LPC23xx.

We use a half duplex RS485 link with the master sending a message with
the 9th bit set high. We use the parity interrupt to detect this start
byte. We run at a baud rate of 250kbaud.

Sending would be easier, you would just set the appropriate parity
mode transmit the first byte with the 9th bit set, then switch parity
modes. This means that you would have to switch the FIFO off :-(, at
least for the transmission of the first byte.

We currently turn the FIFO off.

Contact me if you want more specific information.

Regards

Martin Honeywill
Reply by Tom Walsh November 21, 20062006-11-21
Gennady Palitsky wrote:
>
> You mean using external uart, right?
> That's what I'm trying to avoid, otherwise I can use any 8 bit micro
> (like Philips 8 bit LPC line) for serial port processing.
>

NO, that is not what he means. Most of the 16C4x0 style of UARTs
capable of Forced Parity can do RS485 9 bit communications. You force
the parity to "0", when a 9 bit byte is received with the parity bit
"set" to "1", this causes a parity error. Hence, a parity error on a
byte means that you have the Address Mark.

Turning the Fifo off will avoid issues with transmitting a correct 9th
bit value when it must be changed. If you don't send the 9th bit set,
as some protocols will allow, you can leave the Fifo on and look for
recieve parity errors.

TomW
--
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net http://cyberiansoftware.com http://openzipit.org
"Windows? No thanks, I have work to do..."
----------------
Reply by Martin Honeywill November 21, 20062006-11-21
--- In l..., "gen_4p" wrote:
> Question: have anybody tried to implement 9 bit uart protocol on LPCs?
>

Hi Gennady,

Yes I have done this on an LPC2129, I believe the UART is the same in
the LPC23xx.

We use a half duplex RS485 link with the master sending a message with
the 9th bit set high. We use the parity interrupt to detect this start
byte. We run at a baud rate of 250kbaud.

Sending would be easier, you would just set the appropriate parity
mode transmit the first byte with the 9th bit set, then switch parity
modes. This means that you would have to switch the FIFO off :-(, at
least for the transmission of the first byte.

We currently turn the FIFO off.

Contact me if you want more specific information.

Regards

Martin Honeywill
Reply by "Lee, Ron" November 20, 20062006-11-20
Gennady,

There was a thread about this very topic 11 months ago. The subject
line is "Re: RS485 9 Bit Comms on LPC2148". Message numbers 11318 and
11322 are the ones I saved on the subject.

Ron

________________________________

From: l... [mailto:l...] On Behalf
Of Gennady Palitsky
Sent: Monday, November 20, 2006 9:27 AM
To: l...
Subject: Re: [lpc2000] 9 bit uart

Don't need parity.
Think it may work...

thanks,
Gennady

----- Original Message -----
From: Bryce Schober
To: l...
Sent: Monday, November 20, 2006 11:34 AM
Subject: Re: [lpc2000] 9 bit uart

On 11/19/06, gen_4p >
wrote:
>
> Hi,
> I need to interface an existing 485 network to ethernet.
> Protocol is using 9 bit communication for the address recognition.
>
> I was going to use lpc2376 for 485<->Ethernet adapter, but can't find
> any 9 bit capability on lpc uarts.
> Have I overlooked something, or LPCs don't have it.
> May anyone suggest a way to implement it on LPC?
>
> Thank you,
> Gennady
> .
>

If the protocol doesn't require parity, then the usual method is to set
up
the lpc to receive w/ parity and re-interpret the parity error/non-error
as
data. If the protocol does require parity on top of the 9 bits, then
you're
screwed. Note that with the NXP uarts, you'll need to read the line
status
register before the FIFO... read the manual carefully.

--
Bryce Schober
Reply by Micron Engineering November 20, 20062006-11-20
gen_4p ha scritto:
>
> In my post on 9 bit uart on LPC I mistakenly mentioned LPC2376 -
> actually I meant LPC2368.
> So again:
> I need to interface an existing 485 network to ethernet.
> Protocol is using 9 bit communication for the address recognition.
> Can't find any 9 bit capability on LPC uarts.
> Have I overlooked something, or LPCs don't have it?
>
> Question: have anybody tried to implement 9 bit uart protocol on LPCs?
>

You have to use Stick parity bit paing attention to this bit to tx 9 bit
data if you need to have 1st byte with 9bit high and other bytes with
9th bit low.:

This is an LSR register bit
b6 TEMT Transmitter Empty. Indicates that the THR, FIFO, and transmit
shift register are all empty. *This bit does not generate an interrupt*.
If you want to use stick parity to transmit 9-bit values, you can't
change the stick parity value until the transmitter is empty, so you
must poll this bit. You must also disable the FIFOs to send 9-bit values.

>
> I can imagine a few ways:
> For reception - accept framing error (no stop bit error) as indication
> of active 9th bit.
> For transmission - bit banging or using AND gate with extra pin to
> insert 9th bit = 0 after 8 bit transmission.
>
> I don't really like any of the above. Any ideas?
>
> Also a general question - there is a provision of 5 to 8 bit
> transmission on LPC, but none for 9 bit. I never used less than 8 bit
> - any reason for that ?
>
> Gennady
>
>
> 06.48
>
Reply by Gennady Palitsky November 20, 20062006-11-20
Don't need parity.
Think it may work...

thanks,
Gennady

----- Original Message -----
From: Bryce Schober
To: l...
Sent: Monday, November 20, 2006 11:34 AM
Subject: Re: [lpc2000] 9 bit uart
On 11/19/06, gen_4p wrote:
>
> Hi,
> I need to interface an existing 485 network to ethernet.
> Protocol is using 9 bit communication for the address recognition.
>
> I was going to use lpc2376 for 485<->Ethernet adapter, but can't find
> any 9 bit capability on lpc uarts.
> Have I overlooked something, or LPCs don't have it.
> May anyone suggest a way to implement it on LPC?
>
> Thank you,
> Gennady
> .
>

If the protocol doesn't require parity, then the usual method is to set up
the lpc to receive w/ parity and re-interpret the parity error/non-error as
data. If the protocol does require parity on top of the 9 bits, then you're
screwed. Note that with the NXP uarts, you'll need to read the line status
register before the FIFO... read the manual carefully.

--
Bryce Schober
Reply by Gennady Palitsky November 20, 20062006-11-20
That is what I thought (compatible..).

Thank you,
Gennady

----- Original Message -----
From: unity0724
To: l...
Sent: Monday, November 20, 2006 11:52 AM
Subject: [lpc2000] Re: 9 bit uart - correction
Hi, Sorry, I mean...
>From LPC213x data sheet, you should be able to program
the Uart's (16C550 compatible) parity bit to either
"forced sticky 1" or "forced sticky 0". (Have not read
LPC23xxx datasheet yet but assume they are the same)
Regards

--- In l..., "Gennady Palitsky"
wrote:
>
> You mean using external uart, right?
> That's what I'm trying to avoid, otherwise I can use any 8 bit
micro (like Philips 8 bit LPC line) for serial port processing.
>
>
> ----- Original Message -----
> From: unity0724
> To: l...
> Sent: Monday, November 20, 2006 11:04 AM
> Subject: [lpc2000] Re: 9 bit uart - correction
>
>
> --- In l..., "gen_4p" wrote:
> >
> > In my post on 9 bit uart on LPC I mistakenly mentioned
LPC2376 -
> > actually I meant LPC2368.
> > So again:
> > I need to interface an existing 485 network to ethernet.
> > Protocol is using 9 bit communication for the address
recognition.
> > Can't find any 9 bit capability on LPC uarts.
> > Have I overlooked something, or LPCs don't have it?
> >
> > Question: have anybody tried to implement 9 bit uart protocol
on
> > LPCs?
> >
> > I can imagine a few ways:
> > For reception - accept framing error (no stop bit error) as
> > indication
> > of active 9th bit.
> > For transmission - bit banging or using AND gate with extra
pin to
> > insert 9th bit = 0 after 8 bit transmission.
> >
> > I don't really like any of the above. Any ideas?
> >
> > Also a general question - there is a provision of 5 to 8 bit
> > transmission on LPC, but none for 9 bit. I never used less
than 8
> > bit
> > - any reason for that ?
> >
> > Gennady
> >
>
> Could you use that "forced sticky parity bit" in the
> 16C550 as 9th bit?? (make sure fifo turned off)
> Regards
>
>
>
>
>
>
>
Reply by unity0724 November 20, 20062006-11-20
Hi, Sorry, I mean...
>From LPC213x data sheet, you should be able to program
the Uart's (16C550 compatible) parity bit to either
"forced sticky 1" or "forced sticky 0". (Have not read
LPC23xxx datasheet yet but assume they are the same)
Regards

--- In l..., "Gennady Palitsky"
wrote:
>
> You mean using external uart, right?
> That's what I'm trying to avoid, otherwise I can use any 8 bit
micro (like Philips 8 bit LPC line) for serial port processing.
> ----- Original Message -----
> From: unity0724
> To: l...
> Sent: Monday, November 20, 2006 11:04 AM
> Subject: [lpc2000] Re: 9 bit uart - correction
> --- In l..., "gen_4p" wrote:
> >
> > In my post on 9 bit uart on LPC I mistakenly mentioned
LPC2376 -
> > actually I meant LPC2368.
> > So again:
> > I need to interface an existing 485 network to ethernet.
> > Protocol is using 9 bit communication for the address
recognition.
> > Can't find any 9 bit capability on LPC uarts.
> > Have I overlooked something, or LPCs don't have it?
> >
> > Question: have anybody tried to implement 9 bit uart protocol
on
> > LPCs?
> >
> > I can imagine a few ways:
> > For reception - accept framing error (no stop bit error) as
> > indication
> > of active 9th bit.
> > For transmission - bit banging or using AND gate with extra
pin to
> > insert 9th bit = 0 after 8 bit transmission.
> >
> > I don't really like any of the above. Any ideas?
> >
> > Also a general question - there is a provision of 5 to 8 bit
> > transmission on LPC, but none for 9 bit. I never used less
than 8
> > bit
> > - any reason for that ?
> >
> > Gennady
> > Could you use that "forced sticky parity bit" in the
> 16C550 as 9th bit?? (make sure fifo turned off)
> Regards
>
>
>
>
>
Reply by Bryce Schober November 20, 20062006-11-20
On 11/19/06, gen_4p wrote:
>
> Hi,
> I need to interface an existing 485 network to ethernet.
> Protocol is using 9 bit communication for the address recognition.
>
> I was going to use lpc2376 for 485<->Ethernet adapter, but can't find
> any 9 bit capability on lpc uarts.
> Have I overlooked something, or LPCs don't have it.
> May anyone suggest a way to implement it on LPC?
>
> Thank you,
> Gennady
> .
>

If the protocol doesn't require parity, then the usual method is to set up
the lpc to receive w/ parity and re-interpret the parity error/non-error as
data. If the protocol does require parity on top of the 9 bits, then you're
screwed. Note that with the NXP uarts, you'll need to read the line status
register before the FIFO... read the manual carefully.

--
Bryce Schober