picBasic_Freak
New Member
Hello there,anyone of you know how to produce atleast 3 output of PWM signal using PICBasic or C?I cannot do it in the normal way by using timer because there is a significant delay when i just simply use the following code:
Loop: High 0 ' Turn on LED connected to PORTB.0
Pause 5 ' Delay for 5 miliseconds
Low 0 ' Turn off LED connected to PORTB.0
Pause 5 ' Delay for 5 miliseconds
High 1 ' Turn on LED connected to PORTB.1
Pause 5 ' Delay for 5 miliseconds
Low 1 ' Turn off LED connected to PORTB.1
Pause 5 ' Delay for 5 miliseconds
Goto loop ' Go back to loop and blink LED forever
End
if i am using the the above code i will not manage to produce simultaneous pulse with duty cycle of 50% for each of the output pins.Can anyone please help out of this ? Thanks The PIC i am using is PIC16F628 and this is limited to just 1 output of PWM signal if i followed the PWM module of the PIC >_<
Loop: High 0 ' Turn on LED connected to PORTB.0
Pause 5 ' Delay for 5 miliseconds
Low 0 ' Turn off LED connected to PORTB.0
Pause 5 ' Delay for 5 miliseconds
High 1 ' Turn on LED connected to PORTB.1
Pause 5 ' Delay for 5 miliseconds
Low 1 ' Turn off LED connected to PORTB.1
Pause 5 ' Delay for 5 miliseconds
Goto loop ' Go back to loop and blink LED forever
End
if i am using the the above code i will not manage to produce simultaneous pulse with duty cycle of 50% for each of the output pins.Can anyone please help out of this ? Thanks The PIC i am using is PIC16F628 and this is limited to just 1 output of PWM signal if i followed the PWM module of the PIC >_<