problem with pic16f877a !!!
i try to use pic16f877a for the first time..
i connected the following :
1- 10k resistor to pin 1
2- +5v to pin 11
3- GND to pin 12
4- 4MHz crystal to pin 13,14 just
and i tryed to light a led on portb.0 by this small code:
DEFINE OSC 4
TRISB = %11111110
MAIN:
PORTB.0 = 0
PUASE 200
TOGGLE PORTB.0
PUASE 200
GOTO MAIN
i programmed this code into pic16f84a and worked very well.
but in pic16f877a , there is no any output , led is off for ever.
i changed the crystal, and the voltage regulator, and the problem is still !!!
what is the probelm??
Maybe high and low will work
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