CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

int RC clock good enough for serial comms?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Don P



Joined: 26 Aug 2004
Posts: 23
Location: California

View user's profile Send private message

int RC clock good enough for serial comms?
PostPosted: Fri Mar 25, 2005 9:12 am     Reply with quote

Searching the archives didn't net me any subject lines that looked relevant.
On the 16F628 the internal clock is nice because it frees up board space & I/O pins, and works fine for many apps without strict timing requirements. But I recall having problems doing 9600 baud serial comms when using it. Now as I look at the 628 manual, I can't find any spec that indicates that there might be clock accuracy problems. i.e. they show only a 4MHz "typical" frequency over the standard temp range.
Have others used the internal clock successfully with serial comms?
Regards,
Don
bluetooth



Joined: 08 Jan 2005
Posts: 74

View user's profile Send private message

PostPosted: Fri Mar 25, 2005 9:45 am     Reply with quote

From the 628 Data Sheet showing the min - nominal - max for INTRC:

Quote:

4 INTRC Internal Calibrated ER 3.65 4.00 4.28 MHz VDD = 5.0V


For reliable async comms with, for example, 10 bits, you're allowed a TOTAL error, for both sides, of 5% from the ideal baud rate. This usually means 2.5% max per side. Based on the numbers above, it looks like it can be -9% and +7% - too much error for reliable async comms.

I'd use a resonator, crystal, or another part with a more accurate INTRC.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Mar 25, 2005 10:12 am     Reply with quote

Unless:

1) your project is very tight in size

2) your sales forecast qty is > 10K units Shocked where
the crystal cost will have high incidence in the total cost.

3) your comunication strings are very short and long time spaced.

I would use a resonator/crystal as clock time base.

Humberto
Don P



Joined: 26 Aug 2004
Posts: 23
Location: California

View user's profile Send private message

PostPosted: Fri Mar 25, 2005 10:26 am     Reply with quote

Thanks for the insight. I still can't find the page (out of 144) that shows the clock specs. I wonder if the accuracy is related more to temperature or to individual parts. If it was stable for an individual chip, it seems that you could just specify the clock frequency in your code as something other than 4MHz (assuming you could determine it) and then the baud rate would come out OK.
bluetooth



Joined: 08 Jan 2005
Posts: 74

View user's profile Send private message

PostPosted: Fri Mar 25, 2005 10:36 am     Reply with quote

This is where I found it (old data sheet):

DS40300B-page 139


Some of the newer parts have an OSCTUNE capability - these parts have been around for a while - look at some of the newer ones. They have what you're talking about.
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Fri Mar 25, 2005 3:48 pm     Reply with quote

Take a look at the 628A. They have an improved accuracy internal oscillator. From 2.2 to 5V and 0degC to 85degC the max variation is +/-2%. Which should be good enough for serial comm.
Guest








PostPosted: Fri Mar 25, 2005 4:15 pm     Reply with quote

That figures -- and all mine are 628's. Maybe next batch.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group