Freelance Electronics Components Distributor
Closed Dec 25th-26th
800-300-1968
We Stock Hard to Find Parts

C8051F041-GQ

Part # C8051F041-GQ
Description MCU 8BIT CISC 64KB FLASH 3V 64TQFP - Trays
Category IC
Availability In Stock
Qty 2
Qty Price
1 + $20.05559
Manufacturer Available Qty
SILICON LABORATORIES
Date Code: 0903
  • Shipping Freelance Stock: 2
    Ships Immediately



Technical Document


DISCLAIMER: The information provided herein is solely for informational purposes. Customers must be aware of the suitability of this product for their application, and consider that variable factors such as Manufacturer, Product Category, Date Codes, Pictures and Descriptions may differ from available inventory.

C8051F040/1/2/3/4/5/6/7
Rev. 1.5 121
11. Comparators
C8051F04x family of devices include three on-chip programmable voltage comparators, shown in
Figure 11.1. Each comparator offers programmable response time and hysteresis. When assigned to a
Port pin, the Comparator output may be configured as open drain or push-pull, and Comparator inputs
should be configured as analog inputs (see Section “17.1.5. Configuring Port 1, 2, and 3 Pins as Ana-
log Inputs” on page 207). The Comparator may also be used as a reset source (see Section
“13.5. Comparator0 Reset” on page 167).
The output of a Comparator can be polled by software, used as an interrupt source, used as a reset
source, and/or routed to a Port pin. Each comparator can be individually enabled and disabled (shutdown).
When disabled, the Comparator output (if assigned to a Port I/O pin via the Crossbar) defaults to the logic
low state, and its supply current falls to less than 1 µA. See Section “17.1.1. Crossbar Pin Assignment
and Allocation” on page 205 for details on configuring the Comparator output via the digital Crossbar.
The Comparator inputs can be externally driven from -0.25 V to (V
DD
) + 0.25 V without damage or upset.
The complete electrical specifications for the Comparator are given in Table 11.1.
The Comparator response time may be configured in software using the CPnMD1-0 bits in register CPT-
nMD (see SFR Definition 11.2). Selecting a longer response time reduces the amount of power consumed
by the comparator. See Table 11.1 for complete timing and current consumption specifications.
Figure 11.1. Comparator Functional Block Diagram
VDD
CPTnCN
Reset
Decision
Tree
+
-
Crossbar
Interrupt
Logic
Q
Q
SET
CLR
D
Q
Q
SET
CLR
D
(SYNCHRONIZER)
CPn +
CPn -
CPnEN
CPnOUT
CPnRIF
CPnFIF
CPnHYP1
CPnHYP0
CPnHYN1
CPnHYN0
CPTnMD
CPnRIEN
CPnFIEN
CPnMD1
CPnMD0
CPn
Rising-edge
Interrupt Flag
CPn
Falling-edge
Interrupt Flag
CPn
CP0 +
CP0 -
CP1 +
CP1 -
CP2 +
CP2 -
P2.6
P2.7
P2.2
P2.3
P2.4
P2.5
Comparator Pin Assignments
GND
CPn
Interrupt
C8051F040/1/2/3/4/5/6/7
122 Rev. 1.5
Figure 11.2. Comparator Hysteresis Plot
The hysteresis of the Comparator is software-programmable via its Comparator Control register (CPT-
nCN). The user can program both the amount of hysteresis voltage (referred to the input voltage) and the
positive and negative-going symmetry of this hysteresis around the threshold voltage.
The Comparator hysteresis is programmed using Bits3-0 in the Comparator Control Register CPTnCN
(shown in SFR Definition 11.1). The amount of negative hysteresis voltage is determined by the settings of
the CPnHYN bits. As shown in Table 11.1, settings of approximately 20, 10 or 5 mV of negative hysteresis
can be programmed, or negative hysteresis can be disabled. In a similar way, the amount of positive hys-
teresis is determined by the setting the CPnHYP bits.
Comparator interrupts can be generated on either rising-edge and falling-edge output transitions. (For
Interrupt enable and priority control, see Section “12.3. Interrupt Handler” on page 153). The rising and/
or falling -edge interrupts are enabled using the comparator’s Rising/Falling Edge Interrupt Enable Bits
(CPnRIE and CPnFIE) in their respective Comparator Mode Selection Register (CPTnMD), shown in SFR
Definition 11.2. These bits allow the user to control which edge (or both) will cause a comparator interrupt.
However, the comparator interrupt must also be enabled in the Extended Interrupt Enable Register (EIE1).
The CPnFIF flag is set to logic 1 upon a Comparator falling-edge interrupt, and the CPnRIF flag is set to
logic 1 upon the Comparator rising-edge interrupt. Once set, these bits remain set until cleared by soft-
ware. The output state of a Comparator can be obtained at any time by reading the CPnOUT bit. A Com-
parator is enabled by setting its respective CPnEN bit to logic 1, and is disabled by clearing this bit to logic
0.Upon enabling a comparator, the output of the comparator is not immediately valid. Before using a com-
parator as an interrupt or reset source, software should wait for a minimum of the specified “Power-up
time” as specified in Table 11.1, “Comparator Electrical Characteristics,” on page 126.
Positive Hysteresis Voltage
(Programmed with CPnHYP Bits)
Negative Hysteresis Voltage
(Programmed by CPnHYN Bits)
VIN-
VIN+
INPUTS
CIRCUIT CONFIGURATION
+
_
CPn+
CPn-
CPn
VIN+
VIN-
OUT
V
OH
Positive Hysteresis
Disabled
Maximum
Positive Hysteresis
Negative Hysteresis
Disabled
Maximum
Negative Hysteresis
OUTPUT
V
OL
C8051F040/1/2/3/4/5/6/7
Rev. 1.5 123
11.1. Comparator Inputs
The Port pins selected as comparator inputs should be configured as analog inputs in the Port 2 Input Con-
figuration Register (for details on Port configuration, see Section “17.1.3. Configuring Port Pins as Digi-
tal Inputs” on page 206). The inputs for Comparator are on Port 2 as follows:
Comparator Input Port PIN
CP0+ P2.6
CP0– P2.7
CP1+ P2.2
CP1– P2.3
CP2+ P2.4
CP2– P2.5
PREVIOUS3435363738394041424344454647NEXT