Searching \ for 'Baud timing- How close do I have to be?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=baud+timing+how
Search entire site for: 'Baud timing- How close do I have to be?'.

Truncated match.
PICList Thread
'Baud timing- How close do I have to be?'
1998\05\26@164319 by Paul Gaastra

flavicon
face
I thought the allowable % error for the baud rate was worked out from
how far out the clock can be out after all the bits have been clocked
in. Can anyone point to a document on the web that explains this?

Second question:  On page 9-98 of the 1996/1997 PIC 16/17
Microcontroller data book in table 12-4 they give a table of various
crystals and the % error for baud rate using the USART.  None of the
crystals give exact baud rates.  I chose a crystal based on this
table thinking it would be one of the crystals giving the most
accurate baud rate (I chose 3.579545MHz giving errors of -2.9% for
9600 and 19200 baud).  Why does the book have those crystals when the
crystals mentioned by contributors to the list, eg 3.6864MHz give
exact bald rates?


Paul Gaastra                              spam_OUTpgaastraTakeThisOuTspamhort.cri.nz
Technology Development Group, Hort Research
Private Bag 3123              fax +64 7 8584705
Hamilton, NEW ZEALAND       phone +64 7 8584745

1998\05\26@170719 by Andrew Warren

face
flavicon
face
Paul Gaastra <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU> wrote:

> I thought the allowable % error for the baud rate was worked out
> from how far out the clock can be out after all the bits have been
> clocked in. Can anyone point to a document on the web that explains
> this?

   Paul:

   It's easy to explain.

   A UART transmits 10 bits for every byte of data that it sends:
   There's a start bit, eight bits of data, then a stop bit.

   The UART synchronizes on the leading edge of the "start" bit,
   then it expects each of the remaining nine bits to appear at
   specific times.

   For a byte to be received correctly, more than 50% of each bit
   must appear at the time that the UART expects it.  In other
   words, each bit can be offset by -- at most -- one half of one
   bit-time.

   If there's a timing error, the error gets progressively larger
   for each bit after the "start" bit, so the tenth bit (the "stop"
   bit) is offset the most.

   Since the UART requires the stop bit to be within one-half of
   one bit-time from its expected location, the maximum allowed
   error is one half of one bit time, divided by ten bits... Or 5%.

> Second question:  On page 9-98 of the 1996/1997 PIC 16/17
> Microcontroller data book in table 12-4 they give a table of
> various crystals and the % error for baud rate using the USART.
> None of the crystals give exact baud rates. .... Why does the book
> have those crystals when the crystals mentioned by contributors to
> the list, eg 3.6864MHz give exact bald rates?

   The book lists the most-commonly-used crystals... The tables
   show that you can get baud rates that are "close enough" without
   having to buy special "exact baud rate" crystals.

   -Andy

=== Andrew Warren - fastfwdspamKILLspamix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499 (personal)
=== http://www.netcom.com/~fastfwd (business)

1998\05\26@171126 by Clyde Smith-Stubbs

flavicon
face
On Wed, May 27, 1998 at 08:42:23AM +1200, Paul Gaastra wrote:
> I thought the allowable % error for the baud rate was worked out from
> how far out the clock can be out after all the bits have been clocked
> in. Can anyone point to a document on the web that explains this?

It's pretty simple; after all the bits have been seen, there should
be no more than 1/2 bit phase difference (because after syncing on the
start bit, the data bits are sampled at mid-bit time). If you have 10 bits
(1 start, 8 data, one stop) then the error per bit can only be 1/10th of
1/2 a bit, i.e. 5% of the baud rate. It's wise to aim for a little better
than that for reliability. 4% or less should be quite ok.

> 9600 and 19200 baud).  Why does the book have those crystals when the
> crystals mentioned by contributors to the list, eg 3.6864MHz give

Probably because the crystal frequencies mentioned are readily available
for other purposes, e.g. the 3.579545 something mentioned is a
color-burst crystal for NTSC TV, so they're manufactured in the millions.

Try Farnell for crystals - they have surprisingly cheap crystals that you
can buy in quantity 1.


--
Clyde Smith-Stubbs               |            HI-TECH Software
Email: .....clydeKILLspamspam.....htsoft.com          |          Phone            Fax
WWW:   http://www.htsoft.com/    | USA: (408) 490 2885  (408) 490 2885
PGP:   finger EraseMEclydespam_OUTspamTakeThisOuThtsoft.com   | AUS: +61 7 3354 2411 +61 7 3354 2422
---------------------------------------------------------------------------
HI-TECH C: compiling the real world.

1998\05\27@043103 by Paul BRITTON

flavicon
face
The general rule of thumb is that if you are using 8bit,1 start,no parity
& 1 stop i.e.10 bits per character, then your timing needs to be within
10% of nominal.(allows the sample point to 'move' by 1/10th of a bit time
each bit.)
But this assumes that your inter-character delay is longer than one bit
time (this will allow the re-synching of each start bit correctly.

If you can't control the inter-character delay, then you could transmit
with 2 stop bits, this will allow the receiver to re-synch.

Alternatively get within 5% of nominal, and you'll have a bigger margin.

Phillips have an application note for the 8051 which explains off
frequency crystal effects, its number is AN448. It should be available
from http://www.semiconductors.philips.com

1998\05\27@220300 by Lewis H. Cobb
flavicon
face
Lads -

After some due consideration and scouring of the microchip databook I have
decided that I am going to re-design a PIC into my battery powered product
and the current processor is getting heaved.  The wake-up on port b <7:4>
and the super low current in sleep mode made up my mind - I'm looking at
the 16C620 series as a likely candidate but the 16F84 could be used for
much of the development without having to play the "wait to erase" game...

The above having been proclaimed, I have a couple of questions that may
sound trivial for those that have been designing with this processor
already but I figure I'll pass them by in the interest of coming up the
curve quicker -

1) Is it just my mis-reading, but does the brown out enabled, turn the pic
into a current HOG in sleep mode?  i.e. from 1uA to 300+uA?

