In SX Microcontrollers, SX/B Compiler and SX-Key Tool, davehein wrote: As I mentioned in another thread, it is possible to do serial communications with the internal RC oscillator. The main problem with the internal RC oscillator is that it is difficult to manufacture semiconductor resistors within a tight tolerance. Therefore, the center frequency of the internal oscillator can be off by a large value. Parallax doesn't publish the tolerance on the center frequency, but the FUSE register contains a 3-bit field named IRCTRIM, which can be calibrated at load time by specifying "IRC_CAL IRC_4MHZ" in the source file. The IRCTRIM field can be set to one of 8 values, with a step of 3% from one value to the next. This provides a 21% range. In theory, the IRC could be calibrated to within 1.5% of 4 MHz. I don't know how accurate the calibration procedure is, and I normally specify "IRC_CAL IRC_FAST", which sets the trim bits to all ones for the highest frequency trim. I then run my own calibration program where I toggle an LED every 10 seconds and measure the frequency using a stop watch. A second parameter can be used with the FREQ directive to indicate the actual frequency of the clock. In my case I have an SX chip that runs at 4.48 MHz, so I would use the following directives for this chip: IRC_CAL IRC_FAST FREQ 4_000_000 4_480_000 The other problem with the IRC is thermal drift. The SX manual says that the IRC has a tolerance of +/- 8% over the thermal operating range. If I read the manual correctly, the themal operating range is -40 degrees C to 85 degrees C. This is -40 degrees fahrenheit to 185 degrees fahrenheit. This is a 225 degree range. The normal range in a household or office environment would be one-tenth of this, so I would expect the frequency drift to be more like 1% to 2% in a normal setting. The bottom line is that serial communications can work with the internal RC oscillator. I run this way all the time, and I haven't seen any problems. However, in a less controlled enviroment, or when tighter tolerances are required a resonator or crystal oscillator should be used. Dave ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=142883#m143271 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)