# PIC16F887 PWM multiple output

I am trying to design a control for a BLDC motor with a PIC16F887.

I have managed to activate a PWM output and be able to vary it with a potentiometer. The point is, I need to get 6 PWM signals out.

When I change the CCP1CON I can vary the PWM output but it is always one.

I attach the part of my code where I configure the PWM.

void PWM_Initialize()
{
PR2 = ("%#x", (_XTAL_FREQ/(PWM_freq*4*TMR2PRESCALE)) - 1);
CCPR1L = 0x1F;
RC1 = 0;
RC2 = 0;
T2CON = 0x03;
CCP1CONbits.CCP1M = 0b1100;
CCP1CONbits.P1M = 0b00;
TMR2 = 0;
T2CONbits.TMR2ON = 1; //Timer 2 ON
}


How can I activate multiple PWM outputs?

• You've chosen the wrong micro for this job. Your PIC16F877 only has 1 PWM module. May 25, 2020 at 21:03
• @brhans Thanks for your answer. I have seen examples with this PIC16F887 where they generate 6 PWM signals. How do they do that? With the TIMER? It is a great question that I have.
– Geo
May 26, 2020 at 6:02
• Please cite the examples so we can discuss - otherwise we can only speculate. May 26, 2020 at 13:42