Comparator Interrupt
Each also possesses its own interrupt function. When any one of the 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 C0OUT or C1OUT
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 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
These devices contain a Serial Interface Module, which includes both the four line SPI interface or
the two line I
C interface types, to allow an easy method of communication with external peripheral
2
hardware. Having relatively simple communication protocols, these serial interface types allow
the microcontroller to interface to external SPI or I
EEPROM memory, etc. The SIM interface pins are pin-shared with other I/O pins therefore the SIM
interface function must first be selected using a configuration option. As both interface types share
the same pins and registers, the choice of whether the SPI or I
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, and also if the SIM function is
enabled.
SPI Interface
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 these devices provided 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.
Rev. 1.40
HT66F20-1/HT66F30-1/HT68F20-1/HT68F30-1
Flash MCU with EEPROM
C based hardware such as sensors, Flash or
2
144
C type is used is made using the SIM
2
�ove��e� ��� �01�
Need help?
Do you have a question about the HT66F20-1 and is the answer not in the manual?
Questions and answers