PIC16F627-04 Microchip Technology, PIC16F627-04 Datasheet - Page 67
![no-image](/images/manufacturer_photos/0/4/439/microchip_technology_sml.jpg)
PIC16F627-04
Manufacturer Part Number
PIC16F627-04
Description
FLASH-Based 8-Bit CMOS Microcontrollers
Manufacturer
Microchip Technology
Datasheet
1.PIC16F627-04.pdf
(160 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F627-04/P
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Company:
Part Number:
PIC16F627-04/SO
Manufacturer:
MIC
Quantity:
933
Part Number:
PIC16F627-04/SO
Manufacturer:
MICROCHI
Quantity:
20 000
Company:
Part Number:
PIC16F627-04/SS
Manufacturer:
MICROCHIP
Quantity:
13
Part Number:
PIC16F627-04/SS
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16F627-04I/P
Manufacturer:
MICR
Quantity:
20 000
Part Number:
PIC16F627-04I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
10.3.3
The following steps should be taken when configuring
the CCP module for PWM operation:
1.
2.
3.
4.
5.
TABLE 10-3
TABLE 10-4
Legend:
Timer Prescaler (1, 4, 16)
PR2 Value
Maximum Resolution (bits)
10Bh/18Bh
0Bh/8Bh/
Address
1999 Microchip Technology Inc.
0Ch
8Ch
87h
11h
92h
12h
15h
16h
17h
Set the PWM period by writing to the PR2 regis-
ter.
Set the PWM duty cycle by writing to the
CCPR1L register and CCP1CON<5:4> bits.
Make the CCP1 pin an output by clearing the
TRISB<3> bit.
Set the TMR2 prescale value and enable Timer2
by writing to T2CON.
Configure the CCP1 module for PWM operation.
SET-UP FOR PWM OPERATION
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by PWM and Timer2.
CCP1CON
CCPR1H Capture/Compare/PWM register1 (MSB)
CCPR1L
INTCON
T2CON
PWM Frequency
TRISB
Name
TMR2
PIR1
PIE1
PR2
EXAMPLE PWM FREQUENCIES AND RESOLUTIONS AT 20 MHz
REGISTERS ASSOCIATED WITH PWM AND TIMER2
PORTB Data Direction Register
Timer2 module’s register
Timer2 module’s period register
Capture/Compare/PWM register1 (LSB)
EEIF
EEIE
Bit 7
GIE
—
—
TOUTPS
CMIF
CMIE
PEIE
Bit 6
—
3
TOUTPS
CCP1X
RCIE
RCIF
Bit 5
T0IE
2
16
0xFF
10
1.22 kHz 4.88 kHz 19.53 kHz 78.12 kHz 156.3 kHz 208.3 kHz
TOUTPS
Preliminary
CCP1Y
INTE
TXIF
TXIE
Bit 4
1
4
0xFF
10
TOUTPS
CCP1M3 CCP1M2 CCP1M1 CCP1M0
RBIE
Bit 3
—
—
0
1
0xFF
10
TMR2ON T2CKPS
CCP1IF
CCP1IE
Bit 2
T0IF
TMR2IF
TMR2IE
8
1
0x3F
INTF
Bit 1
1
PIC16F62X
T2CKPS
TMR1IF
TMR1IE
RBIF
Bit 0
0x1F
7
1
0
0000 000x
0000 -000
0000 -000
1111 1111
0000 0000
1111 1111
-000 0000
xxxx xxxx
xxxx xxxx
--00 0000
DS40300B-page 67
Value on
POR
1
0x17
5.5
0000 000u
0000 -000
0000 -000
1111 1111
0000 0000
1111 1111
uuuu uuuu
uuuu uuuu
uuuu uuuu
--00 0000
Value on
all other
resets