PWM on 16F877A

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
jack26
Posts: 23
Joined: Sun Oct 09, 2011 4:38 pm
Has thanked: 4 times
Been thanked: 2 times

PWM on 16F877A

Post by jack26 »

Using a 16F877A micro in a project and require the 2 PWM outputs on RC1 and RC2.

I have set the ports up as per attached test file but can only get an output on RC2. I have tried changing the duty cycle so I could see which one was going to RC2 but all that did was shift the duty as the program executed which suggests that although I have set up PWM 0 and PWM 1 both of these go to RC2 ??. RC1 did nothing at all. I guess that I am missing something really obvious here..........

Thanks in advance Jack
Attachments
Simple 2CH Stepper.fcf
(34.82 KiB) Downloaded 263 times

jack26
Posts: 23
Joined: Sun Oct 09, 2011 4:38 pm
Has thanked: 4 times
Been thanked: 2 times

Re: PWM on 16F877A

Post by jack26 »

Sorry forgot to mention that the test code is only the 'main' and 'declared variables b0 and b1. The rest is redundant at the moment.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: PWM on 16F877A

Post by medelec35 »

Hi Jack,
Since your using Flowcode professional V5, to receive better support please can you sign up for the correct Flowcode topic by clicking on this link please:
http://www.matrixmultimedia.com/mmforum ... =46&t=9958

To sort your issue out, you need to right click on the lower PWM (PWM2) on your control panel, select Ext properties and change PWM Channel from 1 to 2

Martin
Martin

jack26
Posts: 23
Joined: Sun Oct 09, 2011 4:38 pm
Has thanked: 4 times
Been thanked: 2 times

Re: PWM on 16F877A

Post by jack26 »

Thanks Martin, life will be easier tomorrow.....

Sorry for post in the wrong area and will use link next time.

Noticed that you are looking for commercial applications of Flowcode so will send you details of final project when complete because its for commercial use. Part of an auto-start system for our engine test rigs used in unmanned air vehicles.

Thanks again Jack

Post Reply