May be the connections are loose on your breadboard. Also breadboard has more noise than vero-boards and PCBs. Have you used decoupling capaciotor (0.1uF) across Vdd-Gnd Pins of your PIC? If not connect it. It reduces considerable amount of noise. Make this as a practice. Always use decoupling capacitor across the power pins of all ICs in your project.
May be the connections are loose on your breadboard. Also breadboard has more noise than vero-boards and PCBs. Have you used decoupling capaciotor (0.1uF) across Vdd-Gnd Pins of your PIC? If not connect it. It reduces considerable amount of noise. Make this as a practice. Always use decoupling capacitor across the power pins of all ICs in your project.
Yes even that will work. But before changing make sure that the crystal is the one that is causing problem. Otherwise there is no point in changing it.
Also try to build your circuit on a vero board or PCB. It will really help if the problem is related to noise or loose connections.
Yes even that will work. But before changing make sure that the crystal is the one that is causing problem. Otherwise there is no point in changing it.
Also try to build your circuit on a vero board or PCB. It will really help if the problem is related to noise or loose connections.
LIST P=16F877
#include <P16F877.INC>
__CONFIG _CP_OFF & _WDT_ON & _BODEN_ON & _PWRTE_ON & _RC_OSC & _WRT_ENABLE_ON & _CPD_OFF
ORG 0x00
BSF STATUS, RP0 ;bank 1
CLRF TRISB ;make all portB pins output
CLRF TRISC
BCF STATUS, RP0 ;bank 0
AGAIN:
CLRWDT
MOVLW 0xFF
MOVWF PORTB ;put 0xFF in port B (all pins high)
MOVWF PORTC
goto AGAIN
END
There are a few small problems with your code. First, there is no code beyond the end statement. After executing this code segment, the PIC will proceed execution to whatever may exist beyond the code your programmed. Most likely it will be NOP and eventually the program counter will overflow back to 00h and no problem will be observed. However, you enabled the watchdog timer and without the CLRWDT instruction, the PIC will reset.
I also removed low voltage programming and debug options because they might interfere with execution.
It is likely a hardware problem. Go check with the oscillator pins if there is a signal using an oscilloscope or logic probe.