Just started with mikrobasic for the 8051. I had trouble selecting the right processor.
I use the 80c552, but this one is not in the list. So I choosed several types, but the T89C51CC02 seems to work.
Not exactly the same but OK, more or less....
I choose large memory model, expecting stringvariables automatically to be stored in external memory. So says the manual.
However, with another monitor program I could not find these strings there. However, I DID find them somewhere in internal memory.
Only explicitely defining these variables to be stored in ext mem.with: "dim A as string[10] xdata",
I forced them to be stored in ext mem.
What am I doing wrong ? Why are these variables not stored in EXT mem. when selecting large model ?
Has it something to do with the processor choiche ? Or is it a bug in the compiler ? something else ?
I hope you can help me.
Regards, Rob
Where is a string stored
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: Where is a string stored
Hi Rob,
Welcome to the MikroE forum.
I'm sorry, it is mistake in the documentation, you should always use
keyword xdata when you want to save data in external memory.
Best regards,
Lana
Welcome to the MikroE forum.
I'm sorry, it is mistake in the documentation, you should always use
keyword xdata when you want to save data in external memory.
Best regards,
Lana
Re: Where is a string stored
Hi,
using the keyword "xdata" is ofcourse the easiest solution. However, not only string variables
are NOT stored in ext. mem despite using the "large model" option, also byte, word and other variables
are not. So they all need the keyword xdata. To me, that sounds not so much like an error in the
manual, it sounds more like a bug in the compiler. The option "large model" seems not to work at all
And it is getting worse.
take this example assuming the usart has been initialized:
dim S as string [10]
S="12345678"
UART1_Write_Text(S)
This works fine. However:
dim S as string [10] xdata
S="12345678"
UART1_Write_Text(S)
This example does not work. The text IS stored in ext mem. But NOT sent to the serial link
What am I doing wrong here ?
Regards, Rob
using the keyword "xdata" is ofcourse the easiest solution. However, not only string variables
are NOT stored in ext. mem despite using the "large model" option, also byte, word and other variables
are not. So they all need the keyword xdata. To me, that sounds not so much like an error in the
manual, it sounds more like a bug in the compiler. The option "large model" seems not to work at all
And it is getting worse.
take this example assuming the usart has been initialized:
dim S as string [10]
S="12345678"
UART1_Write_Text(S)
This works fine. However:
dim S as string [10] xdata
S="12345678"
UART1_Write_Text(S)
This example does not work. The text IS stored in ext mem. But NOT sent to the serial link
What am I doing wrong here ?
Regards, Rob
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: Where is a string stored
Hi Rob,
When you open mlk file (Ctrl + Alt + M),
can you try to uncomment node <XDATA>?
Also, you can try to access xdata memory using pointers,
please take a look at these links:
http://forum.mikroe.com/viewtopic.php?p=127309#p127309
http://forum.mikroe.com/viewtopic.php?f ... 45#p133514
Best regards,
Lana
When you open mlk file (Ctrl + Alt + M),
can you try to uncomment node <XDATA>?
Also, you can try to access xdata memory using pointers,
please take a look at these links:
http://forum.mikroe.com/viewtopic.php?p=127309#p127309
http://forum.mikroe.com/viewtopic.php?f ... 45#p133514
Best regards,
Lana
Re: Where is a string stored
Lana,
I tried your suggestion to uncomment node <xdata> in the .mlk file.
This makes no difference. I did not try to use pointers. Basically I think that,
by using "xdata" the compiler should know where to find the string: in ext mem.
So, when it does not, am I wrong when I say that this is an error in the compiler ?
Regards,
Rob
I tried your suggestion to uncomment node <xdata> in the .mlk file.
This makes no difference. I did not try to use pointers. Basically I think that,
by using "xdata" the compiler should know where to find the string: in ext mem.
So, when it does not, am I wrong when I say that this is an error in the compiler ?
Regards,
Rob