PDA

View Full Version : CCPx Modules



Srigopal007
- 14th May 2005, 00:58
Hi Forum. I have a slight problem interfacing a few leds that are connected to the CCP modules. and the Duty cycle is determined by the input Switch that I have connected to various PortB, PortC and PortD pinouts.

I have set my PR2 Value to acheive a 1.24Khz frequency and a Pr4 Value to acheive a 20Khz frequency.

I am using CCP1, CCP3, CCP4 and CCP5 and all of them are configured under PWM mode. CCP1 is attached to PR2 and is running at 1.24khz. While CCP3, CCP4, CCP5 are attached to PR4 and is running at 20Khz.

My code works perfectly fine when I try to Increment and Decrement the duty cycle of CCP3, CCP4, and CCP5 with a few switches. I can even pause the Duty cycle from proceeding further as well with no problem. But, when I try to increment or decrement the Duty Cycle of the CCP1 with a switch, it will not do so. I basically have the same code for the Incrementing and Decrementing of the CCP3, 4 and 5. as I do with CCP1. Is there something I need to know when working with the CCP modules running at two differnt frequencies. I have attached my code along with this to give you a sense of what is going wrong. I know that it;s something very simple but I'm not catching it. Please help

Srig

mister_e
- 14th May 2005, 12:58
Hi Srig, Long time no see :) Glad to see you're not die!!!

As i become old, can you refresh my memory by telling what is your actual PIC?

Are all push-button pins set to digital and have <10K pull-ups resistors attach to? Had you try to do some LED BLINK when pressing on buttons related to CCP1?