| 전자부품 데이터시트 검색엔진 |
|
HT82B42R 데이터시트(PDF) 19 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT82B42R 데이터시트(HTML) 19 Page - Holtek Semiconductor Inc |
|
19 / 86 page ![]() Rev. 1.00 18 October 27, 2011 Rev. 1.00 19 October 27, 2011 HT82B42R/HT82B42RE I/O MCU with USB Interface Table Program Example Thefollowingexampleshowshowthetablepointerandtabledataisdefinedandretrievedfrom themicrocontroller.Thisexampleusesrawtabledatalocatedinthelastpagewhichisstoredthere usingtheORGstatement.ThevalueatthisORGstatementis"F00H"whichreferstothestart addressofthelastpagewithinthe4KProgramMemoryofdevice.Thetablepointerissetuphere tohaveaninitialvalueof"06H".Thiswillensurethatthefirstdatareadfromthedatatablewillbe attheProgramMemoryaddress"F06H"or6locationsafterthestartofthelastpage.Notethatthe valueforthetablepointerisreferencedtothefirstaddressofthepresentpageifthe"TABRDC[m]" instructionisbeingused.Thehighbyteofthetabledatawhichinthiscaseisequaltozerowillbe transferredtotheTBLHregisterautomaticallywhenthe"TABRDL[m]"instructionisexecuted. tempreg1 db ? ; temporary register #1 tempreg2 db ? ; temporary register #2 : : mov a,06h ; initialise table pointer-note that this ; address is referenced mov tblp,a ; to the last page or present page : : tabrdl tempreg1 ; transfers value in table referenced by table ; pointer to tempregl data at prog. memory ; address "F06H" transferred to tempreg1 and TBLH dec tblp ; reduce value of table pointer by one tabrdl tempreg2 ; transfers value in table referenced by table ; pointer to tempreg2 data at prog. memory ; address "F05H" 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 F00h ; sets initial address of last page dc 00Ah, 00Bh, 00Ch, 00Dh, 00Eh, 00Fh, 01Ah, 01Bh : : BecausetheTBLHregisterisaread-onlyregisterandcannotberestored,careshouldbetaken toensureitsprotectionifboththemainroutineandInterruptServiceRoutineusethetableread instructions.Ifusingthetablereadinstructions,theInterruptServiceRoutinesmaychangethe valueofTBLHandsubsequentlycauseerrorsifusedagainbythemainroutine.Asaruleitis recommendedthatsimultaneoususeofthetablereadinstructionsshouldbeavoided.However,in situationswheresimultaneoususecannotbeavoided,theinterruptsshouldbedisabledpriortothe executionofanymainroutinetable-readinstructions.Notethatalltablerelatedinstructionsrequire twoinstructioncyclestocompletetheiroperation. |
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 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 |