PIC18F4520-I/P Microchip Technology Inc., PIC18F4520-I/P Datasheet - Page 161

no-image

PIC18F4520-I/P

Manufacturer Part Number
PIC18F4520-I/P
Description
40 Pin, 32 KB Flash, 1536 RAM, 36 I/O
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC18F4520-I/P

A/d Inputs
13-Channel, 10-Bit
Comparators
2
Cpu Speed
10 MIPS
Eeprom Memory
256 Bytes
Input Output
36
Interface
I2C/SPI/USART
Memory Type
Flash
Number Of Bits
8
Package Type
40-pin PDIP
Programmable Memory
32K Bytes
Ram Size
1.5K Bytes
Speed
40 MHz
Timers
1-8-bit, 3-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F4520-I/P
Manufacturer:
ST
Quantity:
104
Part Number:
PIC18F4520-I/P
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC18F4520-I/PT
Manufacturer:
TI
Quantity:
14 300
Part Number:
PIC18F4520-I/PT
Manufacturer:
Microchip Technology
Quantity:
33 055
Part Number:
PIC18F4520-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC18F4520-I/PT
Manufacturer:
MICROCHIP
Quantity:
510
Part Number:
PIC18F4520-I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F4520-I/PT
0
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.
10. Enable PWM outputs after a new PWM cycle
 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.
If auto-shutdown is required:
• Disable auto-shutdown (ECCP1AS = 0)
• Configure source (FLT0, Comparator 1 or
• Wait for non-shutdown condition
Configure the ECCP module for the desired
PWM mode and configuration by loading the
CCP1CON 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 CCPR1L
register and CCP1CON<5:4> bits.
For Half-Bridge Output mode, set the dead-
band delay by loading PWM1CON<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 (PWM1CON<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
has started:
• Wait until TMRn overflows (TMRnIF bit is set).
• Enable the CCP1/P1A, P1B, P1C and/or P1D
• Clear the ECCPASE bit (ECCP1AS<7>).
Comparator 2)
configurations and direction with the
P1M1:P1M0 bits.
signals with the CCP1M3:CCP1M0 bits.
ECCPAS2:ECCPAS0 bits.
output pins using the PSSAC1:PSSAC0 and
PSSBD1:PSSBD0 bits.
register.
inputs.
the TMR2IF bit (PIR1<1>).
T2CKPS bits (T2CON<1:0>).
(T2CON<2>).
pin outputs by clearing the respective TRIS
bits.
SETUP FOR PWM OPERATION
PIC18F2420/2520/4420/4520
Preliminary
16.4.10
In Sleep mode, all clock sources are disabled. Timer2
will not increment and the state of the module will not
change. If the ECCP pin is driving a value, it will con-
tinue to drive that value. When the device wakes up, it
will continue from this state. If Two-Speed Start-ups are
enabled, the initial start-up frequency from INTOSC
and the postscaler may not be stable immediately.
In PRI_IDLE mode, the primary clock will continue to
clock the ECCP module without change. In all other
power managed modes, the selected power managed
mode clock will clock Timer2. Other power managed
mode clocks will most likely be different than the
primary clock frequency.
16.4.10.1
If the Fail-Safe Clock Monitor is enabled, a clock failure
will force the device into the RC_RUN Power Managed
mode and the OSCFIF bit (PIR2<7>) will be set. The
ECCP will then be clocked from the internal oscillator
clock source, which may have a different clock
frequency than the primary clock.
See the previous section for additional details.
16.4.11
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.
OPERATION IN POWER MANAGED
MODES
EFFECTS OF A RESET
Operation with Fail-Safe
Clock Monitor
DS39631A-page 159

Related parts for PIC18F4520-I/P