Using More than 1 CCP with Flowcode V5

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

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

Using More than 1 CCP with Flowcode V5

Post by medelec35 »

I have posted this so you can see how to use more than 1 PWM component with Flowcode V5.
Attached Flowcharts use 5 PWM components.
Thanks to opieflus for giving me the idea as I thought it would help people who are not sure how it is achieved.

The main thing to remember are:
1) You need to add an additional PWM component for each extra PWM channel your using.
E.g if your using 4 PWMs, you need to add 4 PWM components in total.

2) You must change PWM Channel of every PWM component used.
Also you you have to alter every Period register & and Prescaler divide, so all PWM components match.

If not, when compiling you will see something like:

Code: Select all

PWM  using components V1 (1).c(283): PWM prescale value must be the same in all PWM modules

1 errors detected
Error: preprocessing error

failure

....Return code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:
Although the error message is nice and clear.

Martin
Attachments
PWM using components V2.fcf
(24.02 KiB) Downloaded 529 times
PWM using components V1.fcf
(22.95 KiB) Downloaded 446 times
Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Using More than 1 CCP with Flowcode V5

Post by jgu1 »

Hi Martin!

Very nice and usefull. :D

Jorgen.

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

Re: Using More than 1 CCP with Flowcode V5

Post by medelec35 »

Thanks Jorgen.
So long that it helps, especially if you get use to V4 method.
V5 is great, but may be a bit confusing at first.

Martin
Martin

Post Reply