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);
}
}
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);
}
}