20 bit UART for 5912OSK

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Greetings, I am having some problems with the UART protocol. To my
limited knowledge, I know that the UART is capable of handling more
than the usual 8 data bits. I would need the OMAP to receive 20 bits of
data from an external device. My guess is the UART is the most suitable
protocol to handle this. However, being 20 data bits, how can I
configure the UART code to handle this? I know I need to insert a start
and stop bit to make it into a frame but I am not well versed in ANSI
C. Any suggestions? Any kind of help would be appreciated. Thanks for
looking.

Regards
Lincoln


Re: 20 bit UART for 5912OSK
If you need to ask this question you shouldn't be playing with products as
complex as
OMAP.

The UART bit patterns are 7,8 or 9 bits maximum. To transmit longer objects
you'll
need to encapsulate them into a frame of multiple bytes.

-Andrew M

Quoted text here. Click to load it



Re: 20 bit UART for 5912OSK
Quoted text here. Click to load it

Chuck,

I've seen asynchronous message lengths up to 31 bits that worked just
fine using standard baud rate generator chips and crystals.  All the
ones I've worked with had three bit sync codes which functioned just
like a start bit.  However, it can't be done with standard asynchronous
UART hardware since those insert start and stop bits automatically every
5-9 bits.

--
James T. White



Re: 20 bit UART for 5912OSK
Quoted text here. Click to load it

You are talking about some other protocol than a UART, which has 1
start bit, data bits, and 1 or more stop-bits.  They use an agreed
clock frequency, but have no restrictions on clock phase, or the
actual length of the stop period.  That phasing/stop period is
important in determining the frequency tolerance.

That phasing problem is why most UARTs use a 16x clock signal.
They need at least a 2x signal, and that can be very hairy.

--
"If you want to post a followup via groups.google.com, don't use
  the broken "Reply" link at the bottom of the article.  Click on
We've slightly trimmed the long signature. Click to see the full one.
Re: 20 bit UART for 5912OSK

<SNIP>
Quoted text here. Click to load it

It is interesting the odd clock multiples actually give better all
round performance than the next higher even multiple. Note that a 2x
sampling rate is not actually usable due to the uncertainty when
sampling the start bit.

Sampling at 3 times the bit rate gives better performance than 4 times.

Regards
Rocky


Re: 20 bit UART for 5912OSK
Quoted text here. Click to load it
 >
<SNIP>
Quoted text here. Click to load it

That really devolves into where the error budget is applied.  The
2x situation requires that the receiver be clocked faster than the
sender.  When two such communicate one will fail.

--
"If you want to post a followup via groups.google.com, don't use
  the broken "Reply" link at the bottom of the article.  Click on
We've slightly trimmed the long signature. Click to see the full one.
Re: 20 bit UART for 5912OSK
Hi Chuck, I gather from your post that it is not advisable to use the
UART protocol then? Thanks for the reply.


Re: 20 bit UART for 5912OSK
I don't have a choice. My project requires me to use the OMAP. Thanks
for the reply.

Lincoln


Re: 20 bit UART for 5912OSK
( Latest post on how to use an OMAP processor's
UART to exchange 20bit messages )

Quoted text here. Click to load it

As others have pointed out, it is not possible to use
a UART the way you need.
( I am surprised at the implicit agreement in previous
posts in this thread that there is a UART "protocol". )

The solution is, of course, to design and implement
a protocol on top of the UART basic 7-to-9 bits word
format to deliver 20 bit messages.
(I'll use the term "word" here to refer to the basic
7/8/9 bit data units delivered by a traditional UART)

Using 8-bit words, a trivial implementation could be
to encode each 20 bit message as 3-UART-words messages,
with 7 bits transmitted in the least significant
positions of the 2 first words and 6 in last word.
Use the most significant bit as a framing bit, i.e.,
set it to '1' in the first word of each triplet
and '0' in the last two, to identify the beginning
of a message.
(Some UARTS can be programmed to a 9-bit mode with the
fist bit generating a receive interrupt when set. This
could simplify your logic, if available)

This will sole the OP problems, and also open a
Pandora box of how to deal with, and recover from,
communication errors.
(For example, you may have to extend the message size
to include a CRC, or to keep time stamps on when
each word was received, to be able to differentiate
between the tree words belonging to a valid message,
and a first word from one message +2nd and 3rd from
a latter message, with the intermediate ones lost)

I would suggest checking a good book on networking
and communication protocols.


Roberto Waltman

[ Please reply to the group,
  return address is invalid ]

Re: 20 bit UART for 5912OSK

Quoted text here. Click to load it

Hi Chuck, I gather from your post that it is not advisable to use the
UART protocol then? Thanks for the reply.


Re: 20 bit UART for 5912OSK
Quoted text here. Click to load it
... snip ...
Quoted text here. Click to load it

Exactly. You might investigate various self-clocking techniques.

Congratulations on learning to use the google interface correctly,
and thence how to post correctly.  Now you also need to learn to
snip the quoted portions that are not germane to your reply, and
you will be a first class netizen.

--
"If you want to post a followup via groups.google.com, don't use
  the broken "Reply" link at the bottom of the article.  Click on
We've slightly trimmed the long signature. Click to see the full one.
Re: 20 bit UART for 5912OSK

Quoted text here. Click to load it

If performance is not too important, consider implementing serial comm's
on a general purpose I/O pin.

KA



Site Timeline