PIC18F2480 MICROCHIP [Microchip Technology], PIC18F2480 Datasheet - Page 187

no-image

PIC18F2480

Manufacturer Part Number
PIC18F2480
Description
28/40/44-Pin Enhanced Flash Microcontrollers with ECAN Technology, 10-Bit A/D and nanoWatt Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F2480-E/ML
Manufacturer:
MICROCHIP
Quantity:
1 001
Part Number:
PIC18F2480-E/SO
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F2480-I/SO
Manufacturer:
Microchi
Quantity:
9 999
Part Number:
PIC18F2480-I/SO
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F2480-I/SO
0
Part Number:
PIC18F2480-I/SP
Manufacturer:
TDK
Quantity:
64
Part Number:
PIC18F2480-I/SP
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
16.4.9
The following steps should be taken when configuring
the ECCP module for PWM operation:
1.
2.
3.
4.
5.
6.
7.
8.
9.
 2004 Microchip Technology Inc.
Configure the PWM pins P1A and P1B (and
P1C and P1D, if used) as inputs by setting the
corresponding TRIS bits.
Set the PWM period by loading the PR2 register.
Configure the ECCP1 module for the desired
PWM mode and configuration by loading the
ECCP1CON register with the appropriate
values:
• Select one of the available output
• Select the polarities of the PWM output
Set the PWM duty cycle by loading the
ECCPR1L register and ECCP1CON<5:4> bits.
For
dead-band delay by loading ECCP1DEL<6:0>
with the appropriate value.
If auto-shutdown operation is required, load the
ECCP1AS register:
• Select the auto-shutdown sources using the
• Select the shutdown states of the PWM
• Set the ECCPASE bit (ECCP1AS<7>).
• Configure the comparators using the CMCON
• Configure the comparator inputs as analog
If auto-restart operation is required, set the
PRSEN bit (ECCP1DEL<7>).
Configure and start TMR2:
• Clear the TMR2 interrupt flag bit by clearing
• Set the TMR2 prescale value by loading the
• Enable Timer2 by setting the TMR2ON bit
Enable PWM outputs after a new PWM cycle
has started:
• Wait until TMRn overflows (TMRnIF bit is set).
• Enable the ECCP1/P1A, P1B, P1C and/or
• Clear the ECCPASE bit (ECCP1AS<7>).
configurations and direction with the
EPWM1M1:EPWM1M0 bits.
signals with the ECCP1M3:ECCP1M0 bits.
ECCPAS2:ECCPAS0 bits.
output pins using PSSAC1:PSSAC0 and
PSSBD1:PSSBD0 bits.
register.
inputs.
the TMR2IF bit (PIR1<1>).
T2CKPS bits (T2CON<1:0>).
(T2CON<2>).
P1D pin outputs by clearing the respective
TRIS bits.
Half-Bridge
SETUP FOR PWM OPERATION
Output
mode,
set
PIC18F2480/2580/4480/4580
the
Preliminary
16.4.10
Both Power-on Reset and subsequent Resets will force
all ports to Input mode and the CCP registers to their
Reset states.
This forces the Enhanced CCP module to reset to a
state compatible with the standard CCP module.
EFFECTS OF A RESET
DS39637A-page 185

Related parts for PIC18F2480