| Electronic Components Datasheet Search |
|
HT82B42R Datasheet(PDF) 28 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT82B42R Datasheet(HTML) 28 Page - Holtek Semiconductor Inc |
|
28 / 86 page ![]() Rev. 1.00 28 October 27, 2011 Rev. 1.00 29 October 27, 2011 HT82B42R/HT82B42RE I/O MCU with USB Interface Programming Considerations Withintheuserprogram,oneofthefirstthingstoconsiderisportinitialisation.Afterareset,allof thedataandportcontrolregisterwillbesethigh.ThismeansthatallI/Opinswilldefaulttoaninput state,thelevelofwhichdependsontheotherconnectedcircuitryandwhetherpull-highoptions havebeenselected.IfthePAC,PBCandPECportcontrolregister,arethenprogrammedtosetup somepinsasoutputs,theseoutputpinswillhaveaninitialhighoutputvalueunlesstheassociated PA,PBandPEportdataregistersarefirstprogrammed.Selectingwhichpinsareinputsandwhich areoutputscanbeachievedbyte-widebyloadingthecorrectvalueintotheportcontrolregisteror byprogrammingindividualbitsintheportcontrolregisterusingthe"SET[m].i"and"CLR[m].i" instructions.Notethatwhenusingthesebitcontrolinstructions,aread-modify-writeoperationtakes place.Themicrocontrollermustfirstreadinthedataontheentireport,modifyittotherequirednew bitvaluesandthenrewritethisdatabacktotheoutputports. T1 T2 T3 T4 T1 T2 T3 T4 Wr it e to P or tR ead fr om P or t S yst em C lo ck Po r t D at a Read/Write Timing Allpinshavetheadditionalcapabilityofprovidingwake-upfunctions.Whenthedeviceisinthe PowerDownMode,variousmethodsareavailabletowakethedeviceup.Oneoftheseisahighto lowtransitionofanyofthePortpins.Singleormultiplepinscanbesetuptohavethisfunction. Timer/Event Counters Theprovisionoftimersformanimportantpartofanymicrocontroller,givingthedesignerameans ofcarryingouttimerelatedfunctions.Thisdevicecontainstwocount-uptimersof8-bitand16-bit capacitiesrespectively.Aseachtimerhasthreedifferentoperatingmodes,theycanbeconfiguredto operateasageneraltimer,anexternaleventcounterorasapulsewidthmeasurementdevice. TherearetwotypesofregistersrelatedtotheTimer/EventCounters.Thefirstistheregister thatcontainstheactualvalueoftheTimer/EventCounterandintowhichaninitialvaluecanbe preloaded,andisknownasTMR0,TMR1HorTMR1L.Readingfromthisregisterretrievesthe contentsoftheTimer/EventCounter.ThesecondtypeofassociatedregisteristheTimerControl Register,whichdefinesthetimeroptionsanddetermineshowtheTimer/EventCounteristobeused, andhasthenameTMR0CorTMR1C.Thisdevicecanhavethetimerclocksconfiguredtocome fromtheinternalclocksources.Inaddition,thetimerclocksourcecanalsobeconfiguredtocome fromtheexternaltimerpins. TheexternalclocksourceisusedwhentheTimer/EventCounterisintheeventcountingmode,the clocksourcebeingprovidedontheexternaltimerpin.ThepinhasthenameTMR0orTMR1and ispin-sharedwithanI/Opin.DependingupontheconditionoftheT0EorT1EbitintheTimer ControlRegister,eachhightolow,orlowtohightransitionontheexternaltimerinputpinwill incrementtheTimer/EventCounterbyone. |
|
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 |