Suleman
Newbie level 2
> Hi, Im using a PIC for the first time (PIC16f676), I downloaded a hex file for an LED Blinking project from here:
blink a LED
and it worked perfectly, but then Itried writing my own program in C (MPLAB and HITEC C compiler), and it doesnt work, even though the circuit is the same for both the hex i downloaded and the program I made:
Any idea why it isnt working on the breadboard, even though it simulates pefectly in Proteus (ISIS)?
blink a LED
and it worked perfectly, but then Itried writing my own program in C (MPLAB and HITEC C compiler), and it doesnt work, even though the circuit is the same for both the hex i downloaded and the program I made:
Code:
#include<htc.h>
__CONFIG(BGHIGH & UNPROTECT & BORDIS & MCLRDIS & PWRTEN & INTOSCCLKO & WDTDIS);
#define _XTAL_FREQ 4000000
void main()
{
TRISC=0;
for(;;)
{
PORTC=0x1f;
__delay_ms(500);
PORTC=0;
__delay_ms(500);
}
}
Any idea why it isnt working on the breadboard, even though it simulates pefectly in Proteus (ISIS)?