HT82B40A HOLTEK [Holtek Semiconductor Inc], HT82B40A Datasheet - Page 15

no-image

HT82B40A

Manufacturer Part Number
HT82B40A
Description
I/O MCU with USB Interface
Manufacturer
HOLTEK [Holtek Semiconductor Inc]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
HT82B40A-T13D
Quantity:
2 000
Pin-shared Functions
The flexibility of the microcontroller range is greatly en-
hanced by the use of pins that have more than one func-
tion. Limited numbers of pins can force serious design
constraints on designers but by supplying pins with
multi-functions, many of these difficulties can be over-
come. For some pins, the chosen function of the
multi-function I/O pins is set by configuration options
while for others the function is set by application pro-
gram control.
I/O Pin Structures
The diagram illustrates a generic I/O pin internal struc-
tures. As the exact logical construction of the I/O pin will
differ and as the pin-shared structures are not illustrated
this diagram is supplied as a guide only to assist with the
functional understanding of the I/O pins.
Rev. 1.10
External Timer0 Clock Input
The external timer pin TMR0 is pin-shared with the I/O
pin PA6. To configure this pin to operate as timer input,
the corresponding control bits in the timer control reg-
ister must be correctly set. For applications that do not
require an external timer input, this pin can be used as
a normal I/O pin. Note that if used as a normal I/O pin
the timer mode control bits in the timer control register
must select the timer mode, which has an internal
clock source, to prevent the input pin from interfering
with the timer operation.
External Timer1 Clock Input
The external timer pin TMR1 is pin-shared with the I/O
pin PA7. To configure this pin to operate as timer input,
the corresponding control bits in the timer control reg-
ister must be correctly set. For applications that do not
require an external timer input, this pin can be used as
a normal I/O pin. Note that if used as a normal I/O pin
the timer mode control bits in the timer control register
must select the timer mode, which has an internal
clock source, to prevent the input pin from interfering
with the timer operation
Input/Output Ports
15
Programming Considerations
Within the user program, one of the first things to con-
sider is port initialisation. After a reset, all of the data and
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 PAC, PBC,
PCC, PDC and PEC port control register, are then pro-
grammed to setup some pins as outputs, these output
pins will have an initial high output value unless the as-
sociated PA, PB, PC, PD and PE port data registers are
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 pro-
gramming individual bits in the port control register us-
ing 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 re-
write this data back to the output ports.
All pins have the additional capability of providing
wake-up functions. When the device is in the Power
Down Mode, various methods are available to wake the
device up. One of these is a high to low transition of any
of the Port pins. Single or multiple pins can be setup to
have this function.
Read/Write Timing
HT82B40R/HT82B40A
September 4, 2009

Related parts for HT82B40A