PWM Woes
-
- Valued Contributor
- Posts: 1543
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 352 times
- Been thanked: 551 times
Re: PWM Woes
Hi
In your component properties you forgot to assign your PWM timer.
Once assigned (in this case timer 2) you can then base your duty cycle on your Period value. You have chosen 1000Hz which FC calculates out as Prescaler = 64 and Period = 77 for your oscillator values (external, 20MHz).
I usually set this in the chart too.
You can then figure out your values to give 0-100% cycles based on your PIC capabilities.
Regards
In your component properties you forgot to assign your PWM timer.
Once assigned (in this case timer 2) you can then base your duty cycle on your Period value. You have chosen 1000Hz which FC calculates out as Prescaler = 64 and Period = 77 for your oscillator values (external, 20MHz).
I usually set this in the chart too.
You can then figure out your values to give 0-100% cycles based on your PIC capabilities.
Regards
Re: PWM Woes
I tried that a few times. Currently I have tmr2 assigned. but the simulated scope shows a dead line. Pic chip is 12f1840
Last edited by alanwms on Mon May 12, 2025 10:09 pm, edited 1 time in total.
-
- Valued Contributor
- Posts: 1543
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 352 times
- Been thanked: 551 times
Re: PWM Woes
Hi
I have no access to hardware at present but the component gave the correct responses to my test values when simulating. If I get time later I'll look at "scope", but did you set it on the correct pin?
Regards
I have no access to hardware at present but the component gave the correct responses to my test values when simulating. If I get time later I'll look at "scope", but did you set it on the correct pin?
Regards
Re: PWM Woes
I have no hardware at this time. I'm simply attempting to assure operation using the scope component so I can verify theoretical output. I may hook up the chip for test if I can't get the simulation scope to play.
I assigned multiple pins to the scope thinking that the incorrect pin was allocated - no luck. All four traces dead. No pins worked for me. I am pretty sure I'm not setting something in FC?
I assigned multiple pins to the scope thinking that the incorrect pin was allocated - no luck. All four traces dead. No pins worked for me. I am pretty sure I'm not setting something in FC?