I was setting up a PIC16F628A for a simple Hello World program (blinking LED) and somewhere in the process, I have failed. The LED stays lit at the specified pin and does not "blink". I am using the Internal Oscillator (which resonates at 4 MHz). This is my code (Using the XC8 Compiler):
#include <xc.h>
__CONFIG(FOSC_INTOSCIO & WDTE_OFF & PWRTE_OFF & MCLRE_OFF & BOREN_ON & LVP_ON & CPD_OFF & CP_OFF);
#define _XTAL_FREQ 4000000
int main() {
TRISB0 = 0;
while(0) {
RB0 = 1;
__delay_ms(1000);
RB0 = 0;
__delay_ms(1000);
}
return (0);
}
And my schematic:
I have read that this might be a MCLR problem but I have configured the fuses to set MCLR as an input pin as shown in the code.