参数资料
型号: DM164130-5
厂商: Microchip Technology
文件页数: 137/478页
文件大小: 0K
描述: BOARD EVAL F1 LV PIC21F1/PIC16F1
标准包装: 1
系列: XLP™
类型: MCU
适用于相关产品: PIC16LF1937
所含物品:
第1页第2页第3页第4页第5页第6页第7页第8页第9页第10页第11页第12页第13页第14页第15页第16页第17页第18页第19页第20页第21页第22页第23页第24页第25页第26页第27页第28页第29页第30页第31页第32页第33页第34页第35页第36页第37页第38页第39页第40页第41页第42页第43页第44页第45页第46页第47页第48页第49页第50页第51页第52页第53页第54页第55页第56页第57页第58页第59页第60页第61页第62页第63页第64页第65页第66页第67页第68页第69页第70页第71页第72页第73页第74页第75页第76页第77页第78页第79页第80页第81页第82页第83页第84页第85页第86页第87页第88页第89页第90页第91页第92页第93页第94页第95页第96页第97页第98页第99页第100页第101页第102页第103页第104页第105页第106页第107页第108页第109页第110页第111页第112页第113页第114页第115页第116页第117页第118页第119页第120页第121页第122页第123页第124页第125页第126页第127页第128页第129页第130页第131页第132页第133页第134页第135页第136页当前第137页第138页第139页第140页第141页第142页第143页第144页第145页第146页第147页第148页第149页第150页第151页第152页第153页第154页第155页第156页第157页第158页第159页第160页第161页第162页第163页第164页第165页第166页第167页第168页第169页第170页第171页第172页第173页第174页第175页第176页第177页第178页第179页第180页第181页第182页第183页第184页第185页第186页第187页第188页第189页第190页第191页第192页第193页第194页第195页第196页第197页第198页第199页第200页第201页第202页第203页第204页第205页第206页第207页第208页第209页第210页第211页第212页第213页第214页第215页第216页第217页第218页第219页第220页第221页第222页第223页第224页第225页第226页第227页第228页第229页第230页第231页第232页第233页第234页第235页第236页第237页第238页第239页第240页第241页第242页第243页第244页第245页第246页第247页第248页第249页第250页第251页第252页第253页第254页第255页第256页第257页第258页第259页第260页第261页第262页第263页第264页第265页第266页第267页第268页第269页第270页第271页第272页第273页第274页第275页第276页第277页第278页第279页第280页第281页第282页第283页第284页第285页第286页第287页第288页第289页第290页第291页第292页第293页第294页第295页第296页第297页第298页第299页第300页第301页第302页第303页第304页第305页第306页第307页第308页第309页第310页第311页第312页第313页第314页第315页第316页第317页第318页第319页第320页第321页第322页第323页第324页第325页第326页第327页第328页第329页第330页第331页第332页第333页第334页第335页第336页第337页第338页第339页第340页第341页第342页第343页第344页第345页第346页第347页第348页第349页第350页第351页第352页第353页第354页第355页第356页第357页第358页第359页第360页第361页第362页第363页第364页第365页第366页第367页第368页第369页第370页第371页第372页第373页第374页第375页第376页第377页第378页第379页第380页第381页第382页第383页第384页第385页第386页第387页第388页第389页第390页第391页第392页第393页第394页第395页第396页第397页第398页第399页第400页第401页第402页第403页第404页第405页第406页第407页第408页第409页第410页第411页第412页第413页第414页第415页第416页第417页第418页第419页第420页第421页第422页第423页第424页第425页第426页第427页第428页第429页第430页第431页第432页第433页第434页第435页第436页第437页第438页第439页第440页第441页第442页第443页第444页第445页第446页第447页第448页第449页第450页第451页第452页第453页第454页第455页第456页第457页第458页第459页第460页第461页第462页第463页第464页第465页第466页第467页第468页第469页第470页第471页第472页第473页第474页第475页第476页第477页第478页
2010-2012 Microchip Technology Inc.
DS41414D-page 221
PIC16(L)F1946/47
23.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.
Timer2/4/6 resource selection:
Select the Timer2/4/6 resource to be used
for PWM generation by setting the
CxTSEL<1:0> bits in the CCPTMRSx
register.
3.
Load the PRx register with the PWM period
value.
4.
Configure the CCP module for the PWM mode
by loading the CCPxCON register with the
appropriate values.
5.
Load the CCPRxL register and the DCxBx bits
of the CCPxCON register, with the PWM duty
cycle value.
6.
Configure and start Timer2/4/6:
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.
7.
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 clear-
ing the associated TRIS bit.
23.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 CCPTMRSx
register selects which Timer2/4/6 timer is used.
23.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 23-1.
EQUATION 23-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.
23.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 23-2 is used to calculate the PWM pulse
width.
Equation 23-3 is used to calculate the PWM duty cycle
ratio.
EQUATION 23-2:
PULSE WIDTH
EQUATION 23-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 (FOSC), 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
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:
TOSC = 1/FOSC
Note:
The Timer postscaler (see Section 22.1
) 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
+
-----------------------------------------------------------------------
=
相关PDF资料
PDF描述
DM164130-1 BOARD EVAL PICKIT PIC16LF1937
TDGL002 BOARD DEV CHIPKIT UNO32
MAX16024LTBS25+T IC BATTERY BACKUP 2.5V 10TDFN-EP
MAX16024LTBS18+T IC BATTERY BACKUP 1.8V 10TDFN-EP
MAX16024LTBS12+T IC BATTERY BACKUP 1.2V 10TDFN-EP
相关代理商/技术参数
参数描述
DM164130-6 功能描述:子卡和OEM板 F1 BDC Motor Add-On RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
DM164130-7 功能描述:子卡和OEM板 F1 Bi-Polar Stepper Motor Add-On RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
DM164130-8 功能描述:子卡和OEM板 F1 Unipolar Stepper Motor Add-On RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
DM164130-9 功能描述:子卡和OEM板 PICkit Low Pin Count Demo Board RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
DM164134 功能描述:KIT DEV PIC18F4XK22 RoHS:是 类别:编程器,开发系统 >> 通用嵌入式开发板和套件(MCU、DSP、FPGA、CPLD等) 系列:PIC® 18F 产品培训模块:Blackfin® Processor Core Architecture Overview Blackfin® Device Drivers Blackfin® Optimizations for Performance and Power Consumption Blackfin® System Services 特色产品:Blackfin? BF50x Series Processors 标准包装:1 系列:Blackfin® 类型:DSP 适用于相关产品:ADSP-BF548 所含物品:板,软件,4x4 键盘,光学拨轮,QVGA 触摸屏 LCD 和 40G 硬盘 配用:ADZS-BFBLUET-EZEXT-ND - EZ-EXTENDER DAUGHTERBOARDADZS-BFLLCD-EZEXT-ND - BOARD EXT LANDSCAP LCD INTERFACE 相关产品:ADSP-BF542BBCZ-4A-ND - IC DSP 16BIT 400MHZ 400CSBGAADSP-BF544MBBCZ-5M-ND - IC DSP 16BIT 533MHZ MDDR 400CBGAADSP-BF542MBBCZ-5M-ND - IC DSP 16BIT 533MHZ MDDR 400CBGAADSP-BF542KBCZ-6A-ND - IC DSP 16BIT 600MHZ 400CSBGAADSP-BF547MBBCZ-5M-ND - IC DSP 16BIT 533MHZ MDDR 400CBGAADSP-BF548BBCZ-5A-ND - IC DSP 16BIT 533MHZ 400CSBGAADSP-BF547BBCZ-5A-ND - IC DSP 16BIT 533MHZ 400CSBGAADSP-BF544BBCZ-5A-ND - IC DSP 16BIT 533MHZ 400CSBGAADSP-BF542BBCZ-5A-ND - IC DSP 16BIT 533MHZ 400CSBGA