Hi everybody,
i'm working in an on board electronic company and i have a little problem.
I have to generate four different frequency outputs using Capcom2 unit on CC18 to CC21, my problem is that there is only two timers available for this capcom unit... And i really need 4 different outputs (frequency AND duty cycle) on these pins.
So i'm wondering if it's possible to use timers from capcom unit 1 and using outputs from capcom 2 unit or anything like that.
Thanks a lot to everyone who will help me.
P.S : i'm using an XC161CJ microcontroller
Double compare mode allows you to use one channel to cause a rising edge and the paired channel for the falling edge. You can have multiple events during one timer period. So you can configure the timer for the slowest (longest period) time (PWM controlled strictly by hardware) and then create other channels within that period but you need interrupts on each of the edges to calculate the next event for each additional PWM channel.
Other possibilities could be to use the timer as free running and use compare mode 1 to toggle the events (again using interrupts, to control the period and duty cycle).
Thank you for the answer !
Well, i think that your last solution is the best to fit my situation. But i already solved it using timers 3 and 4 and completing the output at each interruption.
But i'll keep your answer in mind for my future developments.
Thanks again.