English
Language : 

HT46RU26 Datasheet, PDF (12/86 Pages) Holtek Semiconductor Inc – A/D Type 8-Bit MCU with UART
HT46RU26/HT46CU26
jmp ext1_int
:
:
org 00Ch
:
:
ext0_int:
mov bp_exti,a
mov a,status
mov statusbuf0,a
:
:
mov a,statusbuf0
mov status,a
mov a,bp_exti
mov bp,a
mov a,accbuf0
; call addresses
; jump to timer 0 interrupt subroutine
; jump here from any bank when timer 0 int.
; occurs - BP retains original value
; external interrupt subroutine
; backup bank pointer
; backup status register
; backup status register
; restore status register
; restore bank pointer
; restore accumulator
:
:
ext1_int:
mov bp_tmr0,a
mov a,status
mov statusbuf1,a
:
:
mov a,statusbuf1
mov status,a
mov a,bp_tmr0
mov bp,a
mov a,accbuf1
reti
:
:
; return to main program and original calling bank
; ext1_int interrupt subroutine
; backup bank pointer
; backup status register
; restore status register
; restore bank pointer
; restore accumulator
; return to main program and original calling bank
Look-up Table
Any location within the Program Memory can be defined
as a look-up table where programmers can store fixed
data. To use the look-up table, the table pointers must
first be setup by placing the lower order address of the
look up data to be retrieved in the table low pointer regis-
ter, TBLP, and the higher order address in the table high
pointer register, TBHP. These registers define the full
address of the look-up table in any bank.
After setting up the table pointers, the table data can be
retrieved from the current Program Memory page or last
Program Memory page using the ²TABRDC[m]² or
²TABRDL [m]² instructions, respectively. When these in-
structions are executed, the lower order table byte from
the Program Memory will be transferred to the user de-
fined Data Memory register [m] as specified in the in-
struction. The higher order table data byte from the
Program Memory will be transferred to the TBLH special
register. Any unused bits in this transferred higher order
byte will be read as ²0².
The following diagram illustrates the addressing/data
flow of the look-up table:
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
000H, however, this only indicates the offset value from
the start address of Bank 1 which in this case is 2000H.
The table pointer high byte is setup to have a value of
20H while the value of the table pointer low byte is setup
here to have an initial value of 05H. This will ensure that
the data byte read from the data table will be located at
the Program Memory address 2005H, or 5 locations af-
ter the first address defined by the ORG statement.
When the TABRDC [m] instruction is executed, the table
data low byte which has a value of FFH, will be trans-
ferred to the user defined temp register, while the table
data high byte, which has a value of 55H, will be trans-
ferred to the TBLH register.
TBH P
TB LP
P ro g ra m
M e m o ry
TB LH
T a b le C o n te n ts H ig h B y te
S p e c ifie d b y [m ]
T a b le C o n te n ts L o w B y te
Rev. 1.00
12
June 12, 2008