AN3101 STM8L15x internal RC oscillator calibration

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

February2011DocID16612Rev31/23AN3101ApplicationnoteSTM8L15xinternalRCoscillatorcalibrationIntroductionTheSTM8L15xmicrocontrollersofferthepossibilityofusinginternalRCoscillatorsHSI(High-speedinternalfactorytrimmedoscillatorof16MHz,typically)orLSI(Low-speedinternallow-consumptionoscillatorof38kHz,typically)asclocksources.TheoperatingtemperatureandvoltagehaveanimpactonRCaccuracy.At3Vand25°C,theHSIhasanaccuracyof±1%typically,butinthefulltemperatureandvoltageranges,theaccuracyoftheHSIfrequencydecreasesto-4.5%/+3%.TocompensatefortheinfluenceoftemperatureandvoltageoninternalRCoscillatoraccuracy,theSTM8L15xmicrocontrollersprovidethecapabilityofcalibratingtheHSIclockandofmeasuringtheLSIclock.ThisapplicationnotegivestwomethodsofcalibratingtheHSIinternalRCoscillator.Thefirstmethodisbasedonfindingthefrequencywiththeminimumerrorandthesecondoneconsistsinfindingthemaximumallowedfrequencyerror.Bothareimplementedbyprovidinganaccuratereferencesource.ThemeasurementoftheLSIclockisperformedbyconnectingtheLSIoscillatortoatimerinputcapture.Dependingonthemeasuredvalue,peripheralregistersareupdatedtomeetuserrequirements.ThisapplicationnoteappliestoSTM8L15xHigh-densityandMedium-densitydevices.:findingtheminimumfrequencyerror.....................10Figure7.“Springloop”............................................................11Figure8.HSIcalibrationflowchart:maximumallowedfrequencyerror.......................13Figure9.HSIfrequencymeasurementflowchart........................................15Figure10.InternalconnectionbetweenLSIandTimer2channel1..........................18Figure11.LSImeasurementconfiguration.............................................18Figure12.TimingdiagramofLSImeasurement.........................................19Figure13.LSIfrequencymeasurementflowchart........................................20STM8L15xsystemclockAN31014/23DocID16612Rev31STM8L15xsystemclockTheSTM8L15xmicrocontrollerfamilyoffersdifferentclocksourcesthatcanbeusedtodrivethesystemclock:●16MHzhigh-speedinternal(HSI)factory-trimmedRCclock●1to16MHzhigh-speedexternal(HSE)oscillatorclock●32.768kHzlow-speedexternal(LSE)oscillatorclock●38kHzlow-speedinternal(LSI)low-consumptionclockTheinternalRCoscillators(HSIandLSI)havetheadvantageofprovidingalow-costclocksource(noexternalcomponentsrequired).Italsohasafasterstartuptimethantheexternaloscillator.However,evenwithcalibration,theinternalRCoscillatorfrequencyislessaccuratethanthefrequencyofanexternalcrystaloscillatororceramicresonator.Note:Theinternaloscillatorcanalsobeusedasbackupsource(auxiliaryclock)iftheexternaloscillatorfails.AN3101HighspeedinternaloscillatorcalibrationDocID16612Rev35/232HighspeedinternaloscillatorcalibrationHSIoscillatorfrequenciesmayvaryfromonechiptoanotherduetomanufacturingprocessvariations.Forthisreason,eachdeviceisfactory-calibratedbySTtohavea1%accuracyatTA=25°C.Afterreset,thefactorycalibrationvalueisautomaticallyloadedinaninternalcalibrationHSICALRregister.ThefrequencyoftheHSIRCoscillatorcanbetrimmedtoachieveabetteraccuracywithwidertemperatureandsupplyvoltageranges.TheHSITRIMRregisterisusedforthispurpose.TomodifythecontentoftheHSITRMRregistertheaccesshastobegrantedbysuccessfullyunlockingthewriteprote

1 / 23
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功