| Electronic Components Datasheet Search |
|
PIC18F1230-E/ML Datasheet(PDF) 121 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC18F1230-E/ML Datasheet(HTML) 121 Page - Microchip Technology |
|
121 / 312 page ![]() PIC18F1230/1330 © 2006 Microchip Technology Inc. Advance Information DS39758B-page 119 13.3.1 FREE-RUNNING MODE In the Free-Running mode, the PWM time base (PTMRL and PTMRH) will begin counting upwards until the value in the PWM Time Base Period register, PTPER (PTPERL and PTPERH), is matched. The PTMR registers will be reset on the following input clock edge and the time base will continue counting upwards as long as the PTEN bit remains set. 13.3.2 SINGLE-SHOT MODE In the Single-Shot mode, the PWM time base will begin counting upwards when the PTEN bit is set. When the value in the PTMR register matches the PTPER register, the PTMR register will be reset on the following input clock edge and the PTEN bit will be cleared by the hardware to halt the time base. 13.3.3 CONTINUOUS UP/DOWN COUNT MODES In Continuous Up/Down Count modes, the PWM time base counts upwards until the value in the PTPER register matches the PTMR register. On the following input clock edge, the timer counts downwards. The PTDIR bit in the PTCON1 register is read-only and indicates the counting direction. The PTDIR bit is set when the timer counts downwards. 13.3.4 PWM TIME BASE PRESCALER The input clock to PTMR (FOSC/4) has prescaler options of 1:1, 1:4, 1:16 or 1:64. These are selected by control bits, PTCKPS<1:0>, in the PTCON0 register. The prescaler counter is cleared when any of the following occurs: • Write to the PTMR register • Write to the PTCON (PTCON0 or PTCON1) register • Any device Reset Table 13-1 shows the minimum PWM frequencies that can be generated with the PWM time base and the prescaler. An operating frequency of 40 MHz (FCYC = 10 MHz) and PTPER = 0xFFF are assumed in the table. The PWM module must be capable of generating PWM signals at the line frequency (50 Hz or 60 Hz) for certain power control applications. TABLE 13-1: MINIMUM PWM FREQUENCY 13.3.5 PWM TIME BASE POSTSCALER The match output of PTMR can optionally be postscaled through a 4-bit postscaler (which gives a 1:1 to 1:16 scaling inclusive) to generate an interrupt. The postscaler counter is cleared when any of the following occurs: • Write to the PTMR register • Write to the PTCONx register • Any device Reset The PTMR register is not cleared when PTCONx is written. 13.4 PWM Time Base Interrupts The PWM timer can generate interrupts based on the modes of operation selected by the PTMOD<1:0> bits and the postscaler bits (PTOPS<3:0>). 13.4.1 INTERRUPTS IN FREE-RUNNING MODE When the PWM time base is in the Free-Running mode (PTMOD<1:0> = 00), an interrupt event is generated each time a match with the PTPER register occurs. The PTMR register is reset to zero in the following clock edge. Using a postscaler selection other than 1:1 will reduce the frequency of interrupt events. Note: Since the PWM compare outputs are driven to the active state when the PWM time-base is counting downwards and matches the duty cycle value, the PWM outputs are held inactive during the first half of the first period of the Continuous Up/Down Count mode until the PTMR begins to count down from the PTPER value. Note: The PTMR register is not cleared when PTCONx is written. Minimum PWM Frequencies vs. Prescaler Value for FCYC = 10 MIPS (PTPER = 0FFFh) Prescale PWM Frequency Edge-Aligned PWM Frequency Center-Aligned 1:1 2441 Hz 1221 Hz 1:4 610 Hz 305 Hz 1:16 153 Hz 76 Hz 1:64 38 Hz 19 Hz |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List 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 |