rgc
Junior Member level 1
I wrote a very simple C program on MPLAB to set all ports to high on a PIC 16F628A, it built okay on HI-TECH C, no erros, and it was programmed to the chip using PicKit 3 flawlessly... But it doesn't work, the pins wont go high!
I tried it with multuple PIC's.
I use MPLAB 8.45 on windows 7 and HI-TECH 9.81 lite (which is supposed to support W7)
This is the code:
What have I done wrong? Should I pick another compiler?
I tried it with multuple PIC's.
I use MPLAB 8.45 on windows 7 and HI-TECH 9.81 lite (which is supposed to support W7)
This is the code:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #include <htc.h> #include <pic16f628a.h> __CONFIG(BOREN_ON & CP_OFF & PWRTE_ON & WDTE_OFF & LVP_OFF & MCLRE_ON); void main(void){ CMCON = 0x07; //Comparators off TRISB = 0b00000000; //All ports to output TRISA = 0x00; while (1){ PORTB = PORTA = 0xFF; } }
What have I done wrong? Should I pick another compiler?