Trying to learn some C with PICs and I've fallen over before I've even started.
I'm running MPLAB with PICC18 (lite student version). When I try to compile I get an error:
"Error - could not find definition of symbol 'TRISD' in file './01 Hello LED.o'. Errors : 1 Link step failed."
In the project I have "p18f45k20.h" included under header files, TRISD is defined in this file but the compiler seems to be looking for the definition in "01 Hello LED.o".
Anyone tell me what I've missed?
thanks Nik
// PIC18F46K20 Starter Kit Lesson 1 - Hello LED // This lesson turns on LED 7 on the demo board.
#pragma config FOSC = INTIO67 #pragma config WDTEN = OFF, LVP = OFF, MCLRE = OFF
#include "p18f45k20.h"
void main (void) {
TRISD = 0b01111111; // PORTD bit 7 to output (0); bits 6:0 are inputs (1)
LATDbits.LATD7 = 1; // Set LAT register bit 7 to turn on LED
while (1) ;
}