Programming Model
Chip-Select Logic 6-21
Example 6-2. Programming Example
************************************************
* Chip-Select registers
************************************************
REGSBASE equ 0xFFFFF000internal registers base address
BASEA equ REGSBASE+0x100 group A base register
BASEB equ REGSBASE+0x102 group B base register
BASEC equ REGSBASE+0x104 group C base register
BASED equ REGSBASE+0x106 group D base register
CSA equ REGSBASE+0x110 group A chip-select register
CSB equ REGSBASE+0x112 group B chip-select register
CSC equ REGSBASE+0x114 group C chip-select register
CSD equ REGSBASE+0x116 group D chip-select register
************************************************
* PORT control registers
************************************************
PORTBASE equ REGSBASE+0x400 port B registers base address
PBDir equ PORTBASE+0x08 port B direction register
PBData equ PORTBASE+0x09 port B data register
PBPU equ PORTBASE+0x0A port B pullup enable register
PBSel equ PORTBASE+0x0B port B select register
************************************************
* Initialization
************************************************
START move.b #0x00,PBSel disable PortB, select chip-selects
move.w #0x0000,BASEA set base address 0x0000000
move.w #0x8081,CSA read-only,16-bit,0 wait state,128K
move.w #0x2000,BASEB set base address 0x4000000
move.w #0x0093,CSB read/write,16-bit,1 wait state,256K
move.w #0x2040,BASEC set base addrs 0x4080000
move.w #0x0191,CSC read/write,flash,16-bit,1 ws,32K
move.w #0x0000,CSD config CSC,CSD as non-DRAM memory type
* The preceding initialization will configure the CSA and CSB chip-selects as
* follows :
*
* CSA0 0x0000000-0x001ffff,read-only, 16-bit,0 wait state,128K
* CSA1 0x0020000-0x003ffff,read-only, 16-bit,0 wait state,128K
* CSB0 0x4000000-0x403ffff,read/write,16-bit,1 wait state,256K
* CSB1 0x4040000-0x407ffff,read/write,16-bit,1 wait state,256K
* CSC0 0x4080000-0x4087fff,read/write,flash,16-bit,1 wait state, 32K
* CSC1 0x4088000-0x408ffff,read/write,flash,16-bit,1 wait state, 32K
* CSD0 disabled
* CSD1 disabled