0
\$\begingroup\$

I am trying to replicate a circuit containing PIC16F882 that I found in an electronic appliance. I wrote code in MikroC that perfectly follows that logic, but the peak voltage of the CCP pin that I'm using for PWM barely crosses 3V. I checked the same using Proteus simulator first, and I got similar values of voltage.
However, the output voltage from the CCP pin is 5V in the circuit I have, which does not contain any amplifier. Is there any way to increase the output voltage of the CCP pin upon using PWM? I find that other digital output pins do have about 5V output, except the CCP pin.
I have read in other forums and asked around, and FYI I did put ANSEL = ANSELH = 0 in the beginning of the code.

Edit:: As requested by many, following is the circuit schematic, as made in proteus. Ignore the components disconnected.High res image updated.enter image description here

\$\endgroup\$
  • \$\begingroup\$ At what voltage are you powering the PIC? The CCP pin is basically like any other digital output; it just drives to either GND (Vss) or supply rail (Vdd). Not sure why you would expect it to go higher than its own supply rail. \$\endgroup\$ – Vince Patron Jan 10 '17 at 21:25
  • \$\begingroup\$ The voltages powering the microcontroller are +5V and GND. I think it's fair to expect at least a bit lower than 5V at an output pin. \$\endgroup\$ – scienceauror Jan 10 '17 at 21:29
  • 1
    \$\begingroup\$ What do you have externally connected to the CCP pin? A schematic would be useful here. Also, post your code (or a least a shortened version that demonstrates the same symptom). \$\endgroup\$ – Dan Laks Jan 10 '17 at 21:33
  • 1
    \$\begingroup\$ Did you read the PIC datasheet on how much current it can put out? And are you exceeding that current? The spec is usually called "Voh" (Voltage, output high) and will tell you how close it can get to the rail at some specified output current at a specified Vdd voltage. \$\endgroup\$ – Vince Patron Jan 10 '17 at 21:37
  • 1
    \$\begingroup\$ Sounds like whining but the schematic is a bit low-res, unfortunately. I can see a 2 K pull-up to some rail, is that to 5 V? What's the 'voltage generator'-looking symbol shown loading the CCP pin near the 2 K? \$\endgroup\$ – TonyM Jan 10 '17 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.