| |||||
Technical Support Support Resources
Product Information | C51: ACCESSING SPECIFIC MEMORY BYTESQUESTIONHow can I acess any byte of internal memory without reserving it? At some time, I want to download all memory contents, including all variables and registers. It is no problem working in Assembly, but can I do this from a C program? ANSWERYes. You may use the DBYTE macro in the C51 library. Refer to the ABSACC.H include file. The definition for DBYTE is... #define DBYTE ((unsigned char volatile data *) 0) You may then access any byte in internal memory as shown in the following C code:
for (i = 0; i < 0x80; i++)
{
unsigned char my_data;
my_data = DBYTE[i]; // Read DATA byte
SBUF = my_data; // Write DATA byte to serial port
// Delay for TI here
}
MORE INFORMATIONLast Reviewed: Monday, June 07, 2004 | ||||
| |||||