| Electronic Components Datasheet Search |
|
HT46R003B Datasheet(PDF) 41 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT46R003B Datasheet(HTML) 41 Page - Holtek Semiconductor Inc |
|
41 / 76 page ![]() Rev. 1.00 �0 ��ne 1�� �01� Rev. 1.00 �1 ��ne 1�� �01� HT46R003B Cost-Effective A/D 8-bit OTP MCU HT46R003B Cost-Effective A/D 8-bit OTP MCU WhentheTimer/EventCounterisread,orifdataiswrittentothepreloadregister,theclockis inhibitedtoavoiderrors,howeverasthismayresultinacountingerror,thisshouldbetakeninto accountbytheprogrammer.Caremustbetakentoensurethatthetimersareproperlyinitialised beforeusingthemforthefirsttime.Theassociatedtimerenablebitsintheinterruptcontrol registermustbeproperlysetotherwisetheinternalinterruptassociatedwiththetimerwillremain inactive.Theedgeselect,timermodeandclocksourcecontrolbitsintimercontrolregistermust alsobecorrectlysettoensurethetimerisproperlyconfiguredfortherequiredapplication.Itis alsoimportanttoensurethataninitialvalueisfirstloadedintothetimerregistersbeforethetimer isswitchedon;thisisbecauseafterpower-ontheinitialvaluesofthetimerregistersareunknown. Afterthetimerhasbeeninitialisedthetimercanbeturnedonandoffbycontrollingtheenablebitin thetimercontrolregister. WhentheTimer/EventCounteroverflows,itscorrespondinginterruptrequestflagintheinterrupt controlregisterwillbeset.IftheTimer/EventCounterinterruptisenabledthiswillinturngenerate aninterruptsignal.Howeverirrespectiveofwhethertheinterruptsareenabledornot,aTimer/Event Counteroverflowwillalsogenerateawake-upsignalifthedeviceisinaPower-downcondition.This situationmayoccuriftheTimer/EventCounterisintheEventCountingModeandiftheexternal signalcontinuestochangestate.Insuchacase,theTimer/EventCounterwillcontinuetocount theseexternaleventsandifanoverflowoccursthedevicewillbewokenupfromitsPower-down condition.Topreventsuchawake-upfromoccurring,thetimerinterruptrequestflagshouldfirstbe sethighbeforeissuingthe“HALT”instructiontoentertheSleepMode. Timer Program Example TheprogramshowshowtheTimer/EventCounterregistersaresetalongwithhowtheinterruptsare enabledandmanaged.NotehowtheTimer/EventCounteristurnedon,bysettingbit4oftheTimer ControlRegister.TheTimer/EventCountercanbeturnedoffinasimilarwaybyclearingthesame bit.ThisexampleprogramsetstheTimer/EventCounterstobeinthetimermode,whichusesthe internalsystemclockastheirclocksource. PFD Programming Example org 04h ; external interrupt vector org 08h ; Timer/Event Counter interrupt vector jmptmrint;jumpherewhenTimeroverflows : : org 20h ; main program : : ; internal Timer interrupt routine tmrint: : ; Timer main program placed here : begin: ; set Timer registers mov a,09bh ; set Timer preload value mov tmr,a mov a,081h ; set Timer control register mov tmrc,a ; timer mode and prescaler set to /2 mov a, 0c0H ; select fSYSfortheTMRclocksource mov wdtc, a ; set interrupt register mov a,05h ; enable master interrupt and both timer interrupts mov intc0,a : : set tmrc.4 ; start Timer : : |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |