English
Language : 

HT82A824R Datasheet, PDF (27/121 Pages) Holtek Semiconductor Inc – USB Audio MCU
HT82A824R
USB Audio MCU
I/O Port Control Registers
Each I/O port has its own control register PAC, PBC and PCC, to control the input/output
configuration. With this control register, each CMOS output or input with or without pull-high
resistor structures can be reconfigured dynamically under software control. Each of the I/O ports is
directly mapped to a bit in its associated port control register.
For the I/O pin to function as an input, the corresponding bit of the control register must be written
as a “1”. This will then allow the logic state of the input pin to be directly read by instructions.
When the corresponding bit of the control register is written as a “0”, the I/O pin will be setup as
a CMOS output. If the pin is currently setup as an output, instructions can still be used to read the
output register. However, it should be noted that the program will in fact only read the status of the
output data latch and not the actual logic status of the output pin.
Pin-shared Functions
The flexibility of the microcontroller range is greatly enhanced by the use of pins that have more
than one function. Limited numbers of pins can force serious design constraints on designers but
by supplying pins with multi-functions, many of these difficulties can be overcome. For some pins,
the chosen function of the multi-function I/O pins is set by software options while for others the
function is set by application program control.
●● Serial Interface
The serial interface pins SDO, SDI, SCS and SCK are pin-shared with the I/O pins PC4, PC5,
PC6 and PC7. For applications not requiring serial interface, the pin-shared pins can be used as a
normal I/O pin.
●● External Interrupt
The external interrupt pin INT is pin-shared with the I/O pin PC3. For applications not requiring
an external interrupt input, the pin-shared external interrupt pin can be used as a normal I/O pin,
however to do this, the external interrupt enable bits in the MFI1C register must be disabled.
●● External Timer/Event Counter Input
The external timer pins TMR0/TMR1 are pin-shared with the I/O pins PC1/PC2. If these shared
pins are to be used as a Timer/Event Counter inputs, then the Timer/Event Counter must be
configured to be in the Event Counter or Pulse Width Measurement Mode. This is achieved by
setting the appropriate bits in the relevant timer/Event Counter Control Register. The pin must also
be setup as an input by setting the appropriate bit in the Port Control Register Pull-high resistor
options can also be selected via the appropriate port pull-high configuration option. If the shared
pin is to be used as a normal I/O pin, then the external timer input function must be disabled, by
ensuring that the corresponding Timer/Event Counter is configured to be in the Off Mode or Timer
Mode.
●● PFD Output
The device contains a PFD function whose single output is pin-shared with PC0. The output
function of this pin is chosen via software. Note that the corresponding bit of the port control
register, PCC.0, must setup the pin as an output to enable the PFD output. If the PCC port control
register has setup the pin as an input, then the pin will function as a normal logic input with the
usual pull-high option, even if the PFD configuration option has been selected.
Rev 1.00
27
April 14, 2011