| Electronic Components Datasheet Search |
|
HT45F3830 Datasheet(PDF) 21 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT45F3830 Datasheet(HTML) 21 Page - Holtek Semiconductor Inc |
|
21 / 149 page ![]() Rev. 1.10 �0 �an�a�� 0�� �01� Rev. 1.10 �1 �an�a�� 0�� �01� HT45F3830 Ultrasonic Atomizer Flash MCU HT45F3830 Ultrasonic Atomizer Flash MCU Table Program Example Thefollowingexampleshowshowthetablepointerandtabledataisdefinedandretrievedfromthe microcontroller.ThisexampleusesrawtabledatalocatedintheProgramMemorywhichisstored thereusingtheORGstatement.ThevalueatthisORGstatementis"700H"whichreferstothestart addressofthelastpagewithinthe2KwordsProgramMemoryofthedevice.Thetablepointeris setupheretohaveaninitialvalueof"06H".Thiswillensurethatthefirstdatareadfromthedata tablewillbeattheProgramMemoryaddress"706H"or6locationsafterthestartoftheTBHP specifiedpage.Notethatthevalueforthetablepointerisreferencedtothefirstaddressspecifiedby theTBHPandTBLPregistersifthe"TABRD[m]"instructionisbeingused.Thehighbyteofthe tabledatawhichinthiscaseisequaltozerowillbetransferredtotheTBLHregisterautomatically whenthe"TABRD[m]"instructionisexecuted. BecausetheTBLHregisterisaread-onlyregisterandcannotberestored,careshouldbetaken toensureitsprotectionifboththemainroutineandInterruptServiceRoutineusetableread instructions.Ifusingthetablereadinstructions,theInterruptServiceRoutinesmaychangethe valueoftheTBLHandsubsequentlycauseerrorsifusedagainbythemainroutine.Asaruleitis recommendedthatsimultaneoususeofthetablereadinstructionsshouldbeavoided.However,in situationswheresimultaneoususecannotbeavoided,theinterruptsshouldbedisabledpriortothe executionofanymainroutinetable-readinstructions.Notethatalltablerelatedinstructionsrequire twoinstructioncyclestocompletetheiroperation. Table Read Program Example tempreg1 db ? ; temporary register #1 tempreg2 db ? ; temporary register #2 : : mov a,06h ; initialise low table pointer - note that this address is referenced mov tblp,a ; to the last page or specific page mov a,07h ; initialise high table pointer mov tbhp,a : : tabrd tempreg1 ; transfers value in table referenced by table pointer ; data at program memory address "706H" transferred to tempreg1 and TBLH dec tblp ; reduce value of table pointer by one tabrd tempreg2 ; transfers value in table referenced by table pointer ; data at program memory address "705H" transferred to tempreg2 and TBLH ; in this example the data "1AH" is transferred to tempreg1 and data "0FH" ; to register tempreg2, the value 00H will be transferred to the high ; byte register TBLH : : org 700h ; sets initial address of program memory dc 00Ah, 00Bh, 00Ch, 00Dh, 00Eh, 00Fh, 01Ah, 01Bh : : |
|
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 |