Jump to content

Recommended Posts

[font=Courier]

 

Please let me know why the following simple example won't compile:

 

rom char *temptbl = {0,1,2,3,4,5,6,7,8,9};

 

unsigned char i,j;

 

j=0;

 

i=temptbl[j];

 

 

 

error: failed to generate expression

error: invalid operand 'temptbl[j]'

error: failed to generate expression

Share this post


Link to post
Share on other sites
Please let me know why the following simple example won't compile:

 

rom char *temptbl = {0,1,2,3,4,5,6,7,8,9};

 

unsigned char i,j;

 

j=0;

 

i=temptbl[j];

 

 

 

error: failed to generate expression

error: invalid operand 'temptbl[j]'

error: failed to generate expression

Add #include <system.h>.

 

Regards

Dave

Share this post


Link to post
Share on other sites

How can this be done without including system.h? I have to be very careful about what I include. I've now got the touchy ICD2 to display my variables correctly. I hand-edited my own include file for the 18LF24J10 which system.h does not bring in automatically. What does system.h bring in to support the rom array syntax?

 

Sincerely,

Steve

Share this post


Link to post
Share on other sites
How can this be done without including system.h?  I have to be very careful about what I include.  I've now got the touchy ICD2 to display my variables correctly.  I hand-edited my own include file for the 18LF24J10 which system.h does not bring in automatically.  What does system.h bring in to support the rom array syntax?

 

Sincerely,

Steve

 

boostc.h is included with system.h.

Share this post


Link to post
Share on other sites

Steve,

Steve,
.....

I hand-edited my own include file for the 18LF24J10 which system.h does not bring in automatically.

This sounds interesting, what did you do exacty?

 

Regards

Dave

I release what this is now, its the missing 18FxxJxx configuration sections. This omission has been corrected in BoostC V6.50.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Steve,

.....

I hand-edited my own include file for the 18LF24J10 which system.h does not bring in automatically.

This sounds interesting, what did you do exacty?

 

Regards

Dave

Share this post


Link to post
Share on other sites

Dave,

 

Actually I do have a "newbie" problem on this very point. I'm having a problem under MPLAB. if I use system.h to bring in the PICmicro defines then I can't get my projects to compile because the following conditional within system.h doesn't work:

 

#ifdef _PIC18LF24J10

#include <PIC18LF24J10.h>

#endif //_PIC18LF24J10

 

Does BoostC evaluate #ifdef _PIC18LF24J10 as true if an 18LF24J10 is selected within MPLAB? i don't have to do anything else? Or do I have to setup a define of my own to signal the selection of 18LF24J10 to system.h? Something like :

 

#define PIC18LF24J10 or

 

#define _PIC18LF24J10

 

I'm still having a miserable time INCLUDEing system.h. Until I can get this working I'm using the following defines instead of system.h in my source code:

 

#include <PIC18LF24J10.h>

#include <BoostCPic18.h>

#include <boostc.h>

 

Will this work? What am I doing wrong?

 

Sincerely,

Steve

Share this post


Link to post
Share on other sites

Steve,

 

Dave,

 

Actually I do have a "newbie" problem on this very point.  I'm having a problem under MPLAB.   if I use system.h to bring in the PICmicro defines then I can't get my projects to compile because the following conditional within system.h doesn't work:

 

#ifdef _PIC18LF24J10

#include <PIC18LF24J10.h>

#endif //_PIC18LF24J10

 

Does BoostC evaluate #ifdef _PIC18LF24J10 as true if an 18LF24J10 is selected within MPLAB?  i don't have to do anything else?  Or do I have to setup a define of my own to signal the selection of 18LF24J10 to system.h?  Something like :

 

#define PIC18LF24J10 or

 

#define _PIC18LF24J10

 

I'm still having a miserable time INCLUDEing system.h.  Until I can get this working I'm using the following defines instead of system.h in my source code:

 

#include <PIC18LF24J10.h>

#include <BoostCPic18.h>

#include <boostc.h>

 

Will this work?  What am I doing wrong?

 

Sincerely,

Steve

PIC18LFxxxx Devices are the same as PIC18Fxxxx devices except they will operate over a wider range of voltages. We don't supply additional header files for LF devices. So when you select PIC18LF24J10 no header file is included (PIC18LF24J10.h does not actually exist).

 

The solution is to add the following to BoostCPic18.h

#ifdef _PIC18LF24J10

#include <PIC18F24J10.h>

#endif //_PIC18LF24J10

Notice that the LF has been changed to just F for the include directive.

And duplicate and rename PIC18L24J10.TDF file to PIC18LF24J10.TDF (for linker).

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...