5. MEMORY BANKS & INDEX
5.1 USING MEMORY BANKS
This chapter provides the information about how to access the memory on the
The I/O addresses of these registers are determined by of
The I/O port address of the bank select register is base port+0, and the I/O port address of the chip select register is base port +1. The following is the format of the bank select register and bank enable register.
| Register | I/O Port | D7 | D6 | D5 | D4 |
| D3 | D2 | D1 | D0 |
| Bank Select | Base + 0 | WPE | A6 | A5 | A4 |
| A3 | A2 | A1 | A0 |
| Register |
|
|
|
|
|
|
|
|
|
|
| Chip Select | Base + 1 | 0 | 0 | 0 | 1 |
| CS3 | CS2 | CS1 | CS0 |
| Register |
|
|
|
|
|
|
|
|
|
|
Where: |
|
|
|
|
|
|
|
|
|
|
|
WPE | Write protect enable bit |
|
|
|
|
|
|
|
|
| |
A6 – A0 | Bank select bits, A0 is the LSB. |
|
|
|
|
|
|
|
| ||
CS2 – CS0 | Chip select bits of MEM1 to MEM8, CS0 is the LSB |
|
|
|
| ||||||
CS3 | 0 for |
|
|
|
|
|
|
|
|
For different types of memory, A0 to A6 have different explanations. These bits are used to select the bank number of specific memory located by CS0 to CS3.
Memory | A6 | A5 | A4 | A3 | A2 | A1 | A0 |
64KB EPROM/FLASH | 0 | 0 | 1 | 0 | BS2 | BS1 | BS0 |
128KB EPROM/FLASH | 0 | 0 | 1 | BS3 | BS2 | BS1 | BS0 |
256KB EPROM/FLASH | 0 | BS4 | 1 | BS3 | BS2 | BS1 | BS0 |
512KB EPROM/FLASH | 0 | BS4 | BS5 | BS3 | BS2 | BS1 | BS0 |
1MB EPROM | BS6 | BS4 | BS5 | BS3 | BS2 | BS1 | BS0 |
128KB SRAM | 0 | 1 | 0 | BS3 | BS2 | BS1 | BS0 |
512KB SRAM | 0 | BS5 | BS4 | BS3 | BS2 | BS1 | BS0 |