Hello there,
I'm a beginner in PIC programming and I'm trying to run a simple Blinking Led program. I'm using MikroC Pro, Proteus 8 Professional and a K150 PIC programmer. I have a PIC 16F818.
The code is:
#pragma config OSC = INTIO1
#pragma config WDT = OFF
void main()
{
OSCCON = 0x70;
TRISA = 0x00;
PORTA = 0x00;
while(1)
{
PORTA = 0x01;
delay_ms(500);
PORTA = 0x00;
delay_ms(500);
}
}
The simulation in Proteus is working fine (although it takes 2 seconds for the led to blink). The K150 programmer seems to be working as well (it doesn't report any warnings). But when I set the circuit on the protoboard, the led lights up but never turns off. I've tried some variations of this code, using other ports, different delay times, but the same problem occurs. I don't think it is necessary to configure the internal oscillator or disable the watchdog timer, but I've tried it anyway. I've attached an image of the circuit simulation. The connections on the protoboard seems to be correct, with 5V on VDD (Pin 14) and GND on VSS (Pin 4).
Does anyone have any suggestions?