![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
pabs
Joined: 12 Oct 2006 Posts: 2
|
Int or Ext oscillator? |
Posted: Thu Oct 12, 2006 8:25 am |
|
|
Does anyone have an opinion on which is better? I typically run an external oscillator, but this morning I’m about to start designing a circuit board for my 18F2525 project and I asked myself “why have the external components on the PCB when I can use the internal oscillator”. The design I’m working on is industrial so I need reliability and temperature stability, outside of those I could use the extra board space by eliminating the external oscillator and caps.
Thanks |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Thu Oct 12, 2006 9:25 am |
|
|
Depends (of course), on what type of external oscillator you use. The internal oscillator, has the advantage of cost, and saving space, but is only just adequate for serial asynch comms, over normal temperature ranges, and voltage ranges. If all required timings from your system can be met by the internal oscillator over your required temperature/voltage range, then it is the way to go. Otherwise a caefully selected crystal, starts at probably 100* more accurate, and goes up from there, depending on what you are prepared to spend...
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
pabs
Joined: 12 Oct 2006 Posts: 2
|
|
Posted: Thu Oct 12, 2006 9:54 am |
|
|
Thanks for the reply Ttelmah
Here is what I just found in the 18f2525 datasheet
"The factory calibrates the internal oscillator block
output (INTOSC) for 8 MHz. However, this frequency
may drift as VDD or temperature changes, which can
affect the controller operation in a variety of ways. It is
possible to adjust the INTOSC frequency by modifying
the value in the OSCTUNE register. This has no effect
on the INTRC clock source frequency."
"An adjustment may be required when the USART
begins to generate framing errors or receives data with
errors while in Asynchronous mode. Framing errors
indicate that the device clock frequency is too high; to
adjust for this, decrement the value in OSCTUNE to
reduce the clock frequency. On the other hand, errors
in data may suggest that the clock speed is too low; to
compensate, increment OSCTUNE to increase the
clock frequency."
I'm running at a pretty low baud rate (9600) so maybe it won’t be an issue; I’m most concerned about the low end temperature drift. The MCU will likely be exposed to outside conditions during winter (potentially -30). It would be nice to calculate the drift, then you could add a temp sensor to the circuit, read the temp and adjust the OSCTUNE accordingly. It would also be nice to be able to simulate the conditions to do a "real world" test --- anyone know of a freezer that can go down to -30! .
Regards |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Fri Oct 13, 2006 2:59 am |
|
|
Look at the numbers in the data sheet. Table 26-8. It is normally felt that about 4% is the maximum allowed error for reliable serial. Remember that if you test a chip, it'll only be a single example, and if you are designing something to be reliable, you _must assume the 'worst case'...
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Fri Oct 13, 2006 3:13 am |
|
|
As another comment, baud rate, makes no difference to the 'tolerance' allowed (except where at high baud rates, the limitations of the dividers available, may allready 'use up' a significant part of this margin). So if (for instance), you were running at 115200,and because of the selected crystal/divider, the actual rate was already 2% in error, there is then potentially only just under 2% allowable frequency margin in the error direction (but more the other way...).
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|