How to use upper 128byte of AT89S52. i.e. SFRs(80H to FFH) Address indirectly with KEIL C51 for general purpose which are not in use. They are directly addressable only as SFR.
according to datasheet: 1. The lower 128 bytes of RAM (00H to 7FH) are directly and indirectly addressable. 2. The higher 128 bytes of RAM (80H to FFH) are indirectly addressable. 3. The special function registers (80H to FFH) are directly addressable only.
Please help me thanks!
The data sheet is very correct and right and you should believe it.
you can get to the high 128 bytes of intrental RAM with indirect pointers.
always you're friend with good advice,
Zeusti.
Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
http://www.keil.com/books/8051books.asp
http://www.8052.com/tut8051
How to do with C51 i think IDATA keyword can work what you say?
I know how to do it in assembly. But in C51 i miss this easy DPTR things.
in C if your variable is in XDATA, DPTR is used, no concern of yours.
Erik
How to use upper 128byte of AT89S52 in C51? please help me. one/two line example please.
IDATA
Yes, for you, here is a real exampel. not Please read the manual.
void clear_internal_idata_space ( void ) { char idata *Pointer_To_IDATA_Space - 0x80; int Counter; for ( Counter = 0x80; Counter <= 0xFF; ++Counter ) Pointer_To_IDATA_Space [ Counter ] = 0; }
Professor Zeusti.
nooooooooooo............
the line you want is this ...........
char idata *Pointer_To_IDATA_Space = 0x80;
the one who does.
View all questions in Keil forum