HT37Q70 Holtek Semiconductor Inc., HT37Q70 Datasheet - Page 23

no-image

HT37Q70

Manufacturer Part Number
HT37Q70
Description
4-channel Music Synthesizer Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
Special Function Registers
To ensure successful operation of the microcontroller,
certain internal registers are implemented in the RAM
Data Memory area. These registers ensure correct op-
eration of internal functions such as timers, interrupts,
watchdog, etc., as well as external functions such as I/O
data control. The location of these registers within the
RAM Data Memory begins at the address 00H .
Indirect Addressing Register - IAR0, IAR1
The Indirect Addressing Registers, IAR0 and IAR1, al-
though having their locations in normal RAM register
space, do not actually physically exist as normal regis-
ters. The method of indirect addressing for RAM data
manipulation uses these Indirect Addressing Registers
and Memory Pointers, in contrast to direct memory ad-
dressing, where the actual memory address is speci-
fied. Actions on the IAR0 and IAR1 registers will result in
no actual read or write operation to these registers but
rather to the memory location specified by their corre-
sponding Memory Pointer, MP0 or MP1/MP2. Acting as
a pair, IAR0 and MP0 can together only access data
from Bank 0, while the IAR1 and MP1/MP2 register can
Example
The following example shows how to clear General Purpose Data Memory of bank0 by using MP0 and bank0~bank1
by using MP1 and MP2
code .section at 0 code
org 00h
RAM0TEST:
LOOP0:
RAM1TEST:
RAM1_MP1:
LOOP1:
RAM1TEST_Exit:
RAM2TEST:
Rev. 1.00
MOV A,60H
MOV MP0,A
CLR IAR0
CLR WDT
SIZ MP0
JMP LOOP0
:
CLR DACC.7
CLR rBP1
MOV A,rBP1
XOR A,25
SZ
JMP RAM1TEST_Exit
MOV A,60H
MOV MP1,A
CLR WDT
CLR IAR1
SIZ MP1
JMP LOOP1
INC rBP1
JMP RAM1_MP1
:
Set dacc.7
CLR rBP2
ZERO
; loaded with first RAM address
; clear the data at address defined by MP0
; increase MP0, and skip out if MP0 is 0
; access data to iar1 by MP1
; clear RAM bank pointer 1
; load rBP1 data, and check if rBP1 is 25
; jump to exit loop if rBP1 is 2
; loaded with first RAM address to MP1
; clear the data at address defined by MP1
; increase MP1, and skip out if MP1 is 0
; increase rBP1
; access data to iar1 by MP2
; clear RAM bank pointer 2
23
access data from both Bank 0 and Bank 1. Using MP1 or
MP2 are selected by DACC.7. As the Indirect Ad-
dressing Registers are not physically implemented,
reading the Indirect Addressing Registers indirectly will
return a result of 00H and writing to the registers indi-
rectly will result in no operation.
Memory Pointer - MP0, MP1, MP2
Three Memory Pointers, known as MP0, MP1 and MP2
are provided. These Memory Pointers are physically im-
plemented in the Data Memory and can be manipulated
in the same way as normal registers providing a conve-
nient way with which to address and track data. When
any operation to the relevant Indirect Addressing Regis-
ters is carried out, the actual address that the
microcontroller is directed to, is the address specified by
the related Memory Pointer. MP0, together with Indirect
Addressing Register, IAR0, are used to access data
from Bank 0 only, while MP1/MP2 and IAR1 are used to
access data from both Bank 0 and Bank 1. Using MP1 or
MP2 are selected by DACC.7.
HT37Q70/60/50/40/30/20
February 17, 2009

Related parts for HT37Q70