View previous topic :: View next topic |
Author |
Message |
Don P
Joined: 26 Aug 2004 Posts: 23 Location: California
|
int RC clock good enough for serial comms? |
Posted: Fri Mar 25, 2005 9:12 am |
|
|
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
|
|
Posted: Fri Mar 25, 2005 9:45 am |
|
|
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
|
|
Posted: Fri Mar 25, 2005 10:12 am |
|
|
Unless:
1) your project is very tight in size
2) your sales forecast qty is > 10K units 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
|
|
Posted: Fri Mar 25, 2005 10:26 am |
|
|
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
|
|
Posted: Fri Mar 25, 2005 10:36 am |
|
|
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
|
|
Posted: Fri Mar 25, 2005 3:48 pm |
|
|
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
|
|
Posted: Fri Mar 25, 2005 4:15 pm |
|
|
That figures -- and all mine are 628's. Maybe next batch. |
|
|
|