English
Language : 

HT48F06E Datasheet, PDF (16/69 Pages) Holtek Semiconductor Inc – I/O Flash Type MCU with EEPROM
HT48F06E/HT48F10E/HT48F30E
Input/Output Ports and Control Registers
Within the area of Special Function Registers, the I/O
registers and their associated control registers play a
prominent role. All I/O ports have a designated register
correspondingly labeled as PA, PB, PC, etc. These la-
beled I/O registers are mapped to specific addresses
within the Data Memory as shown in the Data Memory
table, which are used to transfer the appropriate output
or input data on that port. with each I/O port there is an
associated control register labeled PAC, PBC, PCC,
etc., also mapped to specific addresses with the Data
Memory. The control register specifies which pins of that
port are set as inputs and which are set as outputs. To
setup a pin as an input, the corresponding bit of the con-
trol register must be set high, for an output it must be set
low. During program initialization, it is important to first
setup the control registers to specify which pins are out-
puts and which are inputs before reading data from or
writing data to the I/O ports. One flexible feature of these
registers is the ability to directly program single bits us-
ing the ²SET [m].i² and ²CLR [m].i² instructions. The
ability to change I/O pins from output to input and vice
versa by manipulating specific bits of the I/O control reg-
isters during normal program operation is a useful fea-
ture of these devices.
EEPROM Control Register - EECR
This register is used to control all operations to and from
the EEPROM Data Memory. As the EEPROM Data
Memory is not mapped like the other memory types, all
data to and from the EEPROM must be made through
this register. The EECR register is located in Bank 1 of
the Data Memory, so before use the Bank Pointer must
be setup to a value of ²1². The EECR register can only
be read and written to indirectly using the MP1 address
pointer.
EEPROM Data Memory
One of the special features within all these devices is
their internal EEPROM Data Memory. EEPROM, which
stands for Electrically Erasable Programmable Read
Only Memory, is by its nature a non-volatile form of
memory, with data retention even when its power supply
is removed. By incorporating this kind of data memory a
whole new host of application possibilities are made
available to the designer. The availability of EEPROM
b7
DO DI SK CS
storage allows information such as product identification
numbers, calibration values, specific user data, system
setup data or other product information to be stored di-
rectly within the product microcontroller.
EEPROM Data Memory Structure
The internal EEPROM Data Memory has a capacity of
128´8 bits. Unlike the Program Memory and RAM Data
Memory, the EEPROM Data Memory is not directly
mapped and is therefore not directly accessible in the
same way as the other types of memory. Instead it has
to be accessed indirectly through the EEPROM Control
Register.
Accessing the EEPROM Data Memory
The EEPROM Data Memory is accessed using a set of
seven instructions. These instructions control all func-
tions of the EEPROM such as read, write, erase, enable
etc. The internal EEPROM structure is similar to that of a
standard 3-wire EEPROM, for which four pins are used
for transfer of instruction, address and data information.
These are the Chip Select pin, CS, Serial Clock pin, SK,
Data In pin, DI and the Data Out pin, DO. All actions re-
lated to the EEPROM must be conducted through the
EECR register which is located in Bank 1 of the RAM
Data Memory, in which each of these four EEPROM
pins is represented by a bit in the EECR register. By ma-
nipulating these four bits in the EECR register, in accor-
dance with the accompanying timing diagrams, the
microcontroller can communicate with the EEPROM
and carry out the required functions, such as reading
and writing data.
Bit No.
0~3
4
5
6
7
Label
EEPROM Function
¾ Not implemented bit, read as ²0²
CS EEPROM Data Memory select
SK
Serial Clock: Used to clock data
into and out of the EEPROM
Data Input: Instructions, address
DI and data information are written to
the EEPROM on this pin
Data Output: Data from the
DO
EEPROM is readout with this bit.
Will be in a high-impedance con-
dition if no data is being read.
EECR Register - Control Bit Functions
b0
EECR
N o t im p le m e n te d , r e a d a s " 0 "
EEPRO M
EEPRO M
EEPRO M
EEPRO M
D a ta M e m o r y S e le c t
S e r ia l C lo c k In p u t
S e r ia l D a ta In p u t
S e r ia l D a ta O u tp u t
EEPROM Control Register
Rev. 1.00
16
September 10, 2007