SN32F280 Series
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 102
Version 1.1
8.2.2 CMnOUT, CMnG AND CMnIF
The CMnOUT and CMnIF bits indicate the comparator result. The CMnOUT shows the comparator result immediately,
but the CMnIF only indicates the event condition of the comparator result.
Comparator n compares positive terminal’s voltage and negative terminal’s voltage, and then output result to output pin.
When V+ > V-, comparator outputs high status. When V+ < V-, comparator outputs low status.
Take Comparator 1 as example,
CM1P
CM1N
CM1OUT
The event condition is controlled by register and includes rising edge (CMnOUT changes from low to high), or falling
edge (CMnOUT changes from high to low), controlled by CMnG bit. When CMnG= 0, the comparator n interrupt trigger
direction is falling edge. When CMnG= 1, the comparator n interrupt trigger direction is rising edge. When comparator
output edge event occurs and equal CMnG condition, CMnIF flag is issued. If CMnIE= 1, program counter points to
interrupt vector to execute interrupt service routine.
Note:
CMnOUT is comparator raw output without latch. It varies depend on the comparator process
result. But the CMnIF is latch comparator output result. It must be cleared by program.
Take Comparator 1 as example,
CM1OUT
CM1IF, CM1G=0 (Falling edge)
CM1IF, CM1G=1 (Rising edge)
CM1IF sets as falling edge.
CM1IF sets as falling edge.
CM1IF sets as rising edge.
CM1IF sets as rising edge.
*. CM1IF is cleared by program.
Содержание SN32F280 Series
Страница 222: ...SN32F280 Series 32 Bit Cortex M0 Micro Controller SONiX TECHNOLOGY CO LTD Page 222 Version 1 1 A1D16...
Страница 263: ...SN32F280 Series 32 Bit Cortex M0 Micro Controller SONiX TECHNOLOGY CO LTD Page 263 Version 1 1 26 2 LQFP 64 PIN...
Страница 264: ...SN32F280 Series 32 Bit Cortex M0 Micro Controller SONiX TECHNOLOGY CO LTD Page 264 Version 1 1 26 3 LQFP 48 PIN...