English
Language : 

TSC80251A1 Datasheet, PDF (83/166 Pages) TEMIC Semiconductors – Extended 8-bit Microcontroller with Analog Interfaces
TSC 80251A1
To program a Compare/Capture module for the PWM mode:
D Set ECOMx and PWMx bits in the module’s CCAPMx register. Table 6.1. lists the bit
combinations for selecting module modes.
D Select the desired input for the PCA Timer/Counter by programming CPS0 and CPS1 bits in
CMOD register.
D Enter an 8–bit value in CCAPxL to specify the duty cycle of the first period of the PWM output
waveform.
D Enter an 8–bit value in CCAPxH to specify the duty cycle of the second period.
D Set the Timer/Counter run Counter bit (CR in CCON register) to start the PCA Timer/Counter.
Note:
To change the value in CCAPxL without glitches, write the new value to the high byte register (CCAPxH). This
value is shifted by hardware into CCAPxL when CL rolls over from FFh to 00h.
The frequency of the PWM output equals the frequency of the PCA Timer/Counter input signal
divided by 256. The highest frequency occurs when the FOSC/4 input is selected for the PCA
Timer/Counter. For FOSC = 16 MHz, this is 15.6 KHz.
CL rollover from FFH TO 00h
loads CCAPxH contents into
CCAPxL
CCAPxH
CL (8 bits)
x = 0, 1, 2 or 4
CCAPxL
8-Bit
Comparator
“0”
CL < CCAPxL
CL >= CCAPxL
“1”
CEX
– ECOMx 0 0 0 0 PWMx 0
7
CCAPMx Mode Register
0
Figure 6.5. PWM mode
Rev. B (20/09/96)
II. 6.9