CrazyEngineers
  • help with pic16f877+generation of 120khz pwm

    preeste

    Member

    Updated: Oct 26, 2024
    Views: 1.2K
    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]



    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
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Home Channels Search Login Register