| Electronic Components Datasheet Search |
|
HT46R002 Datasheet(PDF) 43 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT46R002 Datasheet(HTML) 43 Page - Holtek Semiconductor Inc |
|
43 / 83 page ![]() Rev. 1.21 42 April 11, 2017 Rev. 1.21 43 April 11, 2017 HT46R002/HT46R003 Cost-Effective A/D 8-Bit OTP MCU HT46R002/HT46R003 Cost-Effective A/D 8-Bit OTP MCU Pulse Width Capture Mode Inthismode,theTimer/EventCountercanbeutilisedtomeasurethewidthofexternalpulses appliedtotheexternaltimerpin.Tooperateinthismode,theOperatingModeSelectbitpair,T0M1/ T0M0,intheTimerControlRegistermustbesettothecorrectvalueasshown. Bit7 Bit6 1 1 Control Register Operating Mode Select Bits for the Pulse Width Capture Mode Inthismodetheinternalclock,fSYS,fSYS/4orfLIRCisusedastheinternalclockforthe8-bitTimer/ EventCounter.However,theclocksource,fSYS,forthe8-bittimerisfurtherdividedbyaprescaler, thevalueofwhichisdeterminedbythePrescalerRateSelectbitsT0PSC2~T0PSC0,whicharebit 2~0oftheTimerControlRegister,AfterotherbitsintheTimerControlRegisterhavebeenset,the enablebitT0ON,whichisbit4oftheTimerControlRegister,canbesethightoenabletheTimer/ EventCounter,howeveritwillnotactuallystartcountinguntilanactiveedgeisreceivedonthe externaltimerpin. IftheActiveEdgeSelectbitT0EGwhichisbit3oftheTimerControlRegisterislow,onceahigh tolowtransitionhasbeenreceivedontheexternaltimerpin,theTimer/EventCounterwillstart countinguntiltheexternaltimerpinreturnstoitsoriginalhighlevel.Atthispointtheenablebitwill beautomaticallyresettozeroandtheTimer/EventCounterwillstopcounting.IftheActiveEdge Selectbitishigh,theTimer/EventCounterwillbegincountingoncealowtohightransitionhas beenreceivedontheexternaltimerpinandstopcountingwhentheexternaltimerpinreturnstoits originallowlevel.Asbefore,theenablebitwillbeautomaticallyresettozeroandtheTimer/Event Counterwillstopcounting.Itisimportanttonotethatinthepulsewidthcapturemode,theenable bitisautomaticallyresettozerowhentheexternalcontrolsignalontheexternaltimerpinreturns toitsoriginallevel,whereasintheothertwomodestheenablebitcanonlyberesettozerounder programcontrol. TheresidualvalueintheTimer/EventCounter,whichcannowbereadbytheprogram,therefore representsthelengthofthepulsereceivedontheTMRpin.Astheenablebithasnowbeenreset, anyfurthertransitionsontheexternaltimerpinwillbeignored.Thetimercannotbeginfurtherpulse widthcaptureuntiltheenablebitissethighagainbytheprogram.Inthisway,singleshotpulse measurementscanbeeasilymade.ItshouldbenotedthatinthismodetheTimer/EventCounteris controlledbylogicaltransitionsontheexternaltimerpinandnotbythelogiclevel.WhentheTimer/ EventCounterisfullandoverflows,aninterruptsignalisgeneratedandtheTimer/EventCounter willreloadthevaluealreadyloadedintothepreloadregisterandcontinuecounting.Theinterrupt canbedisabledbyensuringthattheTimer/EventCounterInterruptEnablebitinthecorresponding InterruptControlRegister,itisresettozero.AstheTMRpinissharedwithanI/Opin,toensure thatthepinisconfiguredtooperateasapulsewidthcapturepin,twothingshavetobeimplemented. ThefirstistoensurethattheOperatingModeSelectbitsintheTimerControlRegisterplacethe Timer/EventCounterinthepulsewidthcapturemode,thesecondistoensurethattheportcontrol registerconfigurethepinasaninput. |
|
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 |