资料介绍
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微芯片开发平台 1次下载
- 基于单片机PIC18F4550的基本开发板 5次下载
- 微芯片PIC18F87J10家庭数据表 2次下载
- PIC18F到PIC18FXXJ闪存器件的移植 16次下载
- 如何使用C语言写单片机PIC18串行引导加载程序 12次下载
- 使用C18编译器和MSSP模块进行I2C™串行EEPROM与PIC18单片机的接口设计 11次下载
- PIC18F47J13系列闪存MCU产品简介 7次下载
- PIC18F47J53系列USB闪存MCU产品手册 11次下载
- PIC18FXX80到PIC18FXXK80的移植指南 20次下载
- PIC18FXXJ闪存器件与PIC18闪存器件存在的几个主要差异详细概述 8次下载
- 使用C18编译器和定时器连接PIC18 MCU和兼容UNI/O®总线的串行EEPROM 6次下载
- PIC18F2610/PIC18F4610 pdf data 3次下载
- PIC18F4331 pdf datasheet 32次下载
- PIC18F4455/PIC18F4550中文资料pdf 428次下载
- PIC18F4550/PIC18F2455中文资料pdf 103次下载
- MAX5591快速建立DAC与PIC微控制器的接口 440次阅读
- PWM的详细介绍和PWM频率与PWM值的区别说明 3.7w次阅读
- 微雪电子Open18F4520 PIC开发板简介 2246次阅读
- 微雪电子Open18F4520 PIC开发板简介 1681次阅读
- 微雪电子Open18F4520 PIC开发板简介 1394次阅读
- 如何在PIC单片机上实现发送数据 1803次阅读
- PIC单片机源程序的模拟仿真设计 2222次阅读
- CAN4550-Q1汽车CAN FD控制器解决方案 4157次阅读
- 如何选择PIC单片机的C编译器 5016次阅读
- PIC单片机ICSP接口电路的设计 1w次阅读
- PIC18F4550单片机三个操作寄存器的使用方法 5145次阅读
- Microchip PIC18(L)F25xx83系列MCU CAN应用开发方案 6943次阅读
- PIC18F2455/2550/4455/4550之通用串行总线USB 3318次阅读
- 基于PIC单片机的逆变电路设计初探 3441次阅读
- PIC18F87J72设计的单相电能检测技术 1462次阅读
下载排行
本周
- 1TC358743XBG评估板参考手册
- 1.36 MB | 330次下载 | 免费
- 2开关电源基础知识
- 5.73 MB | 6次下载 | 免费
- 3100W短波放大电路图
- 0.05 MB | 4次下载 | 3 积分
- 4嵌入式linux-聊天程序设计
- 0.60 MB | 3次下载 | 免费
- 5基于FPGA的光纤通信系统的设计与实现
- 0.61 MB | 2次下载 | 免费
- 651单片机窗帘控制器仿真程序
- 1.93 MB | 2次下载 | 免费
- 751单片机大棚环境控制器仿真程序
- 1.10 MB | 2次下载 | 免费
- 8基于51单片机的RGB调色灯程序仿真
- 0.86 MB | 2次下载 | 免费
本月
- 1OrCAD10.5下载OrCAD10.5中文版软件
- 0.00 MB | 234315次下载 | 免费
- 2555集成电路应用800例(新编版)
- 0.00 MB | 33564次下载 | 免费
- 3接口电路图大全
- 未知 | 30323次下载 | 免费
- 4开关电源设计实例指南
- 未知 | 21549次下载 | 免费
- 5电气工程师手册免费下载(新编第二版pdf电子书)
- 0.00 MB | 15349次下载 | 免费
- 6数字电路基础pdf(下载)
- 未知 | 13750次下载 | 免费
- 7电子制作实例集锦 下载
- 未知 | 8113次下载 | 免费
- 8《LED驱动电路设计》 温德尔著
- 0.00 MB | 6653次下载 | 免费
总榜
- 1matlab软件下载入口
- 未知 | 935054次下载 | 免费
- 2protel99se软件下载(可英文版转中文版)
- 78.1 MB | 537796次下载 | 免费
- 3MATLAB 7.1 下载 (含软件介绍)
- 未知 | 420026次下载 | 免费
- 4OrCAD10.5下载OrCAD10.5中文版软件
- 0.00 MB | 234315次下载 | 免费
- 5Altium DXP2002下载入口
- 未知 | 233046次下载 | 免费
- 6电路仿真软件multisim 10.0免费下载
- 340992 | 191185次下载 | 免费
- 7十天学会AVR单片机与C语言视频教程 下载
- 158M | 183279次下载 | 免费
- 8proe5.0野火版下载(中文版免费下载)
- 未知 | 138040次下载 | 免费
评论
查看更多