HT49RA1/HT49CA1
the LCD Data Memory, will be in an unknown condition,
the programmer must therefore ensure that the Data
Memory is properly initialised.
General Purpose Data Memory
All microcontroller programs require an area of
read/write memory where temporary data can be stored
and retrieved for use later. It is this area of RAM memory
that is known as General Purpose Data Memory. This
area of Data Memory is fully accessible by the user pro-
gram for both read and write operations. By using the
²SET [m].i² and ²CLR [m].i² instructions individual bits
can be set or reset under program control giving the
user a large range of flexibility for bit manipulation in the
Data Memory. As the General Purpose Data Memory
exists in Bank 0, it is necessary to first ensure that the
Bank Pointer is set to the correct value before accessing
the General Purpose Data Memory. When the Bank
Pointer is set to the value 01H, the LCD Memory will be
accessed. Bank 1must be addressed indirectly using
the Memory Pointer MP1 and the indirect addressing
register IAR1. Any direct addressing or any indirect ad-
dressing using MP0 and IAR0 will always result in data
from Bank 0 being accessed.
Special Purpose Data Memory
This area of Data Memory is where registers, necessary
for the correct operation of the microcontroller, are
IA R 0
M P0
IA R 1
M P1
BP
ACC
PCL
TB LP
TB LH
R TC C
STATU S
IN T C 0
TM R 0
TM R 0C
TM R 1H
TM R 1L
TM R 1C
PA
PB
PC
PCC
PD
stored. Most of the registers are both readable and
writable but some are protected and are readable only,
the details of which are located under the relevant Spe-
cial Function Register section. Note that for locations
that are unused, any read instruction to these addresses
will return the value ²00H².
LCD Memory
The data to be displayed on the LCD is also stored in an
area of fully accessible Data Memory. By writing to this
area of RAM, the LCD display output can be directly con-
trolled by the application program. As the LCD Memory
exists in Bank 1, but have addresses which map into the
Bank 0 Data Memory, it is necessary to first ensure that
the Bank Pointer is set to the value 01H before accessing
the LCD Memory. The LCD Memory can only be ac-
cessed indirectly using the Memory Pointer MP1 and the
indirect addressing register IAR1. When the Bank Pointer
is set to Bank 1 to access the LCD Data Memory.
Special Function Registers
To ensure successful operation of the microcontroller,
certain internal registers are implemented in the Data
Memory area. These registers ensure correct operation
of internal functions such as timers, interrupts, etc., as
well as external functions such as I/O data control. The
location of these registers within the Data Memory be-
gins at the address ²00H². Any unused Data Memory lo-
cations between these special function registers and the
point where the General Purpose Memory begins is re-
served for future expansion purposes, attempting to
read data from these locations will return a value of
²00H².
Indirect Addressing Register - IAR0, IAR1
The IAR0 and IAR1 registers, located at Data Memory
addresses ²00H² and ²02H², are not physically imple-
mented. These special function registers allows what is
known as indirect addressing, which permits data ma-
nipulation using Memory Pointers instead of the usual
direct memory addressing method where the actual
memory address is defined. Any actions on the IAR0
and IAR1 registers will result in corresponding
read/write operations to the memory locations specified
by the Memory Pointers MP0 and MP1. Reading the
IAR0 and IAR1 registers indirectly will return a result of
²00H² and writing to the register indirectly will result in
no operation.
IN T C 1
LC D C
: U n u s e d , re a d a s "0 0 "
Special Purpose Data Memory
Rev. 1.10
11
March 30, 2014