??? 07/10/09 09:35 Read: times |
#166980 - use the indirect method for upper RAM, take care of Stack Responding to: ???'s previous message |
The mcu AT89L4052 has 256 bytes internal RAM
the lower 128 bytes may be accessed by direct or indirect method and the upper 128 bytes of RAM may be accessed by indirect method. The upper 128 bytes when accesed by direct method access the SFRs. ![]() So, you may setup the SP to an upper point than #7FH, so there is enough room between #80H and point to accesed by indirect method using the instructions Arithmetic ADD A, @Ri ADDC A, @Ri SUBB A, @Ri INC @Ri DEC @Ri Logical ANL A, @Ri ORL A, @Ri XRL A, @Ri Data Transfer MOV A, @Ri MOV direct, @Ri MOV @Ri, A MOV @Ri, direct MOV @Ri, #data XCH A, @Ri XCHD A, @Ri Branching CJNE @Ri, #data, rel you have to load an index register Ri like R0, or R1 with the desired address and using the above instructions you can access any byte or bit of the internal RAM. Of course care should be given to leave enough space for Stack Pointer eg. set SP to #9F to have room from #0A0h to #0FFh there or 96bytes for stack usage. and by that setting there are from #80h to #9Fh = 32d bytes to use by the indirect method. You may use this reference http://www.atmel.com/dyn/resources/prod_documents/doc3547.pdf K.L.Angelis |
Topic | Author | Date |
Stack Pointer and available RAM | 01/01/70 00:00 | |
"Internal" RAM - basics | 01/01/70 00:00 | |
some confusion with your links | 01/01/70 00:00 | |
Follow: can I use 08H through 2FH for general purpose RAM | 01/01/70 00:00 | |
08 thru 2F as additional RAM | 01/01/70 00:00 | |
use the indirect method for upper RAM, take care of Stack | 01/01/70 00:00 | |
the limits for simple storage | 01/01/70 00:00 | |
Direct method, Indirect Method or C compiler ? | 01/01/70 00:00 | |
READ "THE BIBLE" | 01/01/70 00:00 | |
Tell us which exact 80c51 you are using | 01/01/70 00:00 | |
Really?? | 01/01/70 00:00 | |
a long time ago | 01/01/70 00:00 | |
Another option for usage of Register Banks | 01/01/70 00:00 | |
instead of getting it piecemeal | 01/01/70 00:00 | |
I think therefore I ask | 01/01/70 00:00 | |
WRONG | 01/01/70 00:00 | |
according to the PDF | 01/01/70 00:00 | |
Program in Assembler?? | 01/01/70 00:00 | |
assembler only![]() | 01/01/70 00:00 |