Hello guys I wanted to generate 4.9kHZ Pwm using Pic micro controller with out using in build functions.I am using PIC16F87XA mcu this time .
Here is my code
Here is the steps that i have followed
BUT while simulating it in proteus i did not get any result from RC2 PIN(CCP1 pin of PC microcontroller) i did not get any pulse from the pin.
What is the problem??
Here is my code
Code:
void main()
{
PR2=0x65; // Frequency: 4.90 kHz
CCP1CON=0b00001100; //Configure the CCP1 module
T2CON.T2CKPS0 = 1;
T2CON.T2CKPS1 = 0;
TRISC.B2 = 0; // make port pin on C as output
while(T2CON.TMR2ON = 1) //Infinite Loop
{
}
}
BUT while simulating it in proteus i did not get any result from RC2 PIN(CCP1 pin of PC microcontroller) i did not get any pulse from the pin.
What is the problem??