Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Generating two different PWMs from PIC18F2550

Status
Not open for further replies.

Matheus_Carvalho

Newbie level 6
Joined
May 6, 2010
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,356
Hi,
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.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top