HT82A520R HOLTEK [Holtek Semiconductor Inc], HT82A520R Datasheet - Page 10

no-image

HT82A520R

Manufacturer Part Number
HT82A520R
Description
Full Speed USB 8-Bit OTP MCU with SPI
Manufacturer
HOLTEK [Holtek Semiconductor Inc]
Datasheet
Program Memory
The Program Memory is the location where the user
code or program is stored. The HT82A520R/
HT82A620R is a One-Time Programmable, OTP, mem-
ory type device where users can program their applica-
tion code into the device. By using the appropriate
programming tools, OTP devices offer users the flexibil-
ity to freely develop their applications which may be use-
ful during debug or for products requiring frequent
upgrades or program changes. OTP devices are also
applicable for use in applications that require low or me-
dium volume production runs.
Structure
The Program Memory has a capacity of 4K by 15 bits.
The Program Memory is addressed by the Program
Counter and also contains data, table information and
interrupt entries. Table data, which can be setup in any
location within the Program Memory, is addressed by
separate table pointer registers.
Special Vectors
Within the Program Memory, certain locations are re-
served for special usage such as reset and interrupts.
Rev.1.00
Arithmetic operations: ADD, ADDM, ADC, ADCM,
SUB, SUBM, SBC, SBCM, DAA
Logic operations: AND, OR, XOR, ANDM, ORM,
XORM, CPL, CPLA
Rotation RRA, RR, RRCA, RRC, RLA, RL, RLCA,
RLC
Increment and Decrement INCA, INC, DECA, DEC
Branch decision, JMP, SZ, SZA, SNZ, SIZ, SDZ,
SIZA, SDZA, CALL, RET, RETI
Location 000H
This vector is reserved for use by the device reset for
program initialisation. After a device reset is initiated, the
program will jump to this location and begin execution.
Location 004H
This area is reserved for the USB interrupt service
program. If the USB interrupt is activated, the interrupt
is enabled and the stack is not full, the program begins
execution at location 004H.
Location 008H
This vector is used by the external interrupt. If the INT
external input pin on the device receives a high to low
transition, the program will jump to this location and
begin execution, if the interrupt is enabled and the
stack is not full.
Location 00CH
This vector is used by the timer counter. If a counter
overflow occurs, the program will jump to this location
and begin execution if the timer interrupt is enabled
and the stack is not full.
10
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, one method is to first
setup a low byte table pointer by placing the lower order
address of the look up data to be retrieved in the low
byte table pointer register, TBLP. This register defines
the lower 8-bit address of the look-up table.
After setting up the table pointer, the table data can be
retrieved from the current Program Memory page or last
Program Memory page using the TABRDC[m] or
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
Another method is to setup the full table address using
both the TBLP and TBHP low and high byte table pointer
registers to directly address any area in he Program
Memory. In this way any page of data can be accessed
directly using the TABRDL instruction. If the TBHP high
byte table pointer register is to be used, then it must first
be enabled with a configuration option.
TABRDL [m] instructions, respectively. When these in-
Location 010H
This vector is used by serial interface. When 8-bits of
data have been received or transmitted successfully
from serial interface, the program will jump to this lo-
cation and begin execution if the interrupt is enabled
and the stack is not full.
Program Memory Structure
HT82A520R/HT82A620R
October 23, 2009

Related parts for HT82A520R