2) I will be powering the system from 2 lithium cells and would like to
detect a low battery without having to use a big$, low dropout, low
Quiescent I regulator.  I'm thinking of doing the following and wonder if
it sounds reasonable;
- Dedicate a port pin to the driving of a zener diode
- Feed this reference into one of the analog comparators on the '620 chip.
- Feed the raw Vdd battery voltage into the "on-chip" programmable
reference and tie it to the other comparator input line - programming this
reference for 2.4-2.5 volts.

3) If I protect the electronics from a reverse battery with a diode right
across the battery terminal, I will protect the electronics at the
sacrifice of the batteries - this is ok - but - can a lithium coin cell
source enough current to be of harm - i.e. heat, meltdown etc.?



Thanks a million for any assistance people can provide.  The micros look to
be just the ticket for many projects!

Lewis
cobbspamspam_OUTzeus.ee.unb.ca

1998\05\27@230216 by Dennis Plunkett

flavicon
face
At 08:02 PM 27/05/98 -0300, you wrote:
{Quote hidden}

1/ If brown out is enabled, then my guess will be yes, as the current is
used by an internal comp of some type. Note that it is normally only
required during the "RUN mode" as batteries can be considered as brown out
free. See also the battery capacity and recovery curves. ie. Only have the
"brown out" if you need it active when the processor is running (I don't
know if this is possible on the PIC) Brown out may only be a problem if you
are storing valuable data, as the rest of the code should be written in such
a way that it is tolerant to this condition. This includes resetting the I/O
ports and registers and doing some type of CRC check on the RAM area. Note
that you should also remove any code that enters an infinite loop on the
state of a pin, or state of a register.
I know that this may be high lighting what you may already know.

2/ Use the RTCC pin as the input, this a schmitt input, check the current
flow however, as the analogue operating area may cause effect. Use a port
pin to provide the ground ref, thus the RTCC pin will be nominally be at
battery voltage (This will remove the above)

3/ This is not a problem if the diode is big enough, coin cells, like all
lithium batteries cannot deliver large dump currents, but capacity is high.

4/ The type of OSC used is important, as time and valuable battery power can
be waisted during this period, look at using the RC option (Unless timing is
critical). Also check the start-up time from wake up, and see if you are
happy with it.

5/ If speed is not an issue, then perhaps look at the LP version. The 32KHz
stuff runs on the smell of an oily rag, and you can leave it running!


I hope that this helps a bit.


Dennis

1998\05\28@084246 by wwl

picon face
On Wed, 27 May 1998 20:02:37 -0300, you wrote:

>Lads -
>
>After some due consideration and scouring of the microchip databook I have
>decided that I am going to re-design a PIC into my battery powered product
>and the current processor is getting heaved.  The wake-up on port b <7:4>
>and the super low current in sleep mode made up my mind - I'm looking at
>the 16C620 series as a likely candidate but the 16F84 could be used for
>much of the development without having to play the "wait to erase" game...
>
>The above having been proclaimed, I have a couple of questions that may
>sound trivial for those that have been designing with this processor
>already but I figure I'll pass them by in the interest of coming up the
>curve quicker -
>
>1) Is it just my mis-reading, but does the brown out enabled, turn the pic
>into a current HOG in sleep mode?  i.e. from 1uA to 300+uA?
Yes.  If you really want a brown-out, use a reset chip from Telcom,
Ricoh, Holtek etc. - they take about 1uA. For a battery powered app,
you probably don't need it. Power will always rise quickly when a
battery is inserted, and brownout will only happen when the battery is
dying, and you probably don't care too much then.

>3) If I protect the electronics from a reverse battery with a diode right
>across the battery terminal, I will protect the electronics at the
>sacrifice of the batteries - this is ok - but - can a lithium coin cell
>source enough current to be of harm - i.e. heat, meltdown etc.?
No, but check the safety implications of doing this to the battery -
your customer may be upset if he gets burnt or the product melts after
incorrectly inserting batteries.
A series schottky diode will only drop about 0.25V, and if you're
running on 6V anyway, this shouldn't hurt, and will reduce power drain
very slightly.



    ____                                                           ____
  _/ L_/  Mike Harrison / White Wing Logic / KILLspamwwlKILLspamspamnetcomuk.co.uk  _/ L_/
_/ W_/  Hardware & Software design / PCB Design / Consultancy  _/ W_/
/_W_/  Industrial / Computer Peripherals / Hazardous Area      /_W_/

1998\05\28@184338 by William Chops Westfield

face picon face
A typical lithium coin cell (xx2016) has a short circuit current of about 30mA.
Handy for making those little LED-based flashlights...

Other lithium batteries behave significantly differently, of course...

BillW

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...