Searching \ for '[PIC]:RS232 Communications Reliability With PIC16F' 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/microchip/ios.htm?key=rs232
Search entire site for: 'RS232 Communications Reliability With PIC16F'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:RS232 Communications Reliability With PIC16F'
2004\01\01@234308 by Lee Wright

flavicon
face
Hi,

I'm having trouble with a PIC16F628 sending data @ 2400 baud and using internal OSC.    Using code rather than USART.   Seems to be 1 bit out every ten bytes or so.  
Not using MAX 232 just direct connection to port.

This seems to work OK with other PICs with external crystal.

Appreciate any advice.

Regards,


Lee.    
--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu

2004\01\02@001257 by Bob Axtell

face picon face
I doubt that the internal oscillator is stable enough, without being
corrected, to provide reliable RS232 characters. It CAN be done, by
timing the input bit length... But it is a lot of trouble.

Can't you use a ceramic resonator at 4Mhz, 8Mhz, etc.?

--Bob

Lee Wright wrote:
{Quote hidden}

--
             --------------
               Bob Axtell
       PIC Hardware & Firmware Dev
         http://beam.to/baxtell
             1-520-219-2363

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\01\02@005106 by Herbert Graf

flavicon
face
> I'm having trouble with a PIC16F628 sending data @ 2400 baud and
> using internal OSC.    Using code rather than USART.   Seems to
> be 1 bit out every ten bytes or so.

       The internal osc in the 628 isn't generally accurate enough to do serial.
With that said I've done a few projects with the internal osc using the
hardware UART and haven't had any problems. TTYL

----------------------------------
Herbert's PIC Stuff:
http://repatch.dyndns.org:8383/pic_stuff/

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\01\02@013958 by Wouter van Ooijen

face picon face
>         The internal osc in the 628 isn't generally accurate
> enough to do serial.

to be exact: it is not *guaranteed* to be accurate enough.

> With that said I've done a few projects with the internal osc
> using the
> hardware UART and haven't had any problems.

Which, indeed, does not meant that it is guaranteed to be so inaccurate
that serial comms will fail!

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\01\02@073241 by Olin Lathrop

face picon face
Lee Wright wrote:
> I'm having trouble with a PIC16F628 sending data @ 2400 baud and
> using internal OSC.

That's not surprising, since the oscillator can be up to 8.75% off and 5.8%
is the guaranteed to fail limit of RS-232 for 8 data bits.

> Using code rather than USART.

Even worse since there is very likely some jitter.

> Not using MAX 232 just direct connection to port.

Bad idea.  A lot of PCs do accept 0-5V input levels on their RS-232 ports,
but it's out of spec and some won't see the signal.

> This seems to work OK with other PICs with external crystal.

Yes, you can sometimes get away with breaking the rules, but apparently not
this time.  That's why there are specifications.  They tell you how to
design something that you know will work all the time.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\01\02@083000 by Bob Axtell

face picon face
Herbert Graf wrote:

>>I'm having trouble with a PIC16F628 sending data @ 2400 baud and
>>using internal OSC.    Using code rather than USART.   Seems to
>>be 1 bit out every ten bytes or so.
>
>
>         The internal osc in the 628 isn't generally accurate enough to do serial.
> With that said I've done a few projects with the internal osc using the
> hardware UART and haven't had any problems. TTYL
>
> ----------------------------------

Actually, at 1200/2400baud, I have been sucessful also, but I found that
I needed to make corrections in the oscillator periodically to
compensate for temperature and voltage variations. If you are doing an
actual production design, your client will be happier if you can cover
all the bases.

Another way to absorb minor variation is to add one or two EXTRA stop
bits after each SENT character; that allows the receiver to lock
reliably on the next character's start bit. The description of the
complaint provided in the original post indicated that this alone will
probably solve it. The easiest way to do this is to delay with a timer
after sending a character. Be sure that the PC Uart does the same thing;
in the PC it's easier, since the PC Uart has the ability to send 8Bits
with 2SB, so the F628 end can lock. This is reliable to 3% variation.

--Bob


--
             --------------
               Bob Axtell
       PIC Hardware & Firmware Dev
         http://beam.to/baxtell
             1-520-219-2363

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\01\03@021411 by William Chops Westfield

face picon face
On Friday, Jan 2, 2004, at 04:31 US/Pacific, Olin Lathrop wrote:

>
> Lee Wright wrote:
>> I'm having trouble with a PIC16F628 sending data @ 2400 baud and
>> using internal OSC.
>
> That's not surprising, since the oscillator can be up to 8.75% off and
> 5.8%
> is the guaranteed to fail limit of RS-232 for 8 data bits.
>
>
heh.  Is it really a 16F628, or a 16F628A?  This seems to be one of the
big
changes between the two, with the A version proudly proclaiming a 1%
accurate
intosc (still better than 5% over voltage and temp ranges, according to
the
data sheet.)  I guess they got (rightfully) yelled at for making an
internal
oscillator that wasn't accurate enough for serial comm...

BillW

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\01\03@221517 by Lee Wright

flavicon
face
Thankyou to all that replied to my post it has been most helpful.    The
difference between the oscilator accuracy for the 16f628 & the 16f628A is
very interesting indeed.   Upon closer inspection I note that the chip is in
fact the 16f628A.       I think maybe my problem lies somewhere else,  maybe
the variables are getting messed up inside the chip before being transmitted
back.      It only occured to me later but I have been getting reliable
comms at 250K (yes 250,000bps) using a 28A on another project with internal
osc but that was with RS285 and SN75176 drivers/receivers.

Regards,


Lee.

{Original Message removed}

2004\01\03@233314 by Bob Axtell

face picon face
Lee Wright wrote:
> Thankyou to all that replied to my post it has been most helpful.    The
> difference between the oscilator accuracy for the 16f628 & the 16f628A is
> very interesting indeed.   Upon closer inspection I note that the chip is in
> fact the 16f628A.       I think maybe my problem lies somewhere else,  maybe
> the variables are getting messed up inside the chip before being transmitted
> back.
<snip>
> It only occured to me later but I have been getting reliable
> comms at 250K (yes 250,000bps) using a 28A on another project with internal
> osc but that was with RS285 and SN75176 drivers/receivers.
<snip>

This shouldn't be glossed over; I'm an old guy, and I can say what needs
to be said here.

You need to listen carefully to what Olin, myself and many others have
said here and before about designing for reliability, in this case in
regard to internal oscillator stability.

What we are saying is that it is ALWAYS easy to design one or two of
something and it'll work perfectly without regard to the manufacturers'
specs. That's because the laws of statistics can sometimes bend your way
accidentally, i.e. you were lucky (you KNOW that is true, because in Las
Vegas, sometimes people win). As long as you don't come to DEPEND on
this luck, you'll be OK.

What does it gain your client if you have a product that works fine
unless it is a cold day, or a hot day, or if the F628 is hand-selected,
or if the battery doesn't drop too low? As a designer, it is your
responsibility to design something that ALWAYS works.

Now, back to my week-old turkey sandwich...

--Bob


--
             --------------
               Bob Axtell
       PIC Hardware & Firmware Dev
         http://beam.to/baxtell
             1-520-219-2363

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\01\04@000642 by William Chops Westfield

face picon face
On Saturday, Jan 3, 2004, at 20:13 US/Pacific, Bob Axtell wrote:

>
> You need to listen carefully to what Olin, myself and many others have
> said here and before about designing for reliability, in this case in
> regard to internal oscillator stability.
>
>
the way I read the datasheet, the 628A internal oscillator should
ALWAYS be stable enough for serial comm.  Not so?

BillW

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\01\04@020233 by Wouter van Ooijen

face picon face
> the way I read the datasheet, the 628A internal oscillator should
> ALWAYS be stable enough for serial comm.  Not so?

F13 (jitter) : 2%

This is on the edge.

Note: the 1% is only for Vdd=3.5 and 25 C, whith no margin for both
conditions, so is useless.

Also note: the initial accuracy is not specified. I am not sure this is
included in the 2%.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\01\04@065755 by

picon face
From "DS40044A-page 141" :

1% @ 3.5V and +25 degC
2% @ 2.0 - 5.5V and 0 - +85 degC
5% @ 2.0 - 5.5V and -40 - +85 degC

So it depends...

Jan-Erik.

>
> > the way I read the datasheet, the 628A internal oscillator should
> > ALWAYS be stable enough for serial comm.  Not so?
>

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\01\04@071244 by David Duffy

flavicon
face
>>>the way I read the datasheet, the 628A internal oscillator should
>>>ALWAYS be stable enough for serial comm.  Not so?
>>>
>>>

> Jan-Erik Soderholm XA (TN/PAC) wrote:
>
>From "DS40044A-page 141" :
>
>1% @ 3.5V and +25 degC
>2% @ 2.0 - 5.5V and 0 - +85 degC
>5% @ 2.0 - 5.5V and -40 - +85 degC
>
>So it depends...
>
>

Didn't we all agree a few % is fine for standard 8N1 serial comms some
time back? Obviously less error is better but I can imagine that a lot of
times, the extra i/o pins and no resonator/crystal could be a good thing.
The 0 to +85 figures would certainly do me for this part of world. (Oz)
David...

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\01\04@080736 by Wouter van Ooijen

face picon face
> Didn't we all agree a few % is fine for standard 8N1 serial comms some
> time back? Obviously less error is better but I can imagine
> that a lot of
> times, the extra i/o pins and no resonator/crystal could be a
> good thing.
> The 0 to +85 figures would certainly do me for this part of
> world.

Ok, so for the sake of the argument let's say 3% deviation is OK. Mind
you, that is *total* deviation. How accurate do you assume the peer side
is? 2%, like you claim for the PIC side?

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\01\04@180038 by David Duffy

flavicon
face
David Duffy said:

>>Didn't we all agree a few % is fine for standard 8N1 serial comms some
>>time back? Obviously less error is better but I can imagine
>>that a lot of
>>times, the extra i/o pins and no resonator/crystal could be a
>>good thing.
>>The 0 to +85 figures would certainly do me for this part of
>>world.
>>
>>

Wouter van Ooijen wrote:

>Ok, so for the sake of the argument let's say 3% deviation is OK. Mind
>you, that is *total* deviation. How accurate do you assume the peer side
>is? 2%, like you claim for the PIC side?
>

I guess it depends on the other side's accuracy too then. :-)
David...

--
___________________________________________
David Duffy        Audio Visual Devices P/L
U8, 9-11 Trade St, Cleveland 4163 Australia
Ph: +61 7 38210362   Fax: +61 7 38210281
New Web: http://www.audiovisualdevices.com.au
___________________________________________

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\01\04@185550 by William Chops Westfield

face picon face
On Sunday, Jan 4, 2004, at 04:13 US/Pacific, David Duffy wrote:

>>
>> 1% @ 3.5V and +25 degC
>> 2% @ 2.0 - 5.5V and 0 - +85 degC
>> 5% @ 2.0 - 5.5V and -40 - +85 degC
>>
>> So it depends...
>>
Ahh.  I was comparing the 5% number to Olin's "5.8% guaranteed to fail"
quote, without remembering the "guaranteed" in there.

Although, since I've been contemplating serial comms at 32kHz, I think
"guaranteed to fail" assumes unjittered sampling, which won't
necessarily
be the case (but you'd have to be VERY LUCKY indeed for that to FIX
anything...)

BillW

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\01\04@185759 by William Chops Westfield

face picon face
On Sunday, Jan 4, 2004, at 05:04 US/Pacific, Wouter van Ooijen wrote:

> for the sake of the argument let's say 3% deviation is OK. Mind
> you, that is *total* deviation. How accurate do you assume the peer
> side
> is? 2%, like you claim for the PIC side?
>
There ought to be a whole slew of applications where it is valid to
assume
that the other side is at least crystal controlled (ie a PC or similar)

That doesn't mean that it will be perfectly on speed, of course.  Most
commercial HW uarts require you to pick a BRG crystal that provides 0
error only on SOME of the available bitrates.

BillW

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\01\05@031841 by Wouter van Ooijen

face picon face
> There ought to be a whole slew of applications where it is valid to
> assume
> that the other side is at least crystal controlled (ie a PC
> or similar)

Yes, but that other side might well have choosen a crystal that was
already present for some other purpose, with  a frequency that intrudces
only a small error, 2% or so, but that does not matter because serial
communications is not guaranteed to fail with less than 6% error.

The trouble with this 'try and see: it works' approach is that it does
not take into account that things can vary wildly from PC to PC, PIC to
PIC, cable to cable, with temperature, with humidity, with the phase of
the moon, etc.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

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