Alright well I got the PICkit 1 today, and the first thought that came through my mind, "Well alright the tutorials have got to be pretty useful!" After the first tutorial I was already lost in the example assembly source code (I got the code to compile and run on a PIC fine, it's just with Assembly I'm lost).
So I tried going though the booklet and try to look at the documentation provided with the source code and kinda felt overwhelmed on how much I would have to remember and decided to go with something I know pretty well is C.
After going through compilers and trying and testing things out and got the MikroC compiler and tried to run this source code:
All it does, no matter what I do is turn the D2 and D3 LEDs on and off on the PICKit and the Delay_ms seems to be working. It's just not turning one LED on and off I expected.
So I don't know what I'm doing wrong, the code compiles fine, but I don't get much different results and I know I should use C since it's easier for me to use, but I just have no idea what is up with finding a good C compiler that I can use the PIC16F648 with.
So I tried going though the booklet and try to look at the documentation provided with the source code and kinda felt overwhelmed on how much I would have to remember and decided to go with something I know pretty well is C.
After going through compilers and trying and testing things out and got the MikroC compiler and tried to run this source code:
Rich (BB code):
void main() {
ANSEL = 0; // Configure AN pins as digital
// ANSELH = 0;
// C1ON_bit = 0; // Disable comparators
// C2ON_bit = 0;
TRISA = 0x00; // set direction to be output
//TRISA = 0x00; // set direction to be output
//TRISC = 0x00; // set direction to be output
//TRISD = 0x00; // set direction to be output
do {
PORTA = 0x00; // Turn OFF LEDs on PORTA
//PORTB = 0x00; // Turn OFF LEDs on PORTB
// PORTC = 0x00; // Turn OFF LEDs on PORTC
//PORTD = 0x00; // Turn OFF LEDs on PORTD
Delay_ms(5000); // 1 second delay
PORTA = 0xFF; // Turn ON LEDs on PORTA
//PORTB = 0xFF; // Turn ON LEDs on PORTB
// PORTC = 0xFF; // Turn ON LEDs on PORTC
//PORTD = 0xFF; // Turn ON LEDs on PORTD
Delay_ms(5000); // 1 second delay
} while(1); // Endless loop
}
So I don't know what I'm doing wrong, the code compiles fine, but I don't get much different results and I know I should use C since it's easier for me to use, but I just have no idea what is up with finding a good C compiler that I can use the PIC16F648 with.
Last edited: