EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

9 bit uart

Started by gen_4p November 20, 2006
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

An Engineer's Guide to the LPC2100 Series

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
--- 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
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
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
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
>
>
>
>
>
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
>
>
>
>
>
>
>
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
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
>
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

The 2024 Embedded Online Conference