PIC18F1320-I/SO Microchip Technology Inc., PIC18F1320-I/SO Datasheet - Page 131

no-image

PIC18F1320-I/SO

Manufacturer Part Number
PIC18F1320-I/SO
Description
Microcontroller; 8 KB Flash; 256 RAM; 256 EEPROM; 16 I/O; 18-Pin-PDIP
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC18F1320-I/SO

A/d Inputs
7-Channel, 10-Bit
Cpu Speed
10 MIPS
Eeprom Memory
256 Bytes
Input Output
16
Interface
USART
Memory Type
Flash
Number Of Bits
8
Package Type
18-pin SOIC
Programmable Memory
8K Bytes
Ram Size
256 Bytes
Speed
20 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:
PIC18F1320-I/SO
Manufacturer:
MICROCHIP
Quantity:
35 000
Part Number:
PIC18F1320-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
15.5.9
The following steps should be taken when configuring
the ECCP1 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 TRISB bits.
Set the PWM period by loading the PR2 register.
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
ECCPAS register:
• Select the auto-shutdown sources using the
• Select the shutdown states of the PWM
• Set the ECCPASE bit (ECCPAS<7>).
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
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 (ECCPAS<7>).
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.
the TMR2IF bit (PIR1<1>).
T2CKPS bits (T2CON<1:0>).
(T2CON<2>).
pin outputs by clearing the respective TRISB
bits.
SETUP FOR PWM OPERATION
15.5.10
In the Low-Power 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 continue 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 may not be stable if the INTOSC is being
used.
In PRI_IDLE mode, the primary clock will continue to
clock the ECCP module without change.
In all other low-power modes, the selected low-power
mode clock will clock Timer2. Other low-power mode
clocks will most likely be different than the primary
clock frequency.
15.5.10.1
If
(CONFIG1H<6> is programmed), a clock failure will
force the device into the Low-Power RC_RUN mode
and the OSCFIF bit (PIR2<7>) will be set. The ECCP
will then be clocked from the INTRC clock source,
which may have a different clock frequency than the
primary clock. By loading the IRCF2:IRCF0 bits on
Resets, the user can enable the INTOSC at a high
clock speed in the event of a clock failure.
See the previous section for additional details.
15.5.11
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.
the
PIC18F1220/1320
Fail-Safe
OPERATION IN LOW-POWER
MODES
EFFECTS OF A RESET
Operation with Fail-Safe
Clock Monitor
Clock
Monitor
DS39605C-page 129
is
enabled

Related parts for PIC18F1320-I/SO