Go to Post Know that CD is a safe environment to learn to talk with a foot in your mouth. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-04-2008, 23:16
Farnak Farnak is offline
Registered User
no team
 
Join Date: Apr 2008
Location: Canada
Posts: 2
Farnak is an unknown quantity at this point
Invalid Address

Hi, I've searched for previous threads about this problem but none of them seemed to have solved it.

I'm trying to learn how to program a robot so I'm just following the included Getting Started Guide for the MPLab. Compiling my C file gives me no problem. However, when I try to load my hex file onto the IFI loader it gives me the following message:

Invalid Address: 0x0 (Correct Range: 0x800 - 0x7fff)

For some reason, when I load the default hex files that came with the MPLab it works perfectly.

Can anyone please explain why I get this error message?
  #2   Spotlight this post!  
Unread 14-04-2008, 00:16
Jim E Jim E is offline
Registered User
FRC #1523 (M.A.R.S.)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Lantana, FL
Posts: 188
Jim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond repute
Re: Invalid Address

I suspect your file is the culprit.

Post it. Maybe someone then can help you.

The default code is something to build upon. It basically handles all of the background code you need for the processor in the controller.

State machine programming based on the default code model will prevent many issues.

Do not use While loops in your programming. The processor requires updates every 26.2 mS to avoid the red-light-of-death.

Search Kevin Watson's site or IFI's site for more programming tips.

Good Luck.
__________________
Team MARS = 1.523 AU from the SUN!

Jim E.
  #3   Spotlight this post!  
Unread 14-04-2008, 11:27
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,693
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Invalid Address

Quote:
Originally Posted by Farnak View Post
I'm just following the included Getting Started Guide for the MPLab.
MPLAB is a generic product, so the examples assume you are using a PIC straight out of the box. That's not the case for the First or Vex controllers.
If you want to use the Getting Started examples as they are, then you'll need a PIC development board. I'd suggest getting a Pickit2 development set. Choose one that comes with the programmer to download your code combined with a development board to do the MPLAB exercises on.

Program memory on the FRC/Vex Robot Controller is reserved for other purposes before 0x800. There are also other restrictions due to the FIRST specific architecture of this particular controller that will make it difficult to use.

If you want to use it to learn to code on an FRC Robot Controller then it's probably easiest to start with Kevin Watson's basic default code and study how that works. Specifically, ifi_frc_simple.zip.
There are also the tutorials on FIRST's page that use the IFI default code as a basic start.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 15-04-2008 at 09:49. Reason: added specifics & Pickit2 note
  #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.
  #5   Spotlight this post!  
Unread 17-04-2008, 19:09
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: Invalid Address

If you want to program starting from scratch on the RC, there are two things you're going to have to deal with:

1. There are 2 PIC18F8722's in the RC, the master and the user. You have no control over the master processor and full control of the user. The master and the user are linked and communicate with each other. I think you can safely ignore the data sent from master to user, but if you don't send data from user to master about every 25 ms (40 Hz), then the master will kill the RC.

2. When IFI loader downloads code onto the user, it adds a bootloader to 0x000 through 0x7FF. This means you have to add 0x800 to the reset vector and interrupt vectors, and you also have to make sure none of your code gets placed in 0x000 to 0x7FF (with the linker script).

It's much easier to just start with the default code and take out things you don't need.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Address team 803 Programming 20 21-02-2006 09:10
error - Invalid 18f8520 header file! vtrehan Programming 2 16-11-2004 08:31
Invalid Thread Specified Jay H 237 CD Forum Support 2 02-03-2004 21:01
Invalid Autodesk email address? NickZ 3D Animation and Competition 2 23-02-2004 01:35
Address archiver 2000 0 23-06-2002 23:22


All times are GMT -5. The time now is 12:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi