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.
I am working on a an 8051 based light tracker system whose hardware I have prepared in PCB, It has a very simple mapping in which two 8255 chips have been mapped into the conventional addressing area on the 8051 and should be accessed by instructions such as MOVX @DPTR,A or the like, now it's very easy to write the code to handle them in assembly ( I have done this and it has worked) but when working with KEIL and writing C51 and trying to define them at absolute memory addresses, I have failed. I am not very familiar with KEIL and I don't know about the setup that I have to make when working with external RAM and absolute memory addresses, I have surfed the web for documentation for KEIL on that subject and I have found two big manuals for KEIL in which these issues have not been properly addressed, I would be happy if I am provided with sufficient documentation or guidance about this. thanks
I'm not entirely sure if this answers your question, but to place a variable at an absolute address, you can use the _at_ keyword as follows: int xdata i _at_ 0x1000; This will create the variable 'i' in xdata at location 0x1000.
Look up the XBYTE macros in the intrin.h. They are described in the C51 User's Guide. Brad
"I am not very familiar with KEIL" In that case, you shoudl start by reading the uVision Getting Started Guide, and working through the example projects in it. You also need to read the C51 User's Guide - it is the Manual for the Compiler.
"it's very easy to write the code to handle them in assembly" So why not just do that bit in assembly? There's nothing wrong with writing in assembly, and it is straightforward to call assembly from 'C'. This has the advantage that your 'C' code does not rely on Keil's extensions to the 'C' programming language. There's a whole chapter in the Manual on interfacing 'C' to Assembler.