资料介绍
PWM FUNCTIONS
Original by F.Zia, rewritten for the PIC18F4550 by M.F.v.Lieshout, March 2006
Information sources:
The information in this document is obtained from the following Microchip manuals:
- PIC18F4550 Datasheet
- PICmicro® 18C MCU Family Reference Manual
- MPLAB C18 C Compiler Libraries
Function Prototypes:
For a detailed description of these functions, please see:
Section 2.7 Pulse-Width Modulation Functions, in MPLAB C18 C Compiler Libraries manual.
The PIC18F4550 has 2 PWM channels available, so x is 1 or 2 in this case.
#include
void OpenPWMx ( char PR2 ); // Configure PWM channel x.
void SetDCPWMx ( unsigned int dutycycle ); // Write a new duty cycle value to
PWM channel x.
void ClosePWMx ( void ); // Disable PWM channel x.
Notes:
1. PR2 can be any value from 0x00 to 0xff. This value determines the PWM frequency by
using the following formula:
PWM period =[(PR2) + 1] x 4 x TOSC x TMR2 prescaler
2. The value of dutycycle can be any 10-bit number. Only the lower 10-bits of dutycycle are
written into the duty cycle registers. The duty cycle determines the high time of the PWM
waveform.
3. PWM uses TIMER2 for time base. In addition to opening the PWM, TIMER2 must also be
opened with an OpenTimer2(...) statement before the PWM will operate. See the other
manual for the timer functions.
4. TIMER2 postscaler is not used in the determination of the PWM frequency. TIMER2
postscaler could be used to generate TMR2 interrupts at a different frequency than the PWM
output.
5. On the PIC18F4550, also an enhanced PWM can be used. The enhanced PWM can be
used for motor driving: half-bridge and full-bridge (forward and reverse). See the MPLAB C18
C Compiler Libraries manual for the functions.
下载该资料的人也在下载
下载该资料的人还在阅读
更多 >
- 18F4550微芯片开发平台
- 基于单片机PIC18F4550的基本开发板
- 微芯片PIC18F87J10家庭数据表 2次下载
- PIC18F到PIC24F软件移植指南 3次下载
- PIC18F47J13系列闪存MCU产品简介
- PIC18F47J53系列USB闪存MCU产品手册
- PIC18FXX80到PIC18FXXK80的移植指南
- Migrating from PIC18F to PIC18
- PIC18F448/PIC18F458 pdf datash
- PIC18F2610/PIC18F4610 pdf data
- PIC18F4410/PIC18F4510/PIC18F45
- PIC18F4331 pdf datasheet
- PIC18F2331/PIC18F2431 pdf data
- PIC18F4550/PIC18F2455中文资料pdf
- pic18f2550/2455 pdf
- 基于PIC18F258单片机和总线技术实现智能刹车控制系统的应用方案 3539次阅读
- 基于PIC18F458与PCA82C250芯片实现CAN接口电路的设计 3384次阅读
- 微雪电子Open16F877A PIC开发板简介 2255次阅读
- 微雪电子Open18F4520 PIC开发板简介 2724次阅读
- 微雪电子Open18F4520 PIC开发板简介 2356次阅读
- 微雪电子Open18F4520 PIC开发板简介 1845次阅读
- 如何在PIC单片机上实现发送数据 2030次阅读
- PIC单片机ICSP接口电路的设计 1.1w次阅读
- PIC18F4550单片机三个操作寄存器的使用方法 5508次阅读
- 基于PIC18F6585型单片机的智能型漏电继电器设计 1260次阅读
- 美国微芯科技推出全新的低功率16位PIC24F USB单片机 3014次阅读
- Microchip PIC18(L)F25xx83系列MCU CAN应用开发方案 7584次阅读
- PIC18F2455/2550/4455/4550之通用串行总线USB 3696次阅读
- 基于PIC单片机的逆变电路设计初探 3620次阅读
- PIC18F87J72设计的单相电能检测技术 1628次阅读
下载排行
本周
- 1飞利浦D8714收录机说明书
- 6.50 MB | 7次下载 | 10 积分
- 2MBRD3060CT TO-252肖特基二极管规格书
- 0.65 MB | 次下载 | 免费
- 3MBRD30100CT TO-252肖特基二极管规格书
- 0.65 MB | 次下载 | 免费
- 4MBRD30150CT TO-252肖特基二极管规格书
- 0.65 MB | 次下载 | 免费
- 5AIWA Z-D3100维修手册
- 2.24 MB | 次下载 | 10 积分
- 6爱华707维修手册
- 14.08 MB | 次下载 | 5 积分
- 7CG65140DAA_datasheet_V1
- 2.36 MB | 次下载 | 免费
- 8st7565p数据手册
- 0.85 MB | 次下载 | 免费
本月
- 1元宇宙深度解析—未来的未来-风口还是泡沫
- 6.40 MB | 241次下载 | 免费
- 2元宇宙底层硬件系列报告
- 13.42 MB | 184次下载 | 免费
- 32022 年展望報告 – 半導體產業
- 1.43 MB | 136次下载 | 免费
- 4晶振与滤波器应用电路《电子工程师必备:元器件应用宝典》
- 1.57 MB | 90次下载 | 免费
- 5汽车电子行业深度解析:智能化与电动化方兴未艾
- 6.47 MB | 71次下载 | 免费
- 6中国DPU行业白皮书
- 23.80 MB | 37次下载 | 免费
- 7晶科鑫代理线-微盟电子2021年度产品目录选型手册
- 14.75 MB | 27次下载 | 免费
- 8SJK晶振产品目录-简化版-2022
- 13.77 MB | 20次下载 | 免费
总榜
- 1matlab软件下载入口
- 未知 | 935137次下载 | 10 积分
- 2开源硬件-PMP21529.1-4 开关降压/升压双向直流/直流转换器 PCB layout 设计
- 1.48MB | 420064次下载 | 10 积分
- 3Altium DXP2002下载入口
- 未知 | 233089次下载 | 10 积分
- 4电路仿真软件multisim 10.0免费下载
- 340992 | 191425次下载 | 10 积分
- 5十天学会AVR单片机与C语言视频教程 下载
- 158M | 183352次下载 | 10 积分
- 6labview8.5下载
- 未知 | 81602次下载 | 10 积分
- 7Keil工具MDK-Arm免费下载
- 0.02 MB | 73822次下载 | 10 积分
- 8LabVIEW 8.6下载
- 未知 | 65991次下载 | 10 积分
电子发烧友App






创作
发文章
发帖
提问
发资料
发视频
上传资料赚积分
评论