Chapter 1 Hardware Structure
Input/Output Port Registers
Within the area of Special Function Registers, the I/O registers play a prominent role. All input and
output ports have a designated register correspondingly labeled as PA, PB, PC, etc. These la-
beled 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. In the
LCD Type MCU series, both Port A and Port C are I/O ports so their corresponding I/O registers PA
and PC, can transfer both input and output data. Port B on the other hand is only an input port
whose corresponding register PB, only reads input data. One flexible feature of these registers is
the ability to directly program single bits using the
²SET
[m].i² and
²CLR
[m].i² instructions.
UART Registers
-
USR, UCR1, UCR2, TXR/RXR, BRG
The HT49RU80/HT49CU80 devices each contain an internal UART function which is controlled
via these five registers. The USR is the status register for the UART while UCR1 and UCR2 are
the two control registers. The actual data that is to be transmitted or that is received on the serial in-
terface is stored in the TXR/RXR register while the Baud Rate for the UART is setup via the BRG
register.
Input/Output Ports
Holtek microcontrollers offer significant flexibility on their I/O ports. Although Port B remains fixed
as an input only port, and Port D on the HT49RU80/HT49CU80 devices as an output only port, all
pins on Port A and Port C have the ability to function as either input or output. With further options
such as CMOS or NMOS output types, pull-high and wake-up functions, the user is provided with
an I/O structure to meet the needs of a wide range of application possibilities.
Depending upon which device and package is chosen, the LCD Type MCU series provides from
14 to 31 bidirectional, input and output lines. The I/O Ports are known as Port A and Port C, the in-
put Port is known as Port B and the output Port as Port D. These ports are mapped to the Data
Memory with specific addresses as shown in the Special Purpose Data Memory table. The Port A
and Port C I/O ports can be used for both input and output operations, however, it must be noted
that unlike some of the other series of microcontrollers, in the LCD Type MCU series this is not
achieved through the use of port control registers. Setting up an I/O pin as an input is achieved by
first setting its output high which effectively places its NMOS output transistor in a high impedance
state allowing the pin to be now used as an input. Note that this obviously can only be done if the
output pins are first configured as NMOS output pins. For this reason, if the configuration options
have already setup an output as a CMOS type, it cannot subsequently be used as an input.
When used as an input, the ports are non-latching, which means that the inputs must be ready at
the T2 rising edge of the instruction
²MOV
A,[m]², where m denotes the port address. For output
operation the data is latched and remains unchanged until the output latch is rewritten. Note that
the CMOS or NMOS output type option is only available on Port A, pins PA0~PA3 and Port C pins
PC0~PC3 and PC4~PC7. The CMOS or NMOS output option applies to blocks of four pins, individ-
ual pins cannot be selected for this option. Port B is an input port only and has no output function.
All pins on Port B are permanently connected to an internal pull-high resistor. There are no configu-
ration options associated with Port B. The additional Port D on the HT49RU80/HT49CU80 de-
vices are output only lines and are chosen via a configuration option to function as either CMOS
outputs or as LCD segment output.
43
Home Index Bookmark Pages Text
Previous Next
Pages: Home Index