View previous topic :: View next topic |
Author |
Message |
landert_stift
Joined: 10 Nov 2005 Posts: 2 Location: Switzerland
|
Problems with PIC18C601 (Invalid ORG range) |
Posted: Thu Nov 10, 2005 8:54 am |
|
|
Hi
I'm a new member and I'm still learning English, so it wouldn't be the best English;-)
I have a Problem with the PIC18C601, I wrote a programm with the "MPLAB IDE v7.2" and compiled it with the "PCWH Compiler IDE Version 3.212"! But every time when I compile, the error 126: "Invalid ORG range" comes!!!
After I wrote an example program like this:
Code:
-------------------------------------------
#include <18C601.h>
#fuses HS ,NOWDT, PUT
void main ()
{
while(1);
}
--------------------------------------------
But when I compile, the output shows like this:
Output:
--------------------------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Programme\PICC\Ccsc.exe" "main.c" +FH +DF +LN +T -A +M +Z +Y=9 +EA
>>> Warning 203 "H:\SOMI\PIC- Programm\main.c" Line 7(1,1): Condition always TRUE
--- Info 300 "H:\SOMI\PIC- Programm\main.c" Line 10(0,1): More info: Attempted to create: 00000-00002 for reset
*** Error 126 "H:\SOMI\PIC- Programm\main.c" Line 10(0,1): Invalid ORG range
1 Errors, 1 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Thu Nov 10 15:40:59 2005
--------------------------------------------------------------------------------------
I don't now what to do! What do I have to do to eliminate this problem??
Can someone help me?
Thank's
landert_stift |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 10, 2005 12:41 pm |
|
|
The 18C601 has no internal ROM. So in this case, you have to use
the CCS #build() statement to tell the compiler where the external
ROM is located. I was able to make your program compile with
no errors by adding the statement shown in bold below. I got
the address range from Figure 4-1 in the 18C601 data sheet.
Look in the CCS manual for more information on the #build statement.
The manual can be downloaded here:
http://www.ccsinfo.com/ccscmanual.zip
Quote: |
#include <18C601.h>
#fuses HS ,NOWDT, PUT
#build(memory=0x00000:0x3FFFF) // Define external memory locations
void main ()
{
while(1);
} |
|
|
|
landert_stift
Joined: 10 Nov 2005 Posts: 2 Location: Switzerland
|
|
Posted: Thu Nov 10, 2005 3:23 pm |
|
|
Thank you very much! Now it works! |
|
|
|