21

Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

Embed Size (px)

Citation preview

Page 1: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash
Page 2: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• 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

Page 3: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash
Page 4: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• 8051 write to 6264– A0~A12 / 解碼電路 CS– D0~D7– WR

• 8051 read from 6264– A0~A12 / 解碼電路 CS– RD D0~D7

Page 5: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• READ– 1. CS– 2. A0-A12 – 3. RD– 4. D0-D7

• WRITE– 1. CS– 2. A0-A12– 3. D0-D7– 4. WR

Page 6: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash
Page 7: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• READ– 1. CS– 2. A0-A12 – 3. RD– 4. D0-D7

• Program

Page 8: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash
Page 9: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash
Page 10: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• 101x xxxx xxxx xxxx

• 1010 0000 0000 0000 = A000h

• 1011 1111 1111 1111 = BFFFh

• 001x xxxx xxxx xxxx

• 0010 0000 0000 0000 = 2000h

• 0011 1111 1111 1111 = 3FFFh

Page 11: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• MOVX @DPTR,A– DPLP0, DPHP2– ALE– AP0– WR

• MOVX A,@DPTR– DPLP0, DPHP2– ALE– RD– AP0

Page 12: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• 000x xxxx xxxx xxxx

• 0000 0000 0000 0000 = 0000h

• 0001 1111 1111 1111 = 1FFFh

• 101x xxxx xxxx xxxx

• 1010 0000 0000 0000 = A000h

• 1011 1111 1111 1111 = BFFFh

Page 13: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• Fetch instruction– PCLP0, PCHP2– ALE– PSEN– Instruction RegisterP0

• MOVC A,@A+DPTR– (DPTR+A)LP0, (DPTR+A)H P2– ALE– PSEN– AP0

Page 14: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• __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;

Page 15: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• __code __at 0xA000 unsigned char x=‘1’;

• __xdata __at 0x2000 unsigned char y;

• y=x;

Page 16: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash
Page 17: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• __xdata __at 0x3000 unsigned char x[1024];

for(i=0;i<1024;i++)x[i]=i;

Page 18: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

Stack

Page 19: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash
Page 20: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash
Page 21: Memory –Random Access Memory Read/Write, volatile –Read-Only Memory Program, non-volatile Programable ROM Erasable PROM –UV EPROM –Electrical EPROM –Flash

• 110x xxxx xxxx xxxx• 1100 0000 0000 0000 = C000h• 1101 1111 1111 1111 = DFFFh

• __xdata __at 0xC000 unsigned char x[8192];• int i;• for(i=0;i<8192;<i++)

– x[i]=0;