HT45F4M
Lithium Battery Backup Power ASSP MCU
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 pointer must first be setup by placing the address
of the look up data to be retrieved in the table pointer register, TBLP and TBHP. These registers
define the total address of the look-up table.
After setting up the table pointer, the table data can be retrieved from the Program Memory using
the “TABRD [m]” or “TABRDL[m]” instructions, respectively. When the instruction is executed,
the lower order table byte from the Program Memory will be transferred to the user defined
Data Memory register [m] as specified in the instruction. 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 accompanying diagram illustrates the addressing data flow of the look-up table.
Lastpage or
T B H P R e g is te r
T B L P R e g is te r
P ro g ra m M e m o ry
D a ta
1 6 b its
R e g is te r T B L H
H ig h B y te
U s e r S e le c te d
R e g is te r
L o w B y te
Table Location Bits
Instruction
b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
TABRD [m] @10 @9 @8 @7 @6 @5 @4 @3 @2 @1 @0
TABRDL [m] 1
1
1 @7 @6 @5 @4 @3 @2 @1 @0
Table Location
Note: b10~b0: Table location bits
@7~@0: Table pointer (TBLP) bits
@10~@8: Table pointer (TBHP) bits
Rev. 1.10
18
January 15, 2013