欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC18F25J10-I/SS 参数 Datasheet PDF下载

PIC18F25J10-I/SS图片预览
型号: PIC18F25J10-I/SS
PDF下载: 下载PDF文件 查看货源
内容描述: 28 /40/ 44引脚高性能, RISC微控制器 [28/40/44-Pin High-Performance, RISC Microcontrollers]
分类和应用: 微控制器和处理器外围集成电路光电二极管PC时钟
文件页数/大小: 368 页 / 5652 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18F25J10-I/SS的Datasheet PDF文件第145页浏览型号PIC18F25J10-I/SS的Datasheet PDF文件第146页浏览型号PIC18F25J10-I/SS的Datasheet PDF文件第147页浏览型号PIC18F25J10-I/SS的Datasheet PDF文件第148页浏览型号PIC18F25J10-I/SS的Datasheet PDF文件第150页浏览型号PIC18F25J10-I/SS的Datasheet PDF文件第151页浏览型号PIC18F25J10-I/SS的Datasheet PDF文件第152页浏览型号PIC18F25J10-I/SS的Datasheet PDF文件第153页  
PIC18F45J10 FAMILY  
15.4.9  
SETUP FOR PWM OPERATION  
15.4.10 OPERATION IN POWER-MANAGED  
MODES  
The following steps should be taken when configuring  
the ECCP module for PWM operation:  
In Sleep mode, all clock sources are disabled. Timer2  
will not increment and the state of the module will not  
change. If the CCP1 pin is driving a value, it will con-  
tinue to drive that value. When the device wakes up, it  
will continue from this state. If Two-Speed Start-ups are  
enabled, the initial start-up frequency from INTOSC  
and the postscaler may not be stable immediately.  
1. Configure the PWM pins, P1A and P1B (and  
P1C and P1D, if used), as inputs by setting the  
corresponding TRIS bits.  
2. Set the PWM period by loading the PR2 register.  
3. If auto-shutdown is required:  
• Disable auto-shutdown (ECCPASE = 0)  
In PRI_IDLE mode, the primary clock will continue to  
clock the ECCP module without change. In all other  
power-managed modes, the selected power-managed  
mode clock will clock Timer2. Other power-managed  
mode clocks will most likely be different than the  
primary clock frequency.  
• Configure source (FLT0, Comparator 1 or  
Comparator 2)  
• Wait for non-shutdown condition  
4. Configure the ECCP module for the desired  
PWM mode and configuration by loading the  
CCP1CON register with the appropriate values:  
15.4.10.1 Operation with Fail-Safe  
Clock Monitor  
• Select one of the available output  
configurations and direction with the  
P1M<1:0> bits.  
If the Fail-Safe Clock Monitor is enabled, a clock failure  
will force the device into the power-managed RC_RUN  
mode and the OSCFIF bit (PIR2<7>) will be set. The  
ECCP will then be clocked from the internal oscillator  
clock source, which may have a different clock  
frequency than the primary clock.  
• Select the polarities of the PWM output  
signals with the CCP1M<3:0> bits.  
5. Set the PWM duty cycle by loading the CCPR1L  
register and CCP1CON<5:4> bits.  
6. For Half-Bridge Output mode, set the dead-  
band delay by loading ECCP1DEL<6:0> with  
the appropriate value.  
See the previous section for additional details.  
15.4.11 EFFECTS OF A RESET  
7. If auto-shutdown operation is required, load the  
ECCP1AS register:  
Both Power-on Reset and subsequent Resets will force  
all ports to Input mode and the CCP registers to their  
Reset states.  
• Select the auto-shutdown sources using the  
ECCPAS<2:0> bits.  
• Select the shutdown states of the PWM  
output pins using the PSSAC<1:0> and  
PSSBD<1:0> bits.  
This forces the Enhanced CCP module to reset to a  
state compatible with the standard CCP module.  
• Set the ECCPASE bit (ECCP1AS<7>).  
• Configure the comparators using the CMCON  
register.  
• Configure the comparator inputs as analog  
inputs.  
8. If auto-restart operation is required, set the  
PRSEN bit (ECCP1DEL<7>).  
9. Configure and start TMR2:  
• Clear the TMR2 interrupt flag bit by clearing  
the TMR2IF bit (PIR1<1>).  
• Set the TMR2 prescale value by loading the  
T2CKPS bits (T2CON<1:0>).  
• Enable Timer2 by setting the TMR2ON bit  
(T2CON<2>).  
10. Enable PWM outputs after a new PWM cycle  
has started:  
• Wait until TMRx overflows (TMRxIF bit is set).  
• Enable the CCP1/P1A, P1B, P1C and/or P1D  
pin outputs by clearing the respective TRIS bits.  
• Clear the ECCPASE bit (ECCP1AS<7>).  
© 2009 Microchip Technology Inc.  
DS39682E-page 147  
 复制成功!