PIC16F887-E/P Microchip Technology Inc., PIC16F887-E/P Datasheet - Page 93

no-image

PIC16F887-E/P

Manufacturer Part Number
PIC16F887-E/P
Description
40 PIN, 14KB FLASH, 368 RAM, 36 I/O, PDIP
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC16F887-E/P

A/d Inputs
14-Channel, 10-Bit
Comparators
2
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Frequency
20 MHz
Input Output
35
Interface
I2C/SPI/USART
Memory Type
Flash
Number Of Bits
8
Package Type
40-pin PDIP
Programmable Memory
14K Bytes
Ram Size
368 Bytes
Resistance, Drain To Source On
Bytes
Serial Interface
MSSP or EUSART
Speed
20 MHz
Timers
2-8-bit, 1-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F887-E/P
Manufacturer:
TI
Quantity:
12 000
Part Number:
PIC16F887-E/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
8.8
There are three additional comparator features:
• Timer1 count enable (gate)
• Synchronizing output with Timer1
• Simultaneous read of comparator outputs
8.8.1
This feature can be used to time the duration or interval
of analog events. Clearing the T1GSS bit of the
CM2CON1 register will enable Timer1 to increment
based on the output of Comparator C2. This requires
that Timer1 is on and gating is enabled. See
Section 6.0 “Timer1 Module with Gate Control” for
details.
It is recommended to synchronize the comparator with
Timer1 by setting the C2SYNC bit when the comparator
is used as the Timer1 gate source. This ensures Timer1
does not miss an increment if the comparator changes
during an increment.
REGISTER 8-3:
© 2008 Microchip Technology Inc.
bit 7
Legend:
R = Readable bit
-n = Value at POR
bit 7
bit 6
bit 5
bit 4
bit 3-2
bit 1
bit 0
MC1OUT
R-0
Additional Comparator Features
COMPARATOR C2 GATING TIMER1
MC1OUT: Mirror Copy of C1OUT bit
MC2OUT: Mirror Copy of C2OUT bit
C1RSEL: Comparator C1 Reference Select bit
1 = CVREF routed to C1VREF input of Comparator C1
0 = Absolute voltage reference (0.6) routed to C1VREF input of Comparator C1 (or 1.2V precision
C2RSEL: Comparator C2 Reference Select bit
1 = CVREF routed to C2VREF input of Comparator C2
0 = Absolute voltage reference (0.6) routed to C2VREF input of Comparator C2 (or 1.2V precision
Unimplemented: Read as ‘0’
T1GSS: Timer1 Gate Source Select bit
1 = Timer1 gate source is T1G
0 = Timer1 gate source is SYNCC2OUT.
C2SYNC: Comparator C2 Output Synchronization bit
1 = Output is synchronous to falling edge of Timer1 clock
0 = Output is asynchronous
MC2OUT
reference on parts so equipped)
reference on parts so equipped)
R-0
CM2CON1: COMPARATOR C2 CONTROL REGISTER 1
W = Writable bit
‘1’ = Bit is set
C1RSEL
R/W-0
PIC16F882/883/884/886/887
C2RSEL
R/W-0
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
8.8.2
The Comparator C2 output can be synchronized with
Timer1 by setting the C2SYNC bit of the CM2CON1
register. When enabled, the C2 output is latched on the
falling edge of the Timer1 clock source. If a prescaler is
used with Timer1, the comparator output is latched after
the prescaling function. To prevent a race condition, the
comparator output is latched on the falling edge of the
Timer1 clock source and Timer1 increments on the
rising edge of its clock source. See the Comparator
Block Diagram (Figures 8-2 and 8-3) and the Timer1
Block Diagram (Figure 6-1) for more information.
8.8.3
The MC1OUT and MC2OUT bits of the CM2CON1
register are mirror copies of both comparator outputs.
The ability to read both outputs simultaneously from a
single register eliminates the timing skew of reading
separate registers.
U-0
Note 1: Obtaining the status of C1OUT or C2OUT
SYNCHRONIZING COMPARATOR
C2 OUTPUT TO TIMER1
SIMULTANEOUS COMPARATOR
OUTPUT READ
by reading CM2CON1 does not affect the
comparator interrupt mismatch registers.
U-0
x = Bit is unknown
T1GSS
R/W-1
DS41291E-page 91
C2SYNC
R/W-0
bit 0

Related parts for PIC16F887-E/P