Thread: Invalid Address
View Single Post
  #4   Spotlight this post!  
Unread 17-04-2008, 16:15
Farnak Farnak is offline
Registered User
no team
 
Join Date: Apr 2008
Location: Canada
Posts: 2
Farnak is an unknown quantity at this point
Re: Invalid Address

Hi, my code is just directly copied from the getting started doc that came with the MPLAB IDE (I'm a newbie I'm still trying to learn how to program with a microchip controller), that's why I don't understand why THIS CODE, that came with the tutorial can't load .

Here's the source code:
Code:
#include <p18cxxx.h> 

#pragma config OSC = HS
#pragma config WDT = OFF
#pragma config LVP = OFF
int counter;
void main (void)
{
	counter = 1;
	TRISB = 0;
	while (counter <= 15)
	{
		PORTB = counter;
		counter++;
	}
}
All the other code files that you guys posted seem to work for me, I can load them onto the IFI loader no problem. But my source code gets compiled into a HEX file that just fails. This I don't understand.