Interrupts And Wakeup; Figure 37. Comparator Interrupt Signals; Figure 38. Comparator Wakeup Signals - Holtek HT32F54231 User Manual

Table of Contents

Advertisement

32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253

Interrupts and Wakeup

The comparator can generate an interrupt when its output waveform generates a rising or falling
edge and its corresponding interrupt enable control bit is also set.
For example, when a comparator output rising edge occurs, the comparator rising edge flag bit
CMPRF in the Comparator Transition Flag Register CMPTFRn will be set. If the comparator
output rising edge interrupt enable control bit CMPRIEN in the Comparator Interrupt Enable
Register CMPIERn is enabled, an interrupt will then be generated and sent to the NVIC unit.
Writing "1" into the comparator rising edge flag bit CMPRF in the Comparator Transition Flag
Register CMPTFRn will clear the CMPRF bit. The comparator output falling edge interrupt also
has the same corresponding interrupt setting. A block diagram of interrupt signals for comparators
is shown in the following figure.
CMP0
CMP1

Figure 37. Comparator Interrupt Signals

The comparator outputs are also internally connected to the EXTI Wakeup Event Management unit.
The comparator output rising transition is used to wake up the MCU from the Sleep, Deep-Sleep1
or Deep-Sleep2 mode when the comparator wakeup enable bit CMPWPEN is set in the Comparator
Control Register CMPCRn. A block diagram of wakeup signals for comparators is shown in the
following figure.
CMP0
CMP1

Figure 38. Comparator Wakeup Signals

Rev. 1.00
CMPRF
CMPRIEN
CMPFF
CMPFIEN
CMPRF
CMPRIEN
CMPFF
CMPFIEN
CMPWPEN
CMPOUT
CMPWPEN
CMPOUT
216 of 576
NVIC CMP Interrupt
EXTI
CMP_WAKEUP
January 28, 2022

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the HT32F54231 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Ht32f54241Ht32f54243Ht32f54253

Table of Contents