HT46R064D/065D/066D
Enhanced A/D Type 8-Bit OTP MCU with LED Driver
A/D Inputs
Each device in this series has either four or eight inputs to the A/D converter. All of these analog inputs
are pin-shared with I/O pins. If these pins are to be used as A/D inputs and not as I/O pins then the
corresponding PCRn bits in the PCR register, must be properly setup. There are no configuration
options associated with the A/D converter. If chosen as I/O pins, then full pull-high resistor
configuration options remain, however if used as A/D inputs then any pull-high resistor configuration
options associated with these pins will be automatically disconnected.
I/O Pin Structures
The diagrams illustrate the I/O pin internal structures. As the exact logical construction of the I/O pin
may differ from these drawings, they are supplied as a guide only to assist with the functional
understanding of the I/O pins.
Programming Considerations
Within the user program, one of the first things to consider is port initialisation. After a reset, the I/O
data register and I/O port control register will be set high. This means that all I/O pins will default to an
input state, the level of which depends on the other connected circuitry and whether pull-high options
have been selected. If the port control registers, are then programmed to setup some pins as outputs,
these output pins will have an initial high output value unless the associated port data register is first
programmed. Selecting which pins are inputs and which are outputs can be achieved byte-wide by
loading the correct value into the port control register or by programming individual bits in the port
control register using the ²SET [m].i² and ²CLR [m].i² instructions. Note that when using these bit
control instructions, a read-modify-write operation takes place. The microcontroller must first read in
the data on the entire port, modify it to the required new bit values and then rewrite this data back to the
output ports.
Read Modify Write Timing
Pins PA0 to PA7 each have a wake-up functions, selected via the PAWK register. When the device is in
the Sleep Mode, various methods are available to wake the device up. One of these is a high to low
transition of any of the these pins. Single or multiple pins on Port Acan be setup to have this function.
Generic Input/Output Ports
Rev. 1.00
43
January 12, 2011