Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash memory –Serial EEPROM
8051 write to 6264 –A0~A12 / 解碼電路 CS –D0~D7 –WR 8051 read from 6264 –A0~A12 / 解碼電路 CS –RD – D0~D7
READ –1. CS –2. A0-A12 –3. RD –4. D0-D7 WRITE –1. CS –2. A0-A12 –3. D0-D7 –4. WR
READ –1. CS –2. A0-A12 –3. RD –4. D0-D7 Program
101x xxxx xxxx xxxx = A000h = BFFFh 001x xxxx xxxx xxxx = 2000h = 3FFFh
–DPL P0, DPH P2 –ALE –A P0 –WR MOVX –DPL P0, DPH P2 –ALE –RD –A P0
000x xxxx xxxx xxxx = 0000h = 1FFFh 101x xxxx xxxx xxxx = A000h = BFFFh
Fetch instruction –PC L P0, PC H P2 –ALE –PSEN –Instruction Register P0 MOVC –(DPTR+A) L P0, (DPTR+A) H P2 –ALE –PSEN –A P0
__data unsigned char test_data; __xdata unsigned char test_data; __xdata __at 0x7ffe unsigned int chksum; __idata unsigned char test_data; __code unsigned char test_code=‘A’; bit test_bit;
__code __at 0xA000 unsigned char x=‘1’; __xdata __at 0x2000 unsigned char y; y=x;
__xdata __at 0x3000 unsigned char x[1024]; for(i=0;i<1024;i++) x[i]=i;
Stack
110x xxxx xxxx xxxx = C000h = DFFFh __xdata __at 0xC000 unsigned char x[8192]; int i; for(i=0;i<8192;<i++) –x[i]=0;