PIC18F24 MICROCHIP [Microchip Technology], PIC18F24 Datasheet - Page 131

no-image

PIC18F24

Manufacturer Part Number
PIC18F24
Description
28/40-Pin High-Performance, Enhanced Flash Microcontrollers with CAN Module
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F2410-E/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410-I/ML
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410-I/S0
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410-I/SP
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2410T-I/ML
Manufacturer:
MIC
Quantity:
1 831
Part Number:
PIC18F242-E/SP
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F242-I/SO
Manufacturer:
SKYWORKSS
Quantity:
101
Company:
Part Number:
PIC18F242-I/SO
Quantity:
9
Company:
Part Number:
PIC18F242-I/SP
Quantity:
14
Part Number:
PIC18F2420-I/SO
Manufacturer:
MICROCHIP
Quantity:
1 560
Part Number:
PIC18F2420-I/SO
0
Part Number:
PIC18F2423-I/SP
Manufacturer:
MICROCHIP
Quantity:
1 290
The maximum PWM resolution (bits) for a given PWM
frequency is given by the following equation.
EQUATION 15-3:
TABLE 15-4:
TABLE 15-5:
 2004 Microchip Technology Inc.
INTCON
PIR1
PIE1
IPR1
TRISD
TMR2
PR2
T2CON
CCPR1L
CCPR1H
CCP1CON
Legend:
Note 1:
Timer Prescaler (1, 4, 16)
PR2 Value
Maximum Resolution (bits)
Note:
Name
PWM Resolution (max)
PWM Frequency
x = unknown, u = unchanged, - = unimplemented, read as ‘0’. Shaded cells are not used by PWM and Timer2.
These registers or register bits are not implemented on the PIC18F248 and PIC18F258 and read as ‘0’s.
If the PWM duty cycle value is longer than
the PWM period, the CCP1 pin will not be
cleared.
PORTD Data Direction Register
Timer2 Module Register
Timer2 Module Period Register
Capture/Compare/PWM Register1 (LSB)
Capture/Compare/PWM Register1 (MSB)
PSPIF
PSPIE
PSPIP
GIEH
Bit 7
GIE/
EXAMPLE PWM FREQUENCIES AND RESOLUTIONS AT 40 MHz
REGISTERS ASSOCIATED WITH PWM AND TIMER2
(1)
(1)
(1)
TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
PEIE/
ADIE
ADIP
Bit 6
GIEL
ADIF
=
log
-----------------------------bits
log
TMR0IE
DC1B1
RCIE
RCIP
---------------
F
RCIF
Bit 5
F
PWM
OSC
2
2.44 kHz
0FFh
16
10
DC1B0
INT0IE
Bit 4
TXIF
TXIE
TXIP
9.76 kHz
CCP1M3
0FFh
SSPIF
SSPIE
SSPIP
RBIE
Bit 3
10
4
15.4.3
The following steps should be taken when configuring
the CCP module for PWM operation:
1.
2.
3.
4.
5.
CCP1M2
TMR0IF
CCP1IF
CCP1IE
CCP1IP
39.06 kHz
Bit 2
0FFh
Set the PWM period by writing to the PR2
register.
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
TRISC<2> bit.
Set the TMR2 prescale value and enable Timer2
by writing to T2CON.
Configure the CCP1 module for PWM operation.
10
1
CCP1M1
TMR2IE
TMR2IP
TMR2IF
SETUP FOR PWM OPERATION
INT0IF
Bit 1
156.3 kHz
3Fh
1
8
CCP1M0 --00 0000 --00 0000
TMR1IE
TMR1IP
TMR1IF
Bit 0
RBIF
PIC18FXX8
312.5 kHz
0000 000x 0000 000u
0000 0000 0000 0000
0000 0000 0000 0000
1111 1111 1111 1111
1111 1111 1111 1111
0000 0000 0000 0000
1111 1111 1111 1111
xxxx xxxx uuuu uuuu
xxxx xxxx uuuu uuuu
1Fh
POR, BOR
Value on
1
7
DS41159D-page 129
416.6 kHz
Value on
all other
Resets
17h
5.5
1

Related parts for PIC18F24