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.
Hi This is code compiled with Keil C, but not working #include <AT89X51.H> xdata char Index _at_ 0x00; void Clear_DDRAM(char index); void main(void) { Clear_DDRAM(0x00); while(1); } void Clear_DDRAM(char index) { int a; for(a=0;a<65536;a++) { P3_4=0; //IOCS=0; P3_1=0; P3_0=0; P1_0=0; //Reset=0; Index=index; P3_4=1; //IOCS=1; Index=Index+a; } } The xdata has 64K address range. Here is my queation: How to series to write data(0x00) into next address(Star address at 0x00). The assembly code is "INC DPTR" so have any instruction like it in keil C.
Hsu, That's what my code does. Also, you should not be calling the variable that holds your data "index." Aside from the fact that you already have a variable called "Index" and this is confusing, the "index" variable isn't being used as an index. Just take a look at the code I posted, and see if it's not what you're doing. Also, you use a CLR operation on P3.1, P3.0, and P1.0 INSIDE your loop, but nothing ever sets these high. You should put these up at the start of DDRAM_RESET for efficiency.
Dear Jay Thanks for your suggest code that I've tried and modify for my application. It is OK.