|
|
View previous topic :: View next topic |
Author |
Message |
Alexei Guest
|
Pointer to a string table |
Posted: Mon Oct 23, 2006 9:12 am |
|
|
hello, I use PICC 3.202 for PIC16F877A
I have a problem, the compiler don't want to recognize the following construction:
Code: |
const char* const message_lcd[] =
{
" FONCTIONNEMENT MODE PC ", //0
"TEST ETANCHEITE MASQUE ", //1 MESSAGES "TEST ETANCHEITE MASQUE"
"-", //2
" mbar DEGONFLER ", //3
" mbar REGONFLER ", //4
" mbar APPUYER SUR <E> ", //5
};
|
I tried to use
Code: |
char const message[][]=
{
" FONCTIONNEMENT MODE PC ", //0
"TEST ETANCHEITE MASQUE ", //1 MESSAGES "TEST ETANCHEITE MASQUE"
"-", //2
" mbar DEGONFLER ", //3
" mbar REGONFLER ", //4
" mbar APPUYER SUR <E> ", //5
};
|
it doesn't work. can anyone help me? I want to put in RAM a string table and I can't do it. |
|
|
Alexei Guest
|
|
Posted: Mon Oct 23, 2006 9:14 am |
|
|
sorry, I want to put a string table not in RAM but in ROM. |
|
|
Neckruin
Joined: 17 Jan 2006 Posts: 66
|
|
Posted: Mon Oct 23, 2006 10:04 am |
|
|
I have also tried to allocate a bidimensional array in ROM but wasn't able to do it
I finally used single arrays.
I hope somebody can help you (or "us")
Good Luck,
Juanma |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Oct 23, 2006 10:50 am |
|
|
The program shown below works OK. It displays the following output.
Code: |
FONCTIONNEMENT MODE PC
TEST ETANCHEITE MASQUE
-
mbar DEGONFLER
mbar REGONFLER
mbar APPUYER SUR <E>
|
Here is the program. It was tested with PCH vs. 3.249.
Code: |
#include <18F452.h>
#fuses XT,NOWDT,PUT,BROWNOUT,NOLVP, NOPROTECT, CPB
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
char const message[6][33]=
{
" FONCTIONNEMENT MODE PC ", //0
"TEST ETANCHEITE MASQUE ", //1
"-", //2
" mbar DEGONFLER ", //3
" mbar REGONFLER ", //4
" mbar APPUYER SUR <E> ", //5
};
//====================================
void main(void)
{
int8 i;
for(i = 0; i < 6; i++)
{
printf("%s\n\r", message[i]);
}
while(1);
}
|
|
|
|
Mark Weir
Joined: 11 Sep 2003 Posts: 51 Location: New Zealand
|
Question |
Posted: Tue Oct 24, 2006 5:53 pm |
|
|
Hi,
My question is really to PCM. I have tried the piece of code you supplied in answer to this post and of course it works well. Could you please tell me about the range of the two parameters. This setup has 6 messages of up to 33 characters if I understand correctly. If I want to have 20 messages, say, will they have to be shorter or can the range be extended?
Cheers
Mark |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Oct 24, 2006 10:21 pm |
|
|
For the PCM compiler, the size limit is 256 bytes for a ROM array.
For the PCH compiler, it's much larger. I don't know what the limit is
because I haven't run up against it yet. It works with at least 1KB. |
|
|
|
|
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
|