Searching \ for '[pic]:simple oscillator question' 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/time.htm?key=oscillator
Search entire site for: 'simple oscillator question'.

Exact match. Not showing close matches.
PICList Thread
'[pic]:simple oscillator question'
2001\03\27@145247 by Jason L DeVore

flavicon
face
Im using the 16f873 at 8MHz.  The problem is I cannot get the UART to
work.  It works fine on the pic demo board with an RC resonator at 1.2
Mhz.  I have a seperate board with an 8Mhz crystal (the one specified in
the manual) and 2 33pf capacitors.  The actual clock frequency is 7.81
Mhz.

The baud rate generator is set for high speed and with a value of 12
for 9600. The programmer is also set to HS.

Am i missing anything?

All i get is garbage out of the UART.

Thanks

Jason

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


2001\03\27@210721 by Dan Michaels

flavicon
face
Jason DeVore wrote:
>Im using the 16f873 at 8MHz.  The problem is I cannot get the UART to
>work.  It works fine on the pic demo board with an RC resonator at 1.2
>Mhz.  I have a seperate board with an 8Mhz crystal (the one specified in
>the manual) and 2 33pf capacitors.  The actual clock frequency is 7.81
>Mhz.
>
> The baud rate generator is set for high speed and with a value of 12
>for 9600. The programmer is also set to HS.
>
> Am i missing anything?
>

Looking in the datasheet tables for 9600 baud for a "7.1" Mhz xtal:

for "low" rate, SPBRG = 11
for "high" rate, SPBRG = 46

Looks like you mixed the modes. Try BRGH=0, plus 12 for 7.8 mhz xtal.

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2001\03\28@110623 by Olin Lathrop

face picon face
> Looking in the datasheet tables for 9600 baud for a "7.1" Mhz xtal:
>
> for "low" rate, SPBRG = 11
> for "high" rate, SPBRG = 46
>
> Looks like you mixed the modes. Try BRGH=0, plus 12 for 7.8 mhz xtal.

If you want to avoid this kind of mistake in the future, check out my
UART_BAUD macro in STD.INS.ASPIC at http://www.embedinc.com/pic.  This macro
calculates all the baud rate stuff given the clock frequency and the desired
baud rate.  I've used it many times.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinspamKILLspamembedinc.com, 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


2001\03\28@110934 by Jason L DeVore

flavicon
face
you are correct.  I was using 64 instead of 16 in the baud rate generator
equation.

Thanks for the help



On Tue, 27 Mar 2001, Dan Michaels wrote:

{Quote hidden}

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


2001\03\28@111034 by Bob Ammerman

picon face
----- Original Message -----
From: Jason L DeVore <EraseMEjasondespam_OUTspamTakeThisOuTENG.BUFFALO.EDU>
To: <PICLISTspamspam_OUTMITVMA.MIT.EDU>
Sent: Tuesday, March 27, 2001 2:52 PM
Subject: [pic]:simple oscillator question


> Im using the 16f873 at 8MHz.  The problem is I cannot get the UART to
> work.  It works fine on the pic demo board with an RC resonator at 1.2
> Mhz.  I have a seperate board with an 8Mhz crystal (the one specified in
> the manual) and 2 33pf capacitors.  The actual clock frequency is 7.81
> Mhz.

With an 8MHz crystal your frequency should be much closer to 8MHz than this!

Are you sure it isn't a serial cut crystal?

>  The baud rate generator is set for high speed and with a value of 12
> for 9600. The programmer is also set to HS.


>  Am i missing anything?
>
>  All i get is garbage out of the UART.

Hm... if you clock is really running at 7.81 then your baud rate will be:

7,810,000 / (16 * (12+1))

which comes to 37548 baud.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

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


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