HI!!
I declared 3 global var, i call it inside diferent task and every execution this var should be updates but not to do it. I have a 8051 under evaluation board. Maybe can be a problem of my small micro? What do u think about this?
Thanks
Right. I had a quick look at your datasheet and I think (But I may be wrong) that the on chip XDATA is enabled by default because your chip has no external address lines. I can not see an SFR bit to control it either.
When you compile in small model, what errors do you get first? Is it "Address space overflow" and if it is which address space (IDATA?) does it say in the error message.
IDATA and DATA are very limited in size and you have to leave room for the stack also.
Any large variables (or arrays or structs) you want to force into XDATA to free up DATA/IDATA just declare them as XDATA.
Ok, I understand why is better use small memory model but i dont know how apply to my code because i have too many error when i change the model...
Maybe i cant do it because my English level is regular and it is very difficult understand the manual. Thanks
Read up on memory models in the manuals.
It will be worth the effort. Understanding why you should always try to use the small memory model is worth every minute of the research.
If you do also need to use your (internal) XDATA, which you still can with a small memory model, then you have been given advise above how to enable it.
If I change my memory model my code dont compile because adress space overflow...
You probably don't want to use the large memory model then, if you do not want to have variables in XDATA by default.
read up on memory models in the manuals.
This is my serial port initialization:
P2M1 = 0; /* P2 output modo 1, LEDs */ P1M1 = 0; /* P1 output modo 1 -> COM1 activado */ BRGCON = 0x00; /* Para evitar que BRGEN este activo cuando inicializamos el baud rate */ SCON = 0x52; /* initialize UART (Modo 1: 8 bits, enable Tx) */ BRGR0 = 0xF0; /* 9600 baud, 8 bits, no paridad, 1 bit de stop */ BRGR1 = 0x02; BRGCON = 0x03; /* Activamos BRGEN */
...
Thanks Erik, But i have declared a global var in this way: int idata Uc; my program : Memory model: Large: var in Xdata Code size: Large: 64k OS: RTX-51 full
My task that only acumulate a value not work.
void PIDb (void) _task_ B _priority_ 1 { Uc+=(value);
If my var is in idata is necesary enable xram?? Im trying all and it not work. Im sure that it is a small thing but i cant find ...
every time I hear of yet another attempt to cut costs on the expense of software development and tools, because it is considered simple and straight forward (anybody can do it, not? they disregard the most important part: doing it right!), I have to think of this phrase: "you can defeat gravity by jumping from a plane. but only temporarily, of course".
"give a man a log and he will be warm for a day, set him on fire and he will be warm for the rest of his life"
Might be considered cruel by some, but it certainly appeals to my sense of humour!
you be wanting downuts you be must be talking by erac while I have had a suspicion the above confirm my suspicion as to who "Erac" is.
anyhow you are totally wrong.
When I use the (common in the US) expression "I will bet you dollars to doughnuts" it means the if you will give me a doughnut if I'm right I'll give you a dollar if I'm wrong. Thus this does not mean that I will give anyone a doughnut.
you be wanting to know goood ansewr by diffucult problam you be must be talkin not by erac there is a familiar expression "give a man a log and he will be warm for a day, set him on fire and he will be warm for the rest of his life" NO, NO, I am confusing sayings I was thinking of "give a man a fish and he will eat for a day, teach him to fish and he will eat for the rest of his life"
THUS, I consider it WRONG to solve peoples probems for them by feeding them the solution, REAL HELP is helping them to help themselves. Thus "here is the code you need" is not real help, whereas "in the datsheet you will find information related to SFR xxx, which will make you see what is wrong" is REAL help. That I prefer not to do this in a dry manner may upset some and some may like it, so what.
Erik
you do this ardours task of reading the datasheet and find that e.g. this is an example, not supposedly correct ORL AUXR1,#0x40 will enable the internal xram. Then right after the STARTUP: label (the one branched to from 0) you insert the proper instruction based on what you found in the datasheet.
OK!!! A simple questions:
Have i configurate START900.A51 for use On-Chip XRAM??? Is It necessary??
tamik
you be wanting downuts you be must be talking by erac
you be wanting sarchastem you be must talking by erac
you be wanting anwser by simple problum you must be talking by erac
you be wanting to know goood ansewr by diffucult problam you be must be talkin gnot by erac
IF i enable Use On-Chip XRAM i cant compile the aplication because :"ADRESS SPACE OVERFLOW".
why are taking this so seriously? ok, I sometimes also think that I'd rather jump into a swimming pool filled with Pirenia fish rather than being bashes by Erik, but (un)fortunately he often knows what he is talking about (like this one!). so relax and enjoy the bottomless well of knowledge (gee, I'm poetic!)
View all questions in Keil forum