Log in

View Full Version : HPWM disrupts LOW/HIGH statement operation on the same pin.



CuriousOne
- 18th January 2025, 14:57
Hello.
I have PIC16F722

I have connected led to PORTC.2 via 1K resistor.

HIGH PORTC.2/LOW PORTC.2 works OK
HPWM 1,100,10000 also works OK
However, after the HPWM statement, HIGH/LOW on same port no longer works - PWM output remains always active.
Even if I set PWM duty cycle to 0 and disable it, pin still can't be controlled by HIGH/LOW statements.

I tried to re-initialize TRISC register after using HPWM statement by setting TRISC=0, but it does not help.

Any ideas how to fix this?

CuriousOne
- 18th January 2025, 15:03
OK, fixed it by myself, I'll just leave answer here, if anyone else will have same issue.
To return to normal use of that PWM pin, it is necessary to perform CCP1CON=0.