We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
If I use PDATA for my Stack. will any of my XDATA overlap? or is Keil smart enough to prevent that? Does it mean the RAM(XDATA) I have is 2048 - 256 for pdata?
MCU: AT89C51CC03 Memory Model: Compact
PBPSTACK EQU 1 PBPSTACKTOP EQU 0xFF +1
the compact model can not access xdata
Erik
No, that doesn't sound right to me at all.
Surely, all the Memory Model does is to set the default space - it has no effect on specific accesses?
If you're needing to mess with the simulated software stack, that rather suggests that you're doing stuff that is not well-suited to an 8051.
So, before you go down this path, have you carefully considered whether an 8051 is really a good choice for this job?
It's best not to have to expend effort like this fighting the limitations of the architecture when better-suited architecutes are easily available.
Just a thought.
See also: www.8052.com/.../166243
Hi Andy.
I did go down this path. It's setup that way right know and works. But I will be adding a few things to it and I just want some peace of mind. Could I just assume that it is?
I agree a bigger MCU would be more suited, In fact I was not sure this one would work, but after the prototype worked good, I went with it.
I do want to make the leap to a bigger processor, what would you suggest?
First, you need to be really sure about why the 8051 is not a good choice.
What is it that makes you think that you need to mess about with the simulated software stack?
If you don't really need to do that, then you possibly don't really need a different processor.
From the little information available, I guess it's not so much raw size as the organisation of the memory?
To me, the obvious "next step" from am 8051 is a Cortex-M3 (or possibly one of the other Ms)...
While. I have the 8051 building a 32 bit CRC from data it streams from the SDcard. I found that is was twice as fast when I moved my stack into pdata. I did a lot of changing and moving of memory to achieve maximum speed. it builds a 32 bit CRC on 512K streamed from the SDcard in just over 4 mins.
Also, I have done lots of research on processors, I was mostly wondering about a good development kit. Not to expensive. I got a quote form the Zii processors stuff and they wanted 7K.
I got on digi-key and order a Development kit. This one: www.luminarymicro.com/.../eki-lm3s2965_can_evaluation_kit.html
Jerry; I second your choice of an ARM eval kit. But I would like to address a concern already expressed in previous replies to your post.
Selecting Compact does not speed up the overall access of external memory. It will speed up some access to external memory within the page size of PDATA.
Selecting Compact allows the Compilier/Linker to assign vars to the PDATA area but if you move the PDATA area beyond the first 256 bytes of external memory then you must handle the high address lines of P2.
But I will be adding a few things to it and I just want some peace of mind. (Your Post).
If you add many vars, you will be treading on your stack quickly. Remember, by selecting the Compact model, you are telling Keil Tools to put all your vars in PDATA.
By selecting the Small Memeory model and explicitly assigning your stack variables to PDATA will, IMHO, result in a little more secure and faster external memory access over all.
In this manner, your auto vars will be assigned to the DATA memory and your explicitly assigned vars will go to the PDATA area.
In my years of 8051, I have found the PDATA area only useful for quickly accessing memory mapped I/O where I was controlling P2 for the high address decoding.
Talking with a number of Keil people at the trade shows, they wished they had never implemented PDATA but it was previously defined by INTEL so they had clients ask "where is my PDATA?".
All in all, I agree with Andy. If you need to build a pseudo stack you should be using a different MCU. Bradford
Thanks Al,
I understand at little more know. If I do have problem I will just redefine it. Moving everything back to standard stack and if I need PDATA just assigning it. I did do some benchmarks and when I made the change to PDATA it did show some and improvement. But my orignal question has not really been asnwered. e.g.
PDATA char data[255]; XDATA char data2[255];
Do these two array go to the same memory location?
I think not - but can't be sure.
Similarly, I think, IDATA and DATA don't overlap (as far as C51 is concerned).
You should be able to see this from the Map file?
Map File? I am no genius on keil, is there a map file?
aka "Linker Listing file"
Is this possible to transmit data in decimal through serial port because according to my knowledge serial port can transmits only ASCII characters but it can receive decimal/binary data if there is any method to transmit decimal/binary data using it please reply
Regards
Kingky
PDATA and XDATA
on new subject styart a new thread
you may notice that ASCII characters include 0x00 to 0xFF, not only visible characters. so you can send any 8bit data use "send char" or simlar fuction, but don't use "send string", beacause string is 0x00 as end.
in many application, for easy(clearly) view the data in terminal, add a 0x30 for BCD number