PIC18F6585-I/L Microchip Technology, PIC18F6585-I/L Datasheet - Page 189

Microcontrollers (MCU) 48KB 3328 RAM 52 I/O

PIC18F6585-I/L

Manufacturer Part Number
PIC18F6585-I/L
Description
Microcontrollers (MCU) 48KB 3328 RAM 52 I/O
Manufacturer
Microchip Technology
Datasheet

Specifications of PIC18F6585-I/L

Processor Series
PIC18F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
3.25 KB
Interface Type
I2C/SPI/AUSART/CAN
Maximum Clock Frequency
40 MHz
Number Of Programmable I/os
53
Number Of Timers
5
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
3rd Party Development Tools
52715-96, 52716-328, 52717-734, 52712-325, EWPIC18
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005, PG164120, ICE2000, ICE4000, DV164136, DM183032
Minimum Operating Temperature
- 40 C
On-chip Adc
12-ch x 10-bit
Program Memory Type
Flash
Program Memory Size
48 KB
Package / Case
PLCC-68
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
16.2.9
The following steps should be taken when configuring
the ECCP1 module for PWM operation:
1.
2.
3.
4.
5.
6.
TABLE 16-3:
 2004 Microchip Technology Inc.
INTCON
PIR1
PIE1
IPR1
TRISC
TRISE
TRISG
TMR2
PR2
T2CON
CCPR1L
CCPR1H
CCP1CON
ECCP1AS
ECCP1DEL
Legend:
Name
Configure the PWM pins, P1A and P1B (and
P1C and P1D, if used), as inputs by setting the
corresponding TRISB bits.
Set the PWM period by loading the PR2 register.
Configure the ECCP1 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 ECCP1DEL<6:0> with
the appropriate value.
If auto-shutdown operation is required, load the
ECCPAS register:
• Select the auto-shutdown sources using the
• Select the shutdown states of the PWM
• Set the ECCPASE bit (ECCPAS<7>).
• Configure the comparators using the CMCON
• Configure the comparator inputs as analog
configurations and direction with the
P1M1:P1M0 bits.
signals with the CCP1M3:CCP1M0 bits.
ECCPAS<2:0> bits.
output pins using PSSAC1:PSSAC0 and
PSSBD1:PSSBD0 bits.
register.
inputs.
x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used by PWM and Timer2.
SETUP FOR PWM OPERATION
PORTC Data Direction Register
PORTE Data Direction Register
Timer2 Module Register
Timer2 Module Period Register
Capture/Compare/PWM Register 1 (LSB)
Capture/Compare/PWM Register 1 (MSB)
ECCPASE ECCPAS2 ECCPAS1 ECCPAS0
GIE/GIEH PEIE/GIEL TMR0IE
PRSEN
PSPIE
PSPIP
PSPIF
P1M1
Bit 7
REGISTERS ASSOCIATED WITH PWM AND TIMER2
TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
PDC6
P1M0
ADIE
ADIP
ADIF
Bit 6
DC1B1
PDC5
RCIF
RCIE
RCIP
Bit 5
PORTG Data Direction Register
PIC18F6585/8585/6680/8680
DC1B0
INT0IE
PDC4
TXIE
TXIP
Bit 4
TXIF
CCP1M3
PSSAC1
SSPIF
SSPIE
SSPIP
PDC3
RBIE
Bit 3
7.
8.
9.
16.2.10
Both Power-on 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.
CCP1M2
PSSAC0
TMR0IF
CCP1IF
CCP1IE
CCP1IP
PDC2
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 TMR2 overflows (TMR2IF bit is set).
• Enable the CCP1/P1A, P1B, P1C and/or P1D
• Clear the ECCPASE bit (ECCP1AS<7>).
Bit 2
the TMR2IF bit (PIR1<1>).
T2CKPS bits (T2CON<1:0>).
(T2CON<2>).
pin outputs by clearing the respective TRISB
bits.
EFFECTS OF A RESET
CCP1M1
PSSBD1
TMR2IF
TMR2IE
TMR2IP
INT0IF
PDC1
Bit 1
CCP1M0 0000 0000 0000 0000
TMR1IE
TMR1IP
PSSBD0 0000 0000 0000 0000
TMR1IF
PDC0
RBIF
Bit 0
0000 000x 0000 000u
0000 0000 0000 0000
0000 0000 0000 0000
1111 1111 1111 1111
1111 1111 1111 1111
1111 1111 1111 1111
---1 1111 ---1 1111
0000 0000 0000 0000
1111 1111 1111 1111
xxxx xxxx uuuu uuuu
xxxx xxxx uuuu uuuu
0000 0000 uuuu uuuu
POR, BOR
Value on
DS30491C-page 187
Value on
all other
Resets

Related parts for PIC18F6585-I/L