PIC12F1822 MICROCHIP [Microchip Technology], PIC12F1822 Datasheet - Page 202

no-image

PIC12F1822

Manufacturer Part Number
PIC12F1822
Description
8/14-Pin Flash Microcontrollers with nanoWatt XLP Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC12F1822-E/SN
Manufacturer:
ABILIS
Quantity:
15 400
Part Number:
PIC12F1822-E/SN
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822-E/SN
0
Part Number:
PIC12F1822-I/MF
Manufacturer:
ALLEGRO
Quantity:
1 001
Part Number:
PIC12F1822-I/MF
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822-I/P
Manufacturer:
MICROCHIP
Quantity:
1 200
Part Number:
PIC12F1822-I/P
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822-I/SN
Manufacturer:
MICROCHIP
Quantity:
4 500
Part Number:
PIC12F1822-I/SN
Manufacturer:
MICROCHI
Quantity:
1 700
Part Number:
PIC12F1822-I/SN
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822-I/SN
0
Company:
Part Number:
PIC12F1822-I/SN
Quantity:
30 000
Part Number:
PIC12F1822T-I/MF
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822T-I/SN
0
PIC12F/LF1822/16F/LF1823
23.2
Compare mode makes use of the 16-bit Timer1
resource. The 16-bit value of the CCPR1H:CCPR1L
register pair is constantly compared against the 16-bit
value of the TMR1H:TMR1L register pair. When a
match occurs, one of the following events can occur:
• Toggle the CCP1 output
• Set the CCP1 output
• Clear the CCP1 output
• Generate a Special Event Trigger
• Generate a Software Interrupt
The action on the pin is based on the value of the
CCP1M<3:0> control bits of the CCP1CON register. At
the same time, the interrupt flag CCP1IF bit is set.
All Compare modes can generate an interrupt.
Figure 23-2 shows a simplified diagram of the
Compare operation.
FIGURE 23-2:
23.2.1
The user must configure the CCP1 pin as an output by
clearing the associated TRIS bit.
Also, the CCP1 pin function may be moved to
alternative pins using the APFCON register. Refer to
Section 12.1 “Alternate Pin Function” for more
details.
DS41413A-page 202
Special Event Trigger will:
• CCP1: Reset Timer1, but not set interrupt flag bit TMR1IF
Note:
CCP1
Pin
and set bit GO/DONE (ADCON0<1>).
Output Enable
TRIS
Compare Mode
CCP1 PIN CONFIGURATION
Clearing the CCP1CON register will force
the CCP1 compare output latch to the
default low level. This is not the PORT I/O
data latch.
Q
Special Event Trigger
CCP1M<3:0>
R
S
Mode Select
Output
COMPARE MODE
OPERATION BLOCK
DIAGRAM
Logic
Set CCP1IF Interrupt Flag
4
(PIR1)
Match
CCPR1H CCPR1L
TMR1H
Comparator
TMR1L
Preliminary
23.2.2
In Compare mode, Timer1 must be running in either
Timer mode or Synchronized Counter mode. The
compare operation may not work in Asynchronous
Counter mode.
See Section 20.0 “Timer1 Module with Gate Control”
for more information on configuring Timer1.
23.2.3
When Generate Software Interrupt mode is chosen
(CCP1M<3:0> = 1010), the CCP1 module does not
assert control of the CCP1 pin (see the CCP1CON
register).
23.2.4
When Special Event Trigger mode is chosen
(CCP1M<3:0> = 1011), the CCP1 module does the
following:
• Resets Timer1
• Starts an ADC conversion if ADC is enabled
The CCP1 module does not assert control of the CCP1
pin in this mode.
The Special Event Trigger output of the CCP1 occurs
immediately upon a match between the TMR1H,
TMR1L register pair and the CCPR1H, CCPR1L
register pair. The TMR1H, TMR1L register pair is not
reset until the next rising edge of the Timer1 clock. The
Special Event Trigger output starts an A/D conversion
(if the A/D module is enabled). This allows the
CCPR1H, CCPR1L register pair to effectively provide a
16-bit programmable period register for Timer1.
23.2.5
The Compare mode is dependent upon the system
clock (F
down during Sleep mode, the Compare mode will not
function properly during Sleep.
Note:
Note 1: The Special Event Trigger from the CCP1
OSC
2: Removing
TIMER1 MODE RESOURCE
Clocking Timer1 from the system clock
(F
mode. In order for Capture mode to
recognize the trigger event on the CCP1
pin, TImer1 must be clocked from the
instruction clock (F
external clock source.
SOFTWARE INTERRUPT MODE
SPECIAL EVENT TRIGGER
COMPARE DURING SLEEP
) for proper operation. Since F
module does not set interrupt flag bit
TMR1IF of the PIR1 register.
changing the contents of the CCPR1H
and CCPR1L register pair, between the
clock edge that generates the Special
Event Trigger and the clock edge that
generates the Timer1 Reset, will preclude
the Reset from occurring.
OSC
) should not be used in Capture
 2010 Microchip Technology Inc.
the
match
OSC
/4) or from an
condition
OSC
is shut
by

Related parts for PIC12F1822