| 数据搜索系统,热门电子元器件搜索 |
|
PIC16C925T-S/CL 数据表(PDF) 59 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC16C925T-S/CL 数据表(HTML) 59 Page - Microchip Technology |
|
59 / 182 page ![]() 2001 Microchip Technology Inc. Preliminary DS39544A-page 57 PIC16C925/926 EQUATION 8-1: EXAMPLES OF PWM PERIOD AND DUTY CYCLE CALCULATION At most, an 8-bit resolution duty cycle can be obtained from a 31.25 kHz frequency and a 8 MHz oscillator, i.e., 0 ≤ CCPR1L:CCP1CON<5:4> ≤ 255. Any value greater than 255 will result in a 100% duty cycle. In order to achieve higher resolution, the PWM fre- quency must be decreased. In order to achieve higher PWM frequency, the resolution must be decreased. Table 8-2 lists example PWM frequencies and resolu- tions for FOSC = 8 MHz. TMR2 prescaler and PR2 val- ues are also shown. 8.3.3 SET-UP FOR PWM OPERATION The following steps should be taken when configuring the CCP module for PWM operation: 1. Set the PWM period by writing to the PR2 register. 2. Set the PWM duty cycle by writing to the CCPR1L register and CCP1CON<5:4> bits. 3. Make the CCP1 pin an output by clearing the TRISC<2> bit. 4. Set the TMR2 prescale value and enable Timer2 by writing to T2CON. 5. Configure the CCP module for PWM operation. TABLE 8-2: EXAMPLE PWM FREQUENCIES AND RESOLUTIONS AT 8 MHz 1. Find the value of the PR2 register, given: • Desired PWM frequency = 31.25 kHz • FOSC = 8 MHz • TMR2 prescale = 1 From the equation for PWM period in Section 8.3.1, 1 / 31.25 kHz = [ (PR2) + 1 ] • 4 • 1/8 MHz • 1 or 32 µs = [ (PR2) + 1 ] • 4 • 125 ns • 1 = [ (PR2) + 1 ] • 0.5 µs PR2 = (32 µs / 0.5 µs) - 1 PR2 = 63 2. Find the maximum resolution of the duty cycle that can be used with a 31.25 kHz frequency and 8 MHz oscillator. From the equation from maximum PWM resolution in Section 8.3.2, 1 / 31.25 kHz = 2 PWM RESOLUTION • 1 / 8 MHz • 1 or 32 µs= 2PWM RESOLUTION • 125 ns • 1 256 = 2 PWM RESOLUTION log(256) = (PWM Resolution) • log(2) 8.0 = PWM Resolution PWM Frequency 488 Hz 1.95 kHz 7.81 kHz 31.25 kHz 62.5 kHz 250 kHz Timer Prescaler (1, 4, 16) 16 4 1 1 1 1 PR2 Value 0xFF 0xFF 0xFF 0x3F 0x1F 0x07 Maximum Resolution (bits) 10 10 10 8 7 5 |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |