|
|
View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Sep 01, 2006 2:33 pm |
|
|
Quote: | Try using the ROM qualifier instead of the CONST qualifier. |
I have tried this and it doesn't compile. It gives an error saying
"Expecting a ; or ."
I spent a few minutes trying several different combinations of things,
such as #device CCS4 or #device CONST=ROM, etc. Nothing I tried
works.
There are no examples in the c:\Program Files\Picc\Examples
folder that refer to the "rom" keyword.
It may be that the new CCS feature doesn't have the functionality
that I thought it was going to have. I thought I would be able to
create an array in ROM that holds a string, and then pass a pointer
to that array to a function. In other words, pointers to constant
strings. Can vs. 4.xxx do this ? If it can, please post an example
or modify the program I posted earlier in this thread. |
|
|
emrtech Guest
|
pointers to ROM |
Posted: Mon Sep 04, 2006 9:42 pm |
|
|
Hi all,
I have tried your code after suitable modifications using CODEVISION AVR and it works fine there as well. It appears V4 CCS is not ready yet. However, I am looking very much forward to be able to use pointers to FLASH ROM for sure. I have tried to compile your code with V4.007 and get the same result.
Cheers,
Gerhard
Code: |
// example for code with Codevision AVR and ATMEGA32 MPU
// chip setup code not included
// must be declared globally; putting it inside main() causes a compiler error
const unsigned char flash buffer[] = {"Hello World\n"};
void display_string(const unsigned char flash *ptr)
{
char c;
while(c = *ptr++)
putchar(c);
}
void main(void)
{
display_string(buffer);
while(1);
}
| [/quote] |
|
|
Ttelmah Guest
|
|
Posted: Tue Sep 05, 2006 7:47 am |
|
|
Sorry to have not come back before. Hadn't been watching this thread.
It'll compile, if you use the 'ANSI' device keyword. At present behaviour seems to be:
Without ANSI, constants are in ROM. They will work for many of the internal functions (I have tried some, but not all). So you can have:
Code: |
const char tests[4][] = {
"First string",
"second string",
"Third string",
"Fourth string"
};
printf("%s",tests[0]);
|
and this appears to work.
If you add the 'ANSI' keyword, then you can have pointers to constants, but these appear to be copied to RAM before use.
The ROM keyword appears not to work for any of these situations.
The #device PASS_STRINGS_IN_RAM control is not understood by the compiler.
I had 'got exited', when it started to compile using the ANSI keyword, but at present, it joins the rest of V4, in being pretty useless.
Best Wishes |
|
|
taneuse Guest
|
problem with PIC wizard |
Posted: Fri Sep 08, 2006 7:53 am |
|
|
hi all
i'm just install the new version of ccs (v4)
i have a big problem
like the version 3 i try to create a new project with the pic wizard
but the items intituled PIC wizard isn't accessible in th project menu
and also in the main menu.
Please somebody help me.
Sorry for the french accent ;-)
thanks |
|
|
taneuse Guest
|
|
|
CCS JIM Guest
|
|
Posted: Fri Sep 08, 2006 8:43 am |
|
|
Make sure you download the IDEUTILS, the wizard isn't actually included with the compiler. |
|
|
TIMT
Joined: 02 Sep 2005 Posts: 49 Location: Nottingham, UK
|
V4.005 |
Posted: Wed Sep 13, 2006 3:38 am |
|
|
I've just installed V4.005 on my windows 98 pc
and installed the IDEUTILS download but I do not
have any of the datasheets and when I move my
cursor over buttons I just get black boxes
popping up. CCS haven't sent me my registration files
yet. Has this got something to do with my problems? _________________ Tim |
|
|
Ttelmah Guest
|
|
Posted: Wed Sep 13, 2006 7:38 am |
|
|
Datasheets are not part of the stuff supplied by CCS. You have to download the ones you want from MicroChip.
4.005, is three versions old. The square box problem was fixed on one of the latter releases.
Best Wishes |
|
|
TIMT
Joined: 02 Sep 2005 Posts: 49 Location: Nottingham, UK
|
|
Posted: Wed Sep 13, 2006 9:41 am |
|
|
Thanks Ttelmah.
It works ok on windows xp. I've updated to v4.009.
I got the three .crg register files from ccs, put them
into PICC directory but it still says I'm not registered.
I can download my updates ok though. Is this a bug
in the V4 softare does anyone know, or are the .crg files
they sent me not correct? _________________ Tim |
|
|
Ttelmah Guest
|
|
Posted: Wed Sep 13, 2006 10:24 am |
|
|
The crg files, are different for V4, to V3. Are you sure they understood you wanted the V4 ones?.
I am just playing with V4.009, and a couple of things that worked in V4.006, have stopped working in this. It'll be interesting to see what 'new' parts have started working!...
It is still not generating the write function in addressmod, and pointers to constants, have stopped woirking even in ANSI mode.
Best Wishes |
|
|
TIMT
Joined: 02 Sep 2005 Posts: 49 Location: Nottingham, UK
|
|
Posted: Wed Sep 13, 2006 10:41 am |
|
|
When i downloaded v3.249 and installed it, it asked me
to point it to the .crg files. I browsed to the ones in the
v4 picc directory and it seemed happy. Surely I don't
need a new set of .crg's for my v3.249 download.
This is getting complicated!
Just so long as i continue to get my 30 days updates
and my compiler works i'm happy. I think.
I've noticed my .c files don't have the spacing right for tabs.
There's an option missing in the editor setup page where the
set tabs is, to do with spaces. The i/o pins number option
in device selector doesn't seem to have any effect either.
probably me doing something wrong no doubt! _________________ Tim |
|
|
Ttelmah Guest
|
|
Posted: Wed Sep 13, 2006 2:16 pm |
|
|
The set for V4, is different from the ones for V3. This is why they had to be asked for by people who already had registered V3 compilers. CCS change the files every few months, to try to keep the current sets only available to registered users. It sounds as if you have the V3 files, not the V4 ones (hence why V3 works without complaints).
Best Wishes |
|
|
TIMT
Joined: 02 Sep 2005 Posts: 49 Location: Nottingham, UK
|
|
Posted: Thu Sep 14, 2006 7:15 am |
|
|
I've just got this reply from CCS :-
"Newer CRG files work on all older versions. Your V4 CRG files work on all version 3 releases."
_________________ Tim |
|
|
Ttelmah Guest
|
|
Posted: Thu Sep 14, 2006 10:07 am |
|
|
I thought you were originally complaining, that V4, was saying it was not registered. In which case the original reply still stands, that the registration files you have, are the older versions...
Best Wishes |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
pointer to function |
Posted: Sat Sep 16, 2006 12:40 am |
|
|
Hey!
Have anyone tried pointer to function in the Version 4? |
|
|
|
|
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
|