CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Porting PIC16F877 to PIC18F458 problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
xav27
Guest







Porting PIC16F877 to PIC18F458 problem
PostPosted: Mon Apr 26, 2004 7:43 am     Reply with quote

Hello everybody,

I'm trying to compile a program written for a PIC16F877 to a PIC18F458.

I only changed #include <18F458.h> and PCWH give me an error :
"Out of ROM, A segment or the program is too large" !

PCWH V3.187
here is a part of my code


#include <18F458.h>
//#include <16F877.h>
#include "register.h"
#fuses HS,NOWDT,NOPUT,NOBROWNOUT,NOPROTECT,NOWRT,NOCPD,NOLVP

#use delay(clock=20000000)
#use rs232(baud=115200, xmit=PIN_C6, rcv=PIN_C7, PARITY=N)
#use fast_io(a)
#use fast_io(c)
...
#define CONST_ADD 0x3F0
...
#ROM CONST_ADD = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,...}

//---------- end --------

Can someone give me help
If needed, i can give more code or information

Thanks in advance.

Xavier
ttelmah
Guest







Re: Porting PIC16F877 to PIC18F458 problem
PostPosted: Mon Apr 26, 2004 7:59 am     Reply with quote

xav27 wrote:
Hello everybody,

I'm trying to compile a program written for a PIC16F877 to a PIC18F458.

I only changed #include <18F458.h> and PCWH give me an error :
"Out of ROM, A segment or the program is too large" !

PCWH V3.187
here is a part of my code


#include <18F458.h>
//#include <16F877.h>
#include "register.h"
#fuses HS,NOWDT,NOPUT,NOBROWNOUT,NOPROTECT,NOWRT,NOCPD,NOLVP

#use delay(clock=20000000)
#use rs232(baud=115200, xmit=PIN_C6, rcv=PIN_C7, PARITY=N)
#use fast_io(a)
#use fast_io(c)
...
#define CONST_ADD 0x3F0
...
#ROM CONST_ADD = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,...}

//---------- end --------

Can someone give me help
If needed, i can give more code or information

Thanks in advance.

Xavier

One thing that might be happening, is that the interrupt handler for the 18 family is significantly larger than for the 16 chips. What is 'const_add', and why do you put it in a fixed location?. You are locating it at 3F0, but not telling the compiler to avod this area (you need to use #ORG to do this). I'd suspect the interrupt handler has grown to the point where it wants to overwrite this area, and is then clashing with this declaration.

Best Wishes
xav27
Guest







Porting PIC16F877 to PIC18F458 problem
PostPosted: Mon Apr 26, 2004 8:31 am     Reply with quote

hi ttelmah,

thanks for your help.

: What is 'const_add', and why do you put it in a fixed location?

CONST_ADD is an rom area where i place some data to be changed via a modifed loader.c version.
With a RS232 link to a PC, I can change this values sending hex file(write_eeprom_program() ) it's working fine with a PIC16F877
my loader is located at 0x1C00 to 0x1CFF

I tried to add this line just after #use fast_IO(c); :
#org 0x03F0,0x1BFF {}

but no change, still have the error when compiling.

What should I do ?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group