ht82k72e Holtek Semiconductor Inc., ht82k72e Datasheet - Page 8

no-image

ht82k72e

Manufacturer Part Number
ht82k72e
Description
Ht82k72e/ht82k72a -- One Channel Keyboard With R-f Type Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
Table Program Example
The following example shows how the table pointer and
table data is defined and retrieved from the
microcontroller. This example uses raw table data lo-
cated in the last page which is stored there using the
ORG statement. The value at this ORG statement is
within the 2K Program Memory of device. The table
pointer is setup here to have an initial value of 06H .
tempreg1
tempreg2
mov
mov
tabrdl
dec
tabrdl
org
dc
Because the TBLH register is a read-only register and cannot be restored, care should be taken to ensure its protection
if both the main routine and Interrupt Service Routine use the table read instructions. If using the table read instructions,
the Interrupt Service Routines may change the value of TBLH and subsequently cause errors if used again by the main
routine. As a rule it is recommended that simultaneous use of the table read instructions should be avoided. However,
in situations where simultaneous use cannot be avoided, the interrupts should be disabled prior to the execution of any
main routine table-read instructions. Note that all table related instructions require two instruction cycles to complete
their operation.
Rev. 1.00
Note:
F00H which refers to the start address of the last page
TABRDC [m]
TABRDL [m]
Instruction
PC10~PC8: Current program counter bits when TBHP is disable.
TBHP register bit2~bit0 when TBHP is enabled
@7~@0: Table Pointer TBLP bits
db
db
:
:
a,06h
tblp,a
:
:
tempreg1
tblp
tempreg2
:
:
700h
00Ah, 00Bh, 00Ch, 00Dh, 00Eh, 00Fh, 01Ah, 01Bh
:
:
PC10
b10
1
?
?
PC9
b9
1
PC8
; temporary register #1
; temporary register #2
; initialise table pointer - note that this address
; is referenced
; to the last page or present page
; transfers value in table referenced by table pointer
; to tempregl
; data at prog. memory address 706H transferred to
; tempreg1 and TBLH
; reduce value of table pointer by one
; transfers value in table referenced by table pointer
; to tempreg2
; data at prog.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
; sets initial address of last page
b8
1
@7
@7
b7
Table Location
@6
@6
b6
Table Location Bits
8
This will ensure that the first data read from the data ta-
ble will be at the Program Memory address 706H or 6
locations after the start of the last page. Note that the
value for the table pointer is referenced to the first ad-
dress of the present page if the TABRDC [m] instruc-
tion is being used. The high byte of the table data which
in this case is equal to zero will be transferred to the
TBLH register automatically when the TABRDL [m] in-
struction is executed.
@5
@5
b5
@4
@4
b4
HT82K72E/HT82K72A
@3
@3
b3
@2
@2
b2
February 20, 2008
@1
@1
b1
@0
@0
b0

Related parts for ht82k72e