The Cyber-Spy.Com Usenet Archive Feeds Directly
From The Open And Publicly Available Newsgroup
This Group And Thousands Of Others Are Available
On Most IS NNTP News Servers On Port 119.
Cyber-Spy.Com Is NOT Responsible For Any Topic,
Opinions Or Content Posted To This Or Any Other
Newsgroup. This Web Archive Of The Newsgroup And
Posts Are For Informational Purposes Only.
From: "Michael F. Coyle"
Subject: Re: RS232 newbie - in need of assistance!
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
Date: Sat, 04 Jan 2003 04:04:08 GMT
NNTP-Posting-Date: Fri, 03 Jan 2003 23:04:08 EST
Organization: Optimum Online
"Spehro Pefhany" wrote in message
> On Sat, 04 Jan 2003 01:07:29 GMT, the renowned "Michael F. Coyle"
> >"Spehro Pefhany" wrote in message
> >> On Fri, 03 Jan 2003 23:56:08 GMT, the renowned "Michael F. Coyle"
> >> wrote:
> >> >
> >> >The PIC BRG works well with 2.4576 MHz, 3.6864 MHz and 4.915 MHz.
> >> >frequencies will allow the BRG to be programmed to give the standard
> >> >rates *exactly*. Why settle for less?
> >> The errors @ 4MHz Fosc at 2400 and 9600 baud (BRGH = 1) are only about
> >> 0.15%, which isn't much. More error in Fosc if you're using a 0.5%
> >> resonator.
> >The 0.15% errors are for Fosc=16MHz, not 4.
> Refer to table 12-5 on page 75:
> 9600 baud is actually 9615 (+0.16%) SPRG = 103
> 2400 is 2403 (+0.13%) SPRG = 25
You're right. (But your two SPRG's are reversed.)
> >for example with Fosc = 4 MHz
> >and BRGH=0 (low speed mode), the closest realizable baud rates to 9600
> >8928 (7% low) and 10416.67 (8.5% high). This is with SPBRG set to 6 and
> Why would you use BRGH = 0? That increases the error to unacceptable
Yeah. I didn't check the error in high-speed mode. Oops.
I hadn't looked at 4 MHz in detail. The errors are lower than I
expected...perfectly acceptable for <=19200. At higher rates we would be
better off with the exact right frequecy but otherwise 4 MHz works pretty
well. (And it's dead on for MIDI, 31250 baud!)
> >> Is this a problem with the older PIC designs?
> >Older PICs did have a problem with lots of receive errors in high-speed
> Ah, okay, right, I have half a memory of that limitation. Here it is
> from the (now obsolete) PIC16C73 errata:
> 1. Module: USART
> When the USART (SCI) is configured in asynchronous
> mode with the BRGH bit set, a high number of
> receive errors may be experienced. For asynchronous
> receive operations, it is recommended that the
> USART be configured with the BRGH bit cleared.
The one for the 16C65 reads exactly the same. So I guess error propagation
by cut-and-paste isn't just a software thing, it works for chip design too!
> > Most of these older parts have been fixed and hopefully new parts
> >don't have the bug.
> I just finished a design, using the 16F628, with a calibration/setup
> port running at 9600 baud/4MHz and noticed NO problems at all. I'd say
> not to worry about it; it's history.
> Best regards,
> Spehro Pefhany
I guess I learned something here today. Better go to sleep while I'm still
Go Back To The Cyber-Spy.Com
Usenet Web Archive Index Of
The sci.electronics.design Newsgroup