masab_ahmad
Member level 1
Hi all,
I made a few codes on MikroC and used proteus to see the simulation. I am using a pic16f877a microcontroller. I firstly made this simple code, which didnt work in proteus:
void main()
{
TRISC = 0 ; // PORTC as outputs
PORTC = 0 ;
PWM1_Init(40000);
PWM1_Start();
while(1)
{
PWM1_Set_Duty(200);
}
}
Then I made this one, which gave me some strange waveforms( unwanted), at the CCP1 pin:
void main()
{
TRISC = 0 ; // PORTC as outputs
PORTC = 0 ;
while(1)
{
PWM1_Init(40000);
PWM1_Start();
PWM1_Set_Duty(200);
}
}
I don't understand what went wrong, the first code should have worked! I think proteus is the problem here, plz help....
I made a few codes on MikroC and used proteus to see the simulation. I am using a pic16f877a microcontroller. I firstly made this simple code, which didnt work in proteus:
void main()
{
TRISC = 0 ; // PORTC as outputs
PORTC = 0 ;
PWM1_Init(40000);
PWM1_Start();
while(1)
{
PWM1_Set_Duty(200);
}
}
Then I made this one, which gave me some strange waveforms( unwanted), at the CCP1 pin:
void main()
{
TRISC = 0 ; // PORTC as outputs
PORTC = 0 ;
while(1)
{
PWM1_Init(40000);
PWM1_Start();
PWM1_Set_Duty(200);
}
}
I don't understand what went wrong, the first code should have worked! I think proteus is the problem here, plz help....