I have a project using MC9S08AW16, which has 2 timers one of 6 channels and other of 2 channels. I've been trying to set 4 diffrent pwm use divices (three of which use same period settings) and a timer interrupt with no use. Are there sharing limitations I need to know of? does centered alinged mode use all output pins as pwm? does edged alinged mode force all other channels to be only output or input mode with out another pwm option?
I would appriciate any reply, the data **bleep**s are not helpful.
The modules are independent, you have 2 of them one has 2 channels and the other one has 6 channels. all of the channels in a module can be configured for separate modes, "Each channel may be input capture, output compare, or buffered edge-aligned PWM"
- except for the center aligned PWM mode, which will place all channels into that mode. "A control bit in each TPM configures all channels in that timer to operate as center-aligned PWM functions." "Each TPM may be configured for buffered, center-aligned pulse-width modulation (CPWM) on all channels"
As far as I understood your application, you need to: - configure the second timer that has 6 channels for use with the 3 PWM lines that use the same period - configure the first timer that has 2 lines
Edge aligned mode can be set to some channels, so others can be set to output compare. You might need to enable Slew rate for the edge aligned channels. I found it to be sort of "noisy"
I created an applicatin once that used two channels to output a PWM, and two channels to record the PWM.
p.s. Using interrupts for the recording is easier than using polling (I think) I will post the code if I find it, it was a while ago.