View previous topic :: View next topic |
Author |
Message |
Mattr0
Joined: 27 Mar 2005 Posts: 30
|
Undefined identifier SPI_READ |
Posted: Sun Jun 17, 2007 12:28 pm |
|
|
I am trying to use a PIC18f67j60 to make a simple http server. I want to store the webpage on a MMC card and am having difficulty. The ethernet port tion of my board works and the MMC card works. But when I try to use them both I get this error
Undefined identifier SPI_READ
download the source here too many files to post
www.mattandbethrodney.com/tcpip.zip
It seems that the SPI is getting disabled in the source somewhere I just cannot find it. Any help would be appreciated
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jun 17, 2007 12:46 pm |
|
|
The following test program compiles OK with PCH vs. 4.041.
Code: | #include <18F67J60.h>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
//===========================
void main()
{
int8 c;
c = spi_read(0);
while(1);
} |
Also, your Zip file is reported as corrupt by Winzip. It's not usable. |
|
|
Mattr0
Joined: 27 Mar 2005 Posts: 30
|
|
Posted: Sun Jun 17, 2007 1:02 pm |
|
|
Thank you I have fixed the file I posted.
I have also proven SPI to work in 4.042 but I cannot get it to work with the TCP module.
I figure that there is some thing left in there for the ENC28j60 that I cannot locate.
Matt |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jun 17, 2007 1:29 pm |
|
|
This sounds like a new problem. I am willing to help solve the very
narrow problem of "unidentified identifier". Is that problem now solved ?
I don't want to work on making TCPIP work. It's too large of a problem. |
|
|
Mattr0
Joined: 27 Mar 2005 Posts: 30
|
|
Posted: Sun Jun 17, 2007 1:39 pm |
|
|
the problem is not with TCP. If I take out the MMC card driver it compiles OK and TCP works with out a problem. When I added the MMC driver I get
*** Error 12 "F:\MMC WEB SERVER\Example Code\TCP-IP\PIC Examples Source\MMC_FAT16.h" Line 161(23,31): Undefined identifier SPI_READ
and plenty more of them.
If I make a simple program to acsess the MMC card alone it works fine also.
I just can't figure this out |
|
|
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
|
Posted: Sun Jun 17, 2007 1:55 pm |
|
|
I have just try the code and found
Caps seem to be the problem
replace "SPI_READ" with "spi_read"
did this with the first error and compiled that error out
or could do a #DEFINE statement
#DEFINE SPI_READ spi_read
this then gets you to the next error
"undefind identifier MAKE8"
so I did #DEFINE MAKE8 make8
now the next error "undefind identifier false" "return(false);"
then added
#DEFINE false 0
#DEFINE true 1
and so on. have not completed however I did find in the past that reserved words are in lower case _________________ What has been learnt if you make the same mistake? |
|
|
Mattr0
Joined: 27 Mar 2005 Posts: 30
|
|
Posted: Sun Jun 17, 2007 2:06 pm |
|
|
Thanks Let me try that.
I don't understand how the case sensitive is only on this project because this driver works as is for other projects.
Matt |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jun 17, 2007 2:09 pm |
|
|
That's what I found too. Darren has a #case statement in his driver file.
Then, someone (maybe you), has gone through other source files and
changed the case of the function name or various constants so they're
different from the standard CCS usage. That's the cause of the problem.
I would do a search and replace (case sensitive) on all these instances
and just fix them. Presumably Darren has got #case in there for some
reason, so it would be better to fix the case of the SPI_READ() names
and 'true' and 'false', than to remove #case statement. |
|
|
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
|
Posted: Sun Jun 17, 2007 2:25 pm |
|
|
I have removed the error
the whole thing felt like an exercise,
the errors appear to be deliberate, as the fix was to do minor typo's repairs even to add and "#include" lines.
Compiles with warnings not tested as there may be other errors
I found doing a search on the error I was able to find and replace with similar words.
ie "set_blocklen(512);" is to be "set_BLOCKLEN(512);" _________________ What has been learnt if you make the same mistake? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jun 17, 2007 2:35 pm |
|
|
You're saying this was invented as an exercise for us ? |
|
|
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
|
Posted: Sun Jun 17, 2007 3:01 pm |
|
|
looks like it,
I enjoyed it!
The micro, code has similarities to a project I am planing to undertake at some time in the future, just need to add RS485, RS422 and RS232 RTC and a whole lot of code _________________ What has been learnt if you make the same mistake? |
|
|
Mattr0
Joined: 27 Mar 2005 Posts: 30
|
|
Posted: Sun Jun 17, 2007 6:22 pm |
|
|
I found the #case statement I left it alone as who know why it is there in the first place.
I have fixed all of the errors and now it works fine thanks again
Matt |
|
|
|