View previous topic :: View next topic |
Author |
Message |
nazoa
Joined: 09 Feb 2007 Posts: 56
|
PIC18F97J60 with external memory and TCPIP |
Posted: Fri Apr 11, 2008 9:48 am |
|
|
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! |
|
|
Dimmu
Joined: 01 Jul 2007 Posts: 37
|
|
Posted: Fri Apr 11, 2008 1:55 pm |
|
|
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: 56
|
|
Posted: Sat Apr 12, 2008 3:28 am |
|
|
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: 56
|
Solved! |
Posted: Sat Apr 12, 2008 4:06 am |
|
|
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
|
|
Posted: Sat Apr 12, 2008 10:56 am |
|
|
Happy to hear that you found the problem !
Dimmu |
|
|
|