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.
Pardon me for my ignorance as I am completely new to the 8051. I do have a query which I hope someone can help me with. I am using the 89C51RD2 which has 1KB internal RAM. When I compile my C code in "SMALL" memory model, it gives the error that the data segment is too large. Alternative, the code can only be compiled if "LARGE" memory model is used. However, I have used this code with a x86 compiler for a x86 processor and the data is actually much less than 1KB? Thank you in advance. Why is it that I still get the error that the data segment is too large when my data is actually less than 1KB?
"I am completely new to the 8051." Then start by reading the uVision Getting Started Guide, and working through the example projects in it. You will also need to read these: http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_ARCH_1.pdf http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_PROG_GUIDE_1.pdf http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_HARDWARE_1.pdf and, of course, the Data Sheet for your particular chip. You might also want to look at these tutorials: http://www.8052.com/tutorial.phtml "I am using the 89C51RD2 which has 1KB internal RAM." Unfortunately, the term "internal" is now somewhat ambiguous in this context - see http://www.8052.com/forum/read.phtml?id=36772&top= "I have used this code with a x86 compiler for a x86 processor and the data is actually much less than 1KB" Such comparisons are almost entirely worthless! The x86 family are high-performance 16- or 32-bit microprocessors; the 8051 family are compact 8-bit microcontrollers If you simply take a bit of x86 'C' source code and dump it on an 8051 you are (almost) guaranteed to get extremely inefficient code; eg, the x86 has native 16-bit (or even 32-bit) instructions - the 8051 doesn't!