S.O.S! timer sharing error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S.O.S! timer sharing error

1,485 Views
rm
Contributor I
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.
Labels (1)
0 Kudos
3 Replies

308 Views
Andrey
Contributor III
rm,


      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.


Message Edited by Andrey on 2007-06-06 03:35 PM
0 Kudos

308 Views
Andrey
Contributor III
I found the code, we did the project back in college

Pages 5,6,7,8 talk about the TPM part

Last pages have a flow chart for the TPM functionality

page 16 has source code for the controller we used HC9S08GB60 demo board

http://home.comcast.net/~starwreck/FinalReport.pdf


Let me know if you have problems reading the code, it was our first real take at microcontrollers.


--
Alban Edit: link highlight


Message Edited by Alban on 2007-06-06 08:22 PM
0 Kudos

308 Views
rm
Contributor I
0 Kudos