PIC18F258 MICROCHIP [Microchip Technology], PIC18F258 Datasheet - Page 129

no-image

PIC18F258

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

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F258-E/SO
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F258-I/P
Manufacturer:
ST
Quantity:
320
Part Number:
PIC18F258-I/SO
Manufacturer:
MICROCHIP
Quantity:
2 000
Part Number:
PIC18F258-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2580
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F2580-E/ML
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F2580-E/SO
Manufacturer:
Microchi
Quantity:
2 952
Part Number:
PIC18F2580-E/SP
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F2580-I/SO
Manufacturer:
MICRO
Quantity:
10
Part Number:
PIC18F2580-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2580-I/SO
0
Part Number:
PIC18F2585-I/SO
Quantity:
2
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:
 2002 Microchip Technology Inc.
INTCON
PIR1
PIE1
IPR1
TRISD
TMR2
PR2
T2CON
CCPR1L
CCPR1H
CCP1CON
Legend:
Timer Prescaler (1, 4, 16)
PR2 Value
Maximum Resolution (bits)
Note:
Name
PWM Resolution (max)
x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used by PWM and Timer2.
PWM Frequency
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
TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
PEIE/
GIEL
ADIF
ADIE
ADIP
Bit 6
=
log
-----------------------------bits
log
---------------
F
F
TMR0IE
DC1B1
PWM
2 ( )
RCIE
RCIP
OSC
RCIF
Bit 5
2.44 kHz
FFh
16
10
DC1B0
INT0IE
TXIE
TXIP
Bit 4
TXIF
Preliminary
9.76 kHz
FFh
10
CCP1M3
4
SSPIF
SSPIE
SSPIP
RBIE
Bit 3
15.4.3
The following steps should be taken when configuring
the CCP module for PWM operation:
1.
2.
3.
4.
5.
39.06 kHz
CCP1M2
TMR0IF
CCP1IE
CCP1IP
CCP1IF
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.
FFh
Bit 2
10
1
SETUP FOR PWM OPERATION
CCP1M1
TMR2IF
TMR2IE
TMR2IP
INT0IF
Bit 1
156.3 kHz
3Fh
1
8
CCP1M0 --00 0000 --00 0000
TMR1IF
TMR1IE
TMR1IP
PIC18FXX8
RBIF
Bit 0
312.5 kHz
1Fh
1
7
0000 000x 0000 000u
0000 0000 0000 0000
0000 0000 0000 0000
0000 0000 0000 0000
1111 1111 1111 1111
0000 0000 0000 0000
1111 1111 1111 1111
xxxx xxxx uuuu uuuu
xxxx xxxx uuuu uuuu
POR, BOR
Value on
DS41159B-page 127
416.6 kHz
17h
5.5
Value on
RESETS
all other
1

Related parts for PIC18F258