Using other PWM outputs aside from CCP1 and CCP2

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
paulm
Posts: 36
Joined: Mon Mar 28, 2011 9:37 pm

Using other PWM outputs aside from CCP1 and CCP2

Post by paulm »

Hi,

I'm using the PIC16F1824 which is a 14pin IC.

I am using 2 PWM channels (CCP1 and CCP2) to drive a DC motor differentially for forward and reverse positional control.

CCP1 and CCP2 are located at pins 5 and 7 of the IC which are on the left hand side of the chip.

The PIC16F1824 supports 4 PWM outputs (CCP1, CCP2, CCP3 CCP4).

I would like to use CCP3 and CCP4 instead due to PCB layout reasons which are on pins 11 and 9 respectively since they are on the right hand side of the IC.

Does Flowcode support using other PWM modules aside from CCP1 and CCP2. If so, how do I use the CCP3 and CCP4 modules when using the PWM macro in flowcode?

Thanks,
Paul

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using other PWM outputs aside from CCP1 and CCP2

Post by Benj »

Hi Paul,

Flowcode v5 supports the additional PWM channels. Otherwise you could maybe use software generated PWM using a timer interrupt as shown here.

http://www.matrixmultimedia.com/article.php?a=52

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times

Re: Using other PWM outputs aside from CCP1 and CCP2

Post by brandonb »

you can make simple pwms that go to any pin on the micro http://www.matrixmultimedia.com/mmforum ... 26&t=11590

Post Reply