I'm used to make codes for just one PWM, but now I need to control a step motor and a dc motor. My problem is I have to generate 2 very different frequencies. I'm using C18, and what I saw in datasheet is that I just can change the value in function OpenPWMx(XX), because TMR2 Prescale Value and Tosc are equal for both. However, I made a code and simulated in proteus, when I put a very low value, the both PWM doesn't work, when I put a higher value they seems to oscilate equal. I thought using a pwm code but I need to use A/D converter and another digital sensors. So I need to use pwm pins.
Someone could help me? Is there a way to make it right?
Thanks,
ps: My english is not so good, so I'm sorry if it's hard to understand something.
I was reading Pic18f2550's datasheet and seems I could use TMR3 and TMR1 for PWM1 e PWM2, so there is a different frequency source for each PWM. But I couldn't make it work. Someone knows how to do it?
Thanks for helping.