參數(shù)資料
型號: PIC16F785
廠商: Microchip Technology Inc.
英文描述: 20-Pin Flash-Based 8-Bit CMOS Microcontroller with Two-Phase Asychronous Feedback PWM, Dual High-Speed Comparators and Dual Operational Amplifiers
中文描述: 20引腳基于閃存的8兩相異步反饋的PWM,雙高位CMOS微控制器的高速比較器和雙運算放大器
文件頁數(shù): 60/178頁
文件大小: 1620K
代理商: PIC16F785
PIC16F785
DS41249A-page 58
Preliminary
2004 Microchip Technology Inc.
8.3
CCP PWM Mode
In Pulse Width Modulation (PWM) mode, the CCP
module produces up to a 10-bit resolution PWM output
on the RC5/CCP1 pin. Since the RC5/CCP1 pin is
multiplexed with the PORTC data latch, the TRISC<5>
must be cleared to make the RC5/CCP1 pin an output.
Figure 8-3 shows a simplified block diagram of PWM
operation.
For a step by step procedure on how to set up the CCP
module for PWM operation, see
Section 8.3.5 “Setup
for PWM Operation”
.
FIGURE 8-3:
SIMPLIFIED PWM BLOCK
DIAGRAM
The PWM output (Figure 8-4) has a time base (period)
and a time that the output stays high (duty cycle). The
frequency of the PWM is the inverse of the period
(1/period).
FIGURE 8-4:
CCP PWM OUTPUT
8.3.1
PWM PERIOD
The PWM period is specified by writing to the PR2
register. The PWM period can be calculated using the
formula of Equation 8-1.
EQUATION 8-1:
PWM frequency is defined as 1 / [PWM period].
When TMR2 is equal to PR2, the following three events
occur on the next increment cycle:
TMR2 is cleared
The RC5/CCP1 pin is set. (exception: if PWM
duty cycle = 0%, the pin will not be set)
The PWM duty cycle is latched from CCPR1L into
CCPR1H
8.3.2
PWM DUTY CYCLE
The PWM duty cycle is specified by writing to the
CCPR1L
register
and
(CCP1CON<5:4>) bits. Up to 10 bits of resolution is
available. The CCPR1L contains the eight MSbs and
the DC1B<1:0> contains the two LSbs. CCPR1L and
DC1B<1:0> can be written to at any time. In PWM
mode, CCPR1H is a read-only register. This 10-bit
value is represented by CCPR1L (CCP1CON<5:4>).
to
the
DC1B<1:0>
Equation 8-2 is used to calculate the PWM duty cycle
in time.
EQUATION 8-2:
Note:
Clearing the CCP1CON register will force
the PWM output latch to the default
inactive levels. This is not the PORTC I/O
data latch.
CCPR1L
CCPR1H (Slave)
Comparator
TMR2
Comparator
PR2
(1)
R
Q
S
Duty Cycle Registers
CCP1CON<5:4>
Clear Timer2,
toggle PWM pin and
latch duty cycle
Note
1:
The 8-bit timer TMR2 register is concate-
nated with the 2-bit internal Q clock, or 2 bits
of the prescaler, to create the 10-bit time
base.
TRISC<5>
RC5/CCP1
PERIOD
DUTY CYCLE
TMR2 = 0
TMR2 = DUTY CYCLE
TMR2 = PR2
Note:
The Timer2 postscaler (see
Section 7.1
“Timer2 Operation”
) is not used in the
determination of the PWM frequency. The
postscaler could be used to have a servo
update rate at a different frequency than
the PWM output.
PWM period
PR2
(TMR2 prescale value)
(
)
1
+
[
]
4
T
OSC
=
PWM duty cycle
CCPR1L:CCP1CON<5:4>
(
)
=
T
OSC
(TMR2 prescale value)
相關(guān)PDF資料
PDF描述
PIC16F818 18/20-Pin Enhanced FLASH Microcontrollers with nanoWatt Technology(18/20引腳,納瓦技術(shù)增強FLASH微控制器)
PIC16F819 18/20-Pin Enhanced FLASH Microcontrollers with nanoWatt Technology(18/20引腳,納瓦技術(shù)增強FLASH微控制器)
PIC16F83 8-Bit CMOS Flash/EEPROM Microcontollrs(每個I/O口有20mA吸收,25mA驅(qū)動,64字節(jié)數(shù)據(jù)EEPROM,2.0V的微控制器)
PIC16F84 18-pin Flash/EEPROM 8-Bit Microcontrollers
PIC16F85 18/20 Pin, 8-Bit CMOS FLASH Microcontroller with Comparators and A/D Product Brief
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
PIC16F785-E/ML 功能描述:8位微控制器 -MCU 3.5 KB 128 RAM 18I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16F785-E/P 功能描述:8位微控制器 -MCU 14KB 368 RAM 33 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16F785-E/SO 功能描述:8位微控制器 -MCU 3.5KB FL 128R 18 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16F785-E/SS 功能描述:8位微控制器 -MCU 3.5KB FL 128R 18 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16F785-I/ML 功能描述:8位微控制器 -MCU 3.5 KB 128 RAM 18I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT