Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] pic pwm problem using pic16f877a

Status
Not open for further replies.

bhoobalan

Member level 1
Joined
Dec 28, 2013
Messages
35
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
280
Hello friends,
I am generating pwm signal in CCP1CON and CCP2CON of PIC16F877A controller and also i connected two led's across the pin with resistor's. I am getting output in the oscilloscope but the led's are blinking, why the led's are blinking?
How should i rectify the blinking of led's? There is a voltage variation also why it happens?
I have attache my code and circuit diagram.
Pls reply me

Thank you
 

Attachments

  • PWM error.png
    PWM error.png
    44.7 KB · Views: 111
  • PWM error.txt
    946 bytes · Views: 58

Where is the voltage variation?

I suspect your problem is in the values you load into CCPR1L1 and CCPR2L. The frequency you are askig for is not possible with this PIC, in fact the lowest frequency PWM it can generate is 1.22KHZ, more than 10 times higher than your software suggests. I would guess the flashing LEDs is due to the software delays you added in the loop before loading the CCPR registers. In PWM mode the hardware generates the output, you can adjust it but you shouldn't have to keep reloading it.

Brian.
 

You have set CCPRx > PR2 which doesn't work. You should set PR2 to 0xFF.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top