anderotegimendia
Newbie level 4
- Joined
- Feb 3, 2014
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 121
Hi:
I bought PICkit™ 1 FLASH Starter Kit (Pic12F675) and after dominating Assembly language I decided to do the same with C language.
I have used MPLAB and I put HI TECH software in it as well
The thing is that I have read manuals and watch videos and I have not been able to make it work at all with HI TECH C language. I have just been trying to turn on a led but It is impossible.
I have written this program:
I have configured bits and I think it is ok. When I compile/build it there is no error and it says that it has been built successfully but when I program the microchip though, nothing works, nothing comes on. I don't know what I am doing wrong but I am bit desperate.
I would appreciate if you gave a reply
Looking forward to hearing from you
Thanks
I bought PICkit™ 1 FLASH Starter Kit (Pic12F675) and after dominating Assembly language I decided to do the same with C language.
I have used MPLAB and I put HI TECH software in it as well
The thing is that I have read manuals and watch videos and I have not been able to make it work at all with HI TECH C language. I have just been trying to turn on a led but It is impossible.
I have written this program:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include <htc.h> #include <pic.h> __CONFIG(MCLRE_OFF & CP_OFF & CPD_OFF & BOREN_OFF & WDTE_OFF & PWRTE_ON & FOSC_INTRCIO); #define _XTAL_FREQ 400000 void main() { ANSEL = 0; // Set ports as digital I/O, not analog input ADCON0 = 0; // Shut off the A/D Converter CMCON = 7; // Shut off the Comparator VRCON = 0; // Shut off the Voltage Reference GPIO = 0; // Initializes GPIO with zero TRISIO= 0b001000; while(1) { GPIO= 0b010000; } }
I have configured bits and I think it is ok. When I compile/build it there is no error and it says that it has been built successfully but when I program the microchip though, nothing works, nothing comes on. I don't know what I am doing wrong but I am bit desperate.
I would appreciate if you gave a reply
Looking forward to hearing from you
Thanks
Last edited by a moderator: