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

PIC18F97J60 with external memory and TCPIP

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



Joined: 09 Feb 2007
Posts: 54

View user's profile Send private message

PIC18F97J60 with external memory and TCPIP
PostPosted: Fri Apr 11, 2008 9:48 am     Reply with quote

Hello,

I using a PIC18F97J60 with external RAM. The hardware works fine and I can use the compiler's memory setup instruction

SETUP_EXTERNAL_MEMORY(mode)

without any problems. The external memory (128Kb) can be read and written to without any errors.

Now, my problem starts when I try to incorporate the tcpip code into my program. What happens is that the compiler throws up a fatal error at the external memory setup line.

In order to figure out the problem I have taken CCS's example webserver code (provided with the ethernet evaluation kit) and made the minimum changes required to compile for the 18F97J60 (instead of the 18F67J60 provided with the evaluation kit but which does not support external memory). I still get the fatal error during compilation.

I am making sure that the include file is 18F97J60 instead of the example's 18F67J60.

Can anyone give some suggestions as what may be going wrong? Has anyone succesfully run the tcpip code with a 18F97J60 which has external memory?

Thanks! Sad
Dimmu



Joined: 01 Jul 2007
Posts: 37

View user's profile Send private message

PostPosted: Fri Apr 11, 2008 1:55 pm     Reply with quote

Hi,

I'm also working with a home-made 18F97J60 board with external memory... even if right now I do not really use the external memory for my project.

I'm using the TCP-IP examples given with the ethernet board and they works fine with the 18F97J60. I have also migrated without problem my small server from the 18F4620 + encxxx to the 18F97J60; with the external memory enabled ( but not used ).

It was just a question of #define to modify.

Maybe you could post the kind of error you have in your program ?
The version of the compiler ?


Dimmu
nazoa



Joined: 09 Feb 2007
Posts: 54

View user's profile Send private message

PostPosted: Sat Apr 12, 2008 3:28 am     Reply with quote

Thanks Dimmu.

The bit of code that generates the error is the following line:

SETUP_EXTERNAL_MEMORY(EXTMEM_DISABLE|EXTMEM_BYTE_SELECT|EXTMEM_WAIT_0);

The error message is:

*** Error 12 "ex_st_webserver.c" Line 467(25,26): Undefined identifier --SETUP_EXTERNAL_MEMORY

The changes I have made to the example code to try to get it to run with the 18F97J60 chip are as follows:

#elif STACK_USE_CCS_PICEEC||STACK_USE_CCS_EWL3V
#include <18F97J60.H> //* CHANGED TO 18F97J60 CHIP
#use delay(clock=41.6667M) //Set timing
#fuses H4_SW //Enable 5xPLL
#fuses Primary //Needed to 5xPLL
//#use delay(clock=25M)
//#fuses HS
#fuses NOFCMEN
#fuses PRIMARY
#fuses ETHLED
#fuses NOPROTECT
//* CHANGES FOR 18F97J60 CHIP *
//#fuses NOIESO
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES BW8 //8-bit external bus mode
#FUSES EMCU20 //Extended microcontroller mode,20 bit address mode
#FUSES EASHFT //Address shifting enabled

Many thanks.
nazoa



Joined: 09 Feb 2007
Posts: 54

View user's profile Send private message

Solved!
PostPosted: Sat Apr 12, 2008 4:06 am     Reply with quote

In case anyone is interested, I appear to have solved the problem by changing the command from upper case to lower case.

Before:
SETUP_EXTERNAL_MEMORY(EXTMEM_DISABLE|EXTMEM_BYTE_SELECT|EXTMEM_WAIT_0);

Now:
setup_external_memory(EXTMEM_DISABLE|EXTMEM_BYTE_SELECT|EXTMEM_WAIT_0);

Similarly, I have had to make sure that all function declarations, definitions and calls match exactly in either lower or upper case. I don't have much experience with the CCS compiler but I have never come across this before. I am using V4.070.
Dimmu



Joined: 01 Jul 2007
Posts: 37

View user's profile Send private message

PostPosted: Sat Apr 12, 2008 10:56 am     Reply with quote

Happy to hear that you found the problem !

Dimmu
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