首页|嵌入式系统|显示技术|模拟IC/电源|元件与制造|其他IC/制程|消费类电子|无线/通信|汽车电子|工业控制|医疗电子|测试测量
首页 > 分享下载 > 嵌入式系统 > PIC校准内部RC振荡器

PIC校准内部RC振荡器

资料介绍
Recently, Microchip has introduced a series of new
PIC16 and PIC18 PICmicro
®
microcontrollers that have
an on-board Internal RC Oscillator, capable of
eight frequencies from 31 kHz to 8 MHz. These
microcontrollers include the following devices:
• PIC16F818/819
• PIC16F87/88
•PIC18F1X20
• PIC18F2220/2320/4220/4320
The internal RC oscillator is configured and tuned by
the OSCCON and OSCTUNE registers, respectively.
The OSCCON register sets the frequency and contains
the IOFS bit, which indicates when the frequency has
stabilized after a frequency change in the OSCCON
register. OSCTUNE is responsible for tuning the fre-
quency within a range of +/-12 percent on the selected
frequency. The upper range of tuning is 01h - 1Fh and
the lower range is 20h - 3Fh, with center frequency at
00h. It is recommended to consult the device data
sheet for further details.
The assembly code included in this application note
(see Appendix A) is only applicable for a PIC16F819
microcontroller; however, with minor changes, the code
can be ported over to the devices listed above. Having
an internal RC oscillator eliminates the need for capac-
itors and an external crystal, resulting in production
cost savings.
You may be wondering, “Why would it be necessary to
calibrate the internal oscillator if it is supposed to come
from the factory already calibrated?” Even though the
internal oscillator is factory calibrated at 25°C, temper-
ature variations in the operating environment must be
considered. Since a change in frequency, as little as
two to three percent, can corrupt serial communication,
the information presented in this application note can
help you avoid this issue by allowing frequency
calibration over temperature.
AN244
Internal RC Oscillator Calibration
The ability to calibrate the internal oscillator means that
Author: Chris Valenti a known time-base must be established as a reference
Microchip Technology Inc. point. This time-base will be derived from a 32.768 kHz
clock crystal connected to Timer1 (see Figure 1). Other
INTRODUCTION fixed time-bases that can be used are AC line
PIC校准内部RC振荡器
本地下载

评论