
10-10
MCF5249UM
MOTOROLA
Programming Model
10.4.2.4 CODE EXAMPLE
The following code provides an example of how to initialize the chip- selects.
CSAR0 EQU MBARx+$080;Chip Select 0 address register
CSMR0 EQU MBARx+$084;Chip Select 0 mask register
CSCR0 EQU MBARx+$088;Chip Select 0 control register
CSAR1 EQU MBARx+$08C;Chip Select 1 address register
CSMR1 EQU MBARx+$090;Chip Select 1 mask register
CSCR1 EQU MBARx+$094;Chip Select 1 control register
; All other chip selects should be programmed and made valid before global
; chip select is de-activated by validating CS0
; Program Chip Select 1 Registers
move.l#$00000000,D0;CSAR1 base addresses $00000000 (to $001FFFFF)
move.lD0,CSAR1;and $80000000 (to $801FFFFF)
move.l#$000009B0,D0;CSCR1 = 2 wait states, AA=1, PS=16-bit, BEM=1,
move.lD0,CSCR1;BSTR=1, BSTW=0
move.l#801F0001,D0;Address range from $00000000 to $001FFFFF and
move.lD0,CSMR1;$80000000 to $801FFFFF
;WP,EM,C/I,SC,SD,UC,UD=0, V=1
;Program Chip Select 0 Registers
move.l#$00800000,D0;CSAR0 base address $00800000 (to $009FFFFF)
move.lD0,CSAR0
move.l#$00000D80,D0;CSCR0 = 3 wait states, AA=1, PS=16-bit, BEM=0,
move.lD0,CSCR0;BSTR=0, BSTW=0
; Program Chip Select 0 Mask Register (validate chip selects)
move.l#001F0001,D0;Address range from $00800000 to $009FFFFF
move.lD0,CSMR0;WP,EM,C/I,SC,SD,UC,UD=0; V=1
AA
The Auto-Acknowledge Enable field determines the assertion of the internal
transfer-acknowledge for accesses specified by the chip select address.
0 = No internal transfer acknowledge (TA) is asserted.
1 = Internal acknowledge (TA) is asserted as specified by WS[3:0].
PS[1:0]
The Port Size field specifies the width of the data associated with each chip select.
It determines where data is driven during write cycles and where data is sampled
during read cycles. Port size should always be programmed to 16 bits for
MCF5249.
00 = reserved
01 = 8-bit port size
10 = 16-bit port size–Data sampled and driven on D[31:16] only
11 = 16-bit port size–Data sampled and driven on D[31:16] only
Note: A0 is not available on the external bus.
Table 10-9 Chip Select Bit Descriptions (Continued)
BIT NAME
DESCRIPTION
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.