1. 首页
  2. 课程学习
  3. 嵌入式
  4. PIC校准内部RC振荡器

PIC校准内部RC振荡器

上传者: 2022-10-21 18:14:06上传 PDF文件 282.49 KB 热度 15次

Recently,Microchiphasintroducedaseriesofnew

PIC16andPIC18PICmicro

®

microcontrollersthathave

anon-boardInternalRCOscillator,capableof

eightfrequenciesfrom31kHzto8MHz.These

microcontrollersincludethefollowingdevices:

•PIC16F818/819

•PIC16F87/88

•PIC18F1X20

•PIC18F2220/2320/4220/4320

TheinternalRCoscillatorisconfiguredandtunedby

theOSCCONandOSCTUNEregisters,respectively.

TheOSCCONregistersetsthefrequencyandcontains

theIOFSbit,whichindicateswhenthefrequencyhas

stabilizedafterafrequencychangeintheOSCCON

register.OSCTUNEisresponsiblefortuningthefre-

quencywithinarangeof+/-12percentontheselected

frequency.Theupperrangeoftuningis01h-1Fhand

thelowerrangeis20h-3Fh,withcenterfrequencyat

00h.Itisrecommendedtoconsultthedevicedata

sheetforfurtherdetails.

Theassemblycodeincludedinthisapplicationnote

(seeAppendixA)isonlyapplicableforaPIC16F819

microcontroller;however,withminorchanges,thecode

canbeportedovertothedeviceslistedabove.Having

aninternalRCoscillatoreliminatestheneedforcapac-

itorsandanexternalcrystal,resultinginproduction

costsavings.

Youmaybewondering,“Whywoulditbenecessaryto

calibratetheinternaloscillatorifitissupposedtocome

fromthefactoryalreadycalibrated?”Eventhoughthe

internaloscillatorisfactorycalibratedat25°C,temper-

aturevariationsintheoperatingenvironmentmustbe

considered.Sinceachangeinfrequency,aslittleas

twotothreepercent,cancorruptserialcommunication,

theinformationpresentedinthisapplicationnotecan

helpyouavoidthisissuebyallowingfrequency

calibrationovertemperature.AN244InternalRCOscillatorCalibrationTheabilitytocalibratetheinternaloscillatormeansthatAuthor:ChrisValentiaknowntime-basemustbeestablishedasareferenceMicrochipTechnologyInc.point.Thistime-basewillbederivedfroma32.768kHzclockcrystalconnectedtoTimer1(seeFigure1).OtherINTRODUCTIONfixedtime-basesthatcanbeusedareACline

用户评论