PIC16F916-I/SP Microchip Technology Inc., PIC16F916-I/SP Datasheet - Page 99
![no-image](/images/manufacturer_photos/0/4/440/microchip_technology_inc__sml.jpg)
PIC16F916-I/SP
Manufacturer Part Number
PIC16F916-I/SP
Description
28 PIN, 14 KB FLASH, 352 RAM, 25 I/O
Manufacturer
Microchip Technology Inc.
Datasheet
1.PIC16F916-ISP.pdf
(272 pages)
Specifications of PIC16F916-I/SP
A/d Inputs
5-Channel, 10-Bit
Comparators
2
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Input Output
25
Interface
I2C/SPI/USART
Memory Type
Flash
Number Of Bits
8
Package Type
28-pin SPDIP
Programmable Memory
14K Bytes
Ram Size
352 Bytes
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
Company:
Part Number:
PIC16F916-I/SP
Manufacturer:
Microchip Technology
Quantity:
1 800
Company:
Part Number:
PIC16F916-I/SP
Manufacturer:
JST
Quantity:
4 300
- Current page: 99 of 272
- Download datasheet (5Mb)
REGISTER 8-2:
8.4
The comparator outputs are read through the
CMCON0 register. These bits are read-only. The
RA4 and RA5 I/O pins. When enabled, multiplexers in
the output path of the RA4 and RA5 pins will switch
and the output of each pin will be the unsynchronized
output of the comparator. The uncertainty of each of
the comparators is related to the input offset voltage
and the response time given in the specifications.
Figure 8-4 and Figure 8-5 show the output block
The TRIS bits will still function as an output
enable/disable for the RA4 and RA5 pins while in this
mode.
The polarity of the comparator outputs can be changed
using the C1INV and C2INV bits (CMCON0<5:4>).
Timer1 gate source can be configured to use the T1G
pin or Comparator 2 output as selected by the T1GSS
bit (CMCON1<1>). This feature can be used to time
the duration or interval of analog events. The output of
Comparator 2 can also be synchronized with Timer1
by setting the C2SYNC bit (CMCON1<0>). When
enabled, the output of Comparator 2 is latched on the
falling edge of Timer1 clock source. If a prescaler is
used with Timer1, Comparator 2 is latched after the
prescaler. To prevent a race condition, the Comparator
2 output is latched on the falling edge of the Timer1
clock source and Timer1 increments on the rising edge
of its clock source. See (Figure 8-5), Comparator 2
Block Diagram and (Figure 6-1), Timer1 Block
Diagram for more information.
It is recommended to synchronize Comparator 2 with
Timer1 by setting the C2SYNC bit when Comparator 2
is used as the Timer1 gate source. This ensures Timer1
does not miss an increment if Comparator 2 changes
during an increment.
© 2005 Microchip Technology Inc.
comparator outputs may also be directly output to the
diagram for Comparator 1 and 2.
Comparator Outputs
bit 7-2:
bit 1
bit 0
CMCON1 – COMPARATOR CONFIGURATION REGISTER (ADDRESS: 97h)
Unimplemented: Read as ‘0’
T1GSS: Timer1 Gate Source Select bit
1 = Timer1 gate source is T1G pin (RC4 must be configured as digital input)
0 = Timer1 gate source is Comparator 2 Output
C2SYNC: Comparator 2 Synchronize bit
1 = C2 output synchronized with falling edge of Timer1 clock
0 = C2 output not synchronized with Timer1 clock
Legend:
R = Readable bit
- n = Value at POR
bit 7
U-0
—
U-0
—
U-0
Preliminary
—
W = Writable bit
‘1’ = Bit is set
PIC16F917/916/914/913
U-0
—
8.5
The comparator interrupt flags are set whenever there is
a change in the output value of its respective comparator.
Software will need to maintain information about the
status of the output bits, as read from CMCON0<7:6>, to
determine the actual change that has occurred. The CxIF
bits, PIR2<6:5>, are the Comparator Interrupt flags. This
bit must be reset in software by clearing it to ‘0’. Since it
is also possible to write a ‘1’ to this register, a simulated
interrupt may be initiated.
The CxIE bits (PIE2<6:5>) and the PEIE bit
(INTCON<6>) must be set to enable the interrupts. In
addition, the GIE bit must also be set. If any of these
bits are cleared, the interrupt is not enabled, though the
CxIF bits will still be set if an interrupt condition occurs.
The user, in the Interrupt Service Routine, can clear the
interrupt in the following manner:
a)
b)
A mismatch condition will continue to set flag bit CxIF.
Reading CMCON0 will end the mismatch condition and
allow flag bits CxIF to be cleared.
Note:
Any read or write of CMCON0. This will end the
mismatch condition.
Clear flag bit CxIF
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
Comparator Interrupts
U-0
If a change in the CMCON0 register
(CxOUT) should occur when a read
operation is being executed (start of the Q2
cycle), then the CxIF (PIR2<6:5>) interrupt
flag may not get set.
—
U-0
—
x = Bit is unknown
T1GSS
R/W-1
DS41250E-page 97
C2SYNC
R/W-0
bit 0
Related parts for PIC16F916-I/SP
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![PIC16F916-I/SO](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
28 PIN, 14 KB FLASH, 352 RAM, 25 I/O
Manufacturer:
Microchip Technology Inc.
Datasheet:
![PIC16F1826-I/SO](/photos/6/76/67656/150-18-soic_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 32MHZ, SOIC-18
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1826-I/SS](/photos/6/81/68119/150-28-ssop_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 32MHZ, SSOP-20
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1826-I/P](/images/manufacturer_photos/0/4/439/microchip_technology_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 32MHZ, DIP-18
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1827-I/ML](/photos/6/81/68120/150-28-qfn_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 32MHZ, QFN-28
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1826-I/MV](/photos/12/13/121305/c04-152_mv_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 32MHZ, QFN-28
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1827-I/MV](/photos/12/13/121305/c04-152_mv_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 32MHZ, QFN-28
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1827-I/SS](/photos/6/81/68119/150-28-ssop_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 32MHZ, SSOP-20
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F727-E/P](/photos/6/61/66192/150-40-dip_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 20MHZ, DIP-40
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1827-I/MQ](/photos/18/99/189937/4243194_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 32MHZ, QFN-28
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F874-20/PQ](/photos/6/59/65984/150-44-pqfp_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 20MHZ, MQFP-44
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F690-E/ML](/photos/6/64/66481/c04-126_ml_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 20MHZ, QFN-20
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1826-I/MQ](/images/manufacturer_photos/0/4/439/microchip_technology_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16F, 32MHZ, QFN-28
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1526-I/PT](/photos/16/3/160367/tqfp-64_tmb.jpg)
Part Number:
Description:
MCU 14KB FLASH 768B RAM 64-TQFP
Manufacturer:
Microchip Technology
Datasheet:
![PIC16F1827-E/MQ](/images/manufacturer_photos/0/4/439/microchip_technology_tmb.jpg)
Part Number:
Description:
7 KB Flash, 384 Bytes RAM, 32 MHz Int. Osc, 16 I/0, Enhanced Mid Range Core, Low
Manufacturer:
Microchip Technology