This thread was about an antiquated 16F877. I try to use only later model processors (2009 at the oldest). If a PORT pin is declared as a PWM port, none of the following will have any affect on that pin:
HIGH PWMpin
LOW PWMpin
HIGH LAT[PWMpin]
LOW LAT[PWMpin]
PWMpin = 0
PWMpin = 1
In other words, if you wanted to turn the output off, HPWM 1, 0, Freq
To turn it fully on, HPWM 1, 255, Freq.
With that said, the above methods of altering pins on a port will not affect PWM output (at least on the processors I use).




Bookmarks