Hi Ibra,
I'm very new to this but have had to same problem. I think I was using PortA and had to set it to digital with ANSEL=0 for TOGGLE to work but
PortB.0 High
pause 200
Portb.0 Low
May also work. This shouldn't be the case here as PortB is already Digital.
The other thing could be if you had Low voltage Programming (LVP) enabled at programming.
You also have PortB.3 set as an input. This is also the PGM pin and if its not tied low the pic may keep resetting itself if the pin floats High.
See how you go.
Mike
Bookmarks