help with pic16f877+generation of 120khz pwm
hey there guys. I need some help urgently. using the setup of the PIC i have attached to this thread can someone please help me with the following:
![[IMG]](proxy.php?image=http%3A%2F%2Fwww.electro-tech-online.com%2Fattachments%2Fmicro-controllers%2F34772d1256630289-120khz-square-wave-generation-pic_timers.jpg&hash=7b0c409b46ef686b3536c8dc30b4f263)
I want to use the ccp1 module in pwm mode to generate a 120khz square wave with a duty cycle of 50%.
once this is done, the ccp1 module should be continuosly enabled and the trisc bit for the pin is used to gate the pwm output. when the trisc bit is set, the pin is an input and the 120khz is not presented to the pin(rc3) but when trisc is clear the pin becomes an output with the 120Khz signal on it.
lets say i have a switch connected to RB1. When this switch is pressed, the 120khz square wave is outputted on the RC3 pin for a period of only 1ms. How do i do this?
Can someone please help me with this. Can you show me what the C code would look like to do the above.
![[IMG]](proxy.php?image=http%3A%2F%2Fwww.electro-tech-online.com%2Fattachments%2Fmicro-controllers%2F34772d1256630289-120khz-square-wave-generation-pic_timers.jpg&hash=7b0c409b46ef686b3536c8dc30b4f263)
I want to use the ccp1 module in pwm mode to generate a 120khz square wave with a duty cycle of 50%.
once this is done, the ccp1 module should be continuosly enabled and the trisc bit for the pin is used to gate the pwm output. when the trisc bit is set, the pin is an input and the 120khz is not presented to the pin(rc3) but when trisc is clear the pin becomes an output with the 120Khz signal on it.
lets say i have a switch connected to RB1. When this switch is pressed, the 120khz square wave is outputted on the RC3 pin for a period of only 1ms. How do i do this?
Can someone please help me with this. Can you show me what the C code would look like to do the above.
0