English
Language : 

HT66FB572 Datasheet, PDF (171/288 Pages) Holtek Semiconductor Inc – USB RGB LED Flash MCU
HT66FB572/HT66FB574/HT66FB576
USB RGB LED Flash MCU
Comparator Interrupt
Each comparator also possesses its own interrupt function. When any one of the output bits changes
state, its relevant interrupt flag will be set, and if the corresponding interrupt enable bit is set, then
a jump to its relevant interrupt vector will be executed. Note that it is the changing state of the
CMPnO bit and not the output pin which generates an interrupt. If the microcontroller is in the
SLEEP or IDLE Mode and the Comparator is enabled, then if the external input lines cause the
Comparator output bit to change state, the resulting generated interrupt flag will also generate a
wake-up. If it is required to disable a wake-up from occurring, then the interrupt flag should be first
set high before entering the SLEEP or IDLE Mode.
Programming Considerations
If the comparator is enabled, it will remain active when the microcontroller enters the SLEEP or
IDLE Mode, however as it will consume a certain amount of power, the user may wish to consider
disabling it before the SLEEP or IDLE Mode is entered.
As comparator pins are shared with normal I/O pins the I/O registers for these pins will be read as
zero (port control register is "1") or read as port data register value (port control register is "0") if the
comparator function is enabled.
Serial Interface Module – SIM
The devices contain a Serial Interface Module, which includes both the four line SPI interface and
the two line I2C interface types, to allow an easy method of communication with external peripheral
hardware. Having relatively simple communication protocols, these serial interface types allow
the microcontroller to interface to external SPI or I2C based hardware such as sensors, Flash or
EEPROM memory, etc. The SIM interface pins are pin-shared with other I/O pins therefore the SIM
interface functional pins must first be selected using the corresponding pin-shared function selection
bits. As both interface types share the same pins and registers, the choice of whether the SPI or I2C
type is used is made using the SIM operating mode control bits, named SIM2~SIM0, in the SIMC0
register. These pull-high resistors of the SIM pin-shared I/O are selected using pull-high control
registers when the SIM function is enabled and the corresponding pins are used as SIM input pins.
SPI Interface
This SPI interface function, which is part of the Serial Interface Module, should not be confused
with the other independent SPI function, which is described in another section of this datasheet.
The SPI interface is often used to communicate with external peripheral devices such as sensors,
Flash or EEPROM memory devices etc. Originally developed by Motorola, the four line SPI
interface is a synchronous serial data interface that has a relatively simple communication protocol
simplifying the programming requirements when communicating with external hardware devices.
The communication is full duplex and operates as a slave/master type, where the devices can be
either master or slave. Although the SPI interface specification can control multiple slave devices
from a single master, but the devices provide only one SCS pin. If the master needs to control
multiple slave devices from a single master, the master can use I/O pin to select the slave devices.
SPI Interface Operation
The SPI interface is a full duplex synchronous serial data link. It is a four line interface with pin
names SDI, SDO, SCK and SCS. Pins SDI and SDO are the Serial Data Input and Serial Data Output
lines, the SCK pin is the Serial Clock line and SCS is the Slave Select line. As the SPI interface pins
are pin-shared with normal I/O pins and with the I2C function pins, the SPI interface pins must first
Rev. 1.20
171
February 16, 2017