Quote Originally Posted by gringo332 View Post
DEFINE OSC 20
DEFINE LOADER_USED 1 ;bootloader
main

x var byte
counter var byte

TRISB.1 = 0
TRISa.2 = 0
TRISB.2 = 0
high porta.2
low portb.2
pwm portb.1,150,200
counter = counter + 1

if counter > 127 then 'if counter is less than 128 turn led on
low porta.2 'if counter if greater than 127 turn led off
else
high porta.2
endif

goto main
end
Quote Originally Posted by gringo332 View Post
Thanks for the replies! I will look into it and let yall know what happens. Only thing is I don't remember this being a problem when I ran this same code on a 16f876.
If I was going to do the same thing and use the 'software' PWM command, I might change your original code to what I put above, or maybe use a word value instead of a byte and change the cutoff point to 32767, or reset the counter if it hits 100, or 10000, or whatever.