Web Analytics
Datasheet 搜索 > Microchip(微芯) > PIC16F1827T-E/SS 数据手册 > PIC16F1827T-E/SS 数据手册 209/406 页
PIC16F1827T-E/SS
器件3D模型
0
导航目录
PIC16F1827T-E/SS数据手册
Page:
of 406 Go
若手册格式错乱,请下载阅览PDF原文件
2011 Microchip Technology Inc. DS41391D-page 209
PIC16(L)F1826/27
24.3.2 SETUP FOR PWM OPERATION
The following steps should be taken when configuring
the CCP module for standard PWM operation:
1. Disable the CCPx pin output driver by setting the
associated TRIS bit.
2. Load the PRx register with the PWM period
value.
3. Configure the CCP module for the PWM mode
by loading the CCPxCON register with the
appropriate values.
4. Load the CCPRxL register and the DCxBx bits
of the CCPxCON register, with the PWM duty
cycle value.
5. Configure and start Timer2/4/6:
•Select the Timer2/4/6 resource to be used
for PWM generation by setting the
CxTSEL<1:0> bits in the CCPTMRS
register.
•Clear the TMRxIF interrupt flag bit of the
PIRx register. See Note below.
•Configure the TxCKPS bits of the TxCON
register with the Timer prescale value.
•Enable the Timer by setting the TMRxON bit
of the TxCON register.
6. Enable PWM output pin:
•Wait until the Timer overflows and the TMRxIF
bit of the PIRx register is set. See Note
below.
•Enable the CCPx pin output driver by clearing
the associated TRIS bit.
24.3.3 TIMER2/4/6 TIMER RESOURCE
The PWM standard mode makes use of one of the 8-bit
Timer2/4/6 timer resources to specify the PWM period.
Configuring the CxTSEL<1:0> bits in the CCPTMRS
register selects which Timer2/4/6 timer is used.
24.3.4 PWM PERIOD
The PWM period is specified by the PRx register of
Timer2/4/6. The PWM period can be calculated using
the formula of Equation 24-1.
EQUATION 24-1: PWM PERIOD
When TMRx is equal to PRx, the following three events
occur on the next increment cycle:
TMRx is cleared
The CCPx pin is set. (Exception: If the PWM duty
cycle = 0%, the pin will not be set.)
The PWM duty cycle is latched from CCPRxL into
CCPRxH.
24.3.5 PWM DUTY CYCLE
The PWM duty cycle is specified by writing a 10-bit
value to multiple registers: CCPRxL register and
DCxB<1:0> bits of the CCPxCON register. The
CCPRxL contains the eight MSbs and the DCxB<1:0>
bits of the CCPxCON register contain the two LSbs.
CCPRxL and DCxB<1:0> bits of the CCPxCON
register can be written to at any time. The duty cycle
value is not latched into CCPRxH until after the period
completes (i.e., a match between PRx and TMRx
registers occurs). While using the PWM, the CCPRxH
register is read-only.
Equation 24-2 is used to calculate the PWM pulse
width.
Equation 24-3 is used to calculate the PWM duty cycle
ratio.
EQUATION 24-2: PULSE WIDTH
EQUATION 24-3: DUTY CYCLE RATIO
The CCPRxH register and a 2-bit internal latch are
used to double buffer the PWM duty cycle. This double
buffering is essential for glitchless PWM operation.
The 8-bit timer TMRx register is concatenated with either
the 2-bit internal system clock (F
OSC), or 2 bits of the
prescaler, to create the 10-bit time base. The system
clock is used if the Timer2/4/6 prescaler is set to 1:1.
When the 10-bit time base matches the CCPRxH and
2-bit latch, then the CCPx pin is cleared (see
Figure 24-4).
Note: In order to send a complete duty cycle and
period on the first PWM output, the above
steps must be included in the setup
sequence. If it is not critical to start with a
complete PWM signal on the first output,
then step 6 may be ignored.
PWM Period PRx1+4TOSC =
(TMRx Prescale Value)
Note 1: T
OSC = 1/FOSC
Note: The Timer postscaler (see Section 22.1
“Timer2/4/6 Operation”) is not used in the
determination of the PWM frequency.
Pulse Width CCPRxL:CCPxCON<5:4>
=
TOSC
(TMRx Prescale Value)
Duty Cycle Ratio
CCPRxL:CCPxCON<5:4>
4 PRx 1+
-----------------------------------------------------------------------=

PIC16F1827T-E/SS 数据手册

Microchip(微芯)
406 页 / 3.25 MByte

PIC16F1827 数据手册

Microchip(微芯)
18 /20/ 28引脚闪存单片机采用纳瓦XLP技术 18/20/28-Pin Flash Microcontrollers with nanoWatt XLP Technology
Microchip(微芯)
MICROCHIP  PIC16F1827-I/P  微控制器, 8位, 闪存, AEC-Q100, PIC16F18xx, 32 MHz, 7 KB, 384 Byte, 18 引脚, DIP
Microchip(微芯)
PIC16F1826/1827 8 位闪存微控制器Microchip 的 PIC16F 系列微控制器 8 位 MCU,将 Microchip 的 PIC® 体系架构融入到引脚和封装选件中,从节省空间的 14 引脚设备到功能丰富的 64 引脚设备。 带有基线、中级或增强型中级体系架构的设备提供多种不同的外围设备组合,可谓设计人员提供灵活性,并为应用提供选择。 PIC16F1826/1827 系列微控制器基于 Microchip 的增强型中级内核,带 16 层深硬件堆栈和 49 个指令。 这些 MCU 提供高达 8 个 MIP、7 千字节程序存储器、384 字节 RAM 和 256 字节数据 EEPROM。 板载可配置振荡器,精确度为 ±1%。### 微控制器功能最大 32 MHz CPU 速度 49 个指令 16 级硬件堆栈 32 MHz 内部振荡器 - 可选频率范围 32 MHz 至 31 kHz 16 个输入/输出引脚 nanoWatt XLP 技术 通电重置 (POR) 通电计时器 (PWRT) 振荡器启动计时器 (OST) 掉电重置 (BOR) 延长监控计时器 (WDT) 增强型低电压编程 (LVP) 在线串行编程 (ICSP) 在线调试 (ICD) ### 外设12 通道 10 位模拟到数字转换器 (ADC) 12 通道 mTouchTM 电容性传感器模块 两个捕获/比较/PWM (CCP) 模块 - 仅限 PIC16F1827 增强捕获/比较/PWM (ECCP) 模块 - PIC16F1826 x 1、PIC16F1827 x 2 两个比较器 8 位计时器 - PIC16F1826 x 2、PIC16F1827 x 4 一个 16 位计时器 主同步串行端口 (MSSP),带 SPI 和 I2C - PIC16F1826 x 1、PIC16F1827 x 2 增强型通用同步异步接收器发射器 (EUSART) 固定电压参考 (FVR) 数据信号调制器模块 SR 闩锁 ### PIC16 微控制器
Microchip(微芯)
MICROCHIP  PIC16F1827-I/SS  微控制器, 8位, 闪存, AEC-Q100, PIC16F18xx, 32 MHz, 7 KB, 384 Byte, 20 引脚, SSOP
Microchip(微芯)
MICROCHIP  PIC16F1827-I/MV  微控制器, 8位, 闪存, AEC-Q100, PIC16F18xx, 32 MHz, 7 KB, 384 Byte, 28 引脚, UQFN
Microchip(微芯)
PIC16F1826/1827 8 位闪存微控制器Microchip 的 PIC16F 系列微控制器 8 位 MCU,将 Microchip 的 PIC® 体系架构融入到引脚和封装选件中,从节省空间的 14 引脚设备到功能丰富的 64 引脚设备。 带有基线、中级或增强型中级体系架构的设备提供多种不同的外围设备组合,可谓设计人员提供灵活性,并为应用提供选择。 PIC16F1826/1827 系列微控制器基于 Microchip 的增强型中级内核,带 16 层深硬件堆栈和 49 个指令。 这些 MCU 提供高达 8 个 MIP、7 千字节程序存储器、384 字节 RAM 和 256 字节数据 EEPROM。 板载可配置振荡器,精确度为 ±1%。### 微控制器功能最大 32 MHz CPU 速度 49 个指令 16 级硬件堆栈 32 MHz 内部振荡器 - 可选频率范围 32 MHz 至 31 kHz 16 个输入/输出引脚 nanoWatt XLP 技术 通电重置 (POR) 通电计时器 (PWRT) 振荡器启动计时器 (OST) 掉电重置 (BOR) 延长监控计时器 (WDT) 增强型低电压编程 (LVP) 在线串行编程 (ICSP) 在线调试 (ICD) ### 外设12 通道 10 位模拟到数字转换器 (ADC) 12 通道 mTouchTM 电容性传感器模块 两个捕获/比较/PWM (CCP) 模块 - 仅限 PIC16F1827 增强捕获/比较/PWM (ECCP) 模块 - PIC16F1826 x 1、PIC16F1827 x 2 两个比较器 8 位计时器 - PIC16F1826 x 2、PIC16F1827 x 4 一个 16 位计时器 主同步串行端口 (MSSP),带 SPI 和 I2C - PIC16F1826 x 1、PIC16F1827 x 2 增强型通用同步异步接收器发射器 (EUSART) 固定电压参考 (FVR) 数据信号调制器模块 SR 闩锁 ### PIC16 微控制器
Microchip(微芯)
18 /20/ 28引脚闪存单片机采用纳瓦XLP技术 18/20/28-Pin Flash Microcontrollers with nanoWatt XLP Technology
Microchip(微芯)
MICROCHIP  PIC16F1827-E/P  微控制器, 8位, 闪存, AEC-Q100, PIC16F18xx, 32 MHz, 7 KB, 384 Byte, 18 引脚, DIP
Microchip(微芯)
MICROCHIP  PIC16F1827-I/ML  微控制器, 8位, 闪存, AEC-Q100, PIC16F18xx, 32 MHz, 7 KB, 384 Byte, 28 引脚, QFN
Microchip(微芯)
PIC16 8 位 微控制器 带7 KB 闪存 采用28引脚 UQFN封装
器件 Datasheet 文档搜索
器件加载中...
AiEMA 数据库涵盖高达 72,405,303 个元件的数据手册,每天更新 5,000 多个 PDF 文件