Hi, I'm using c to write a program for the 8051 (SiLabs IDE/KEIL). As I understand it there are 4 banks of 32k, Bank 0 is where my program is stored and the other banks I have used to store static data which my program needs to access (read only). I've checked that the other banks contain the data which I have downloaded via the IDE, but how do I access it from with my C program... I've tried many methods, any help would be greatly appreciated!
Solution found (I Think):
unsigned char i; unsigned char code *c; c = 0x8000; PSBANK = 0x22; for (i = 0; i < 10; i++) { ACC = *c; c++; }
Should loop through the first 10 bytes of data in bank 2 - change the PSBANK to view other banks. Correct?
for (i = 0; i < 10; i++) { ACC = *c; c++; }
How can you be sure that the compiler won't be using ACC for its own purposes...?
OK, yes, I just used ACC to quickly see if the returned values were correct in the IDE with a break point - during my program I will assign to other variables or do comparisons as required. Thanks for the help.