Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Config on PIC12F629 to blink LED with C

Status
Not open for further replies.

Bibihest

Electrical
Sep 25, 2011
1
I started learning PIC some days ago and have played around with different tutorials. Many of the tutorials I have read, doesn't work for me. I always have to change stuff in the code to make it work, so I actually havn't had any succes yet.

Now I have some code, that SHOULD work (if yiu ask me), but it doesn't. It builds without any errors, byt after burning it, nothing happends. No LED's are blinking or anything.

Could someone please help me figure out why this is not working and maybe explain why. I have read alot of pages on the net, but havn't found anything that could give me a solution, so now I have to ask for help. Thanks

I'm working with a 12F629 and Pickit 1

#include

#define _XTAL_FREQ 4000000 // oscillator frequency
#include // defines DelayMs()

__CONFIG(FOSC_INTRCIO & WDTE_OFF & CP_OFF & MCLRE_OFF);

void main()
{

// Initialisation
TRISIO = 0b111100;

// Main loop
for (;;) {
GP0 = 1;
GP1 = 1;

__delay_ms(200);

GP0 = 0;
GP1 = 0;

__delay_ms(200);

}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor