13-22
MCF5249UM
MOTOROLA
FlashMedia Interface
Figure 13-18 Write Data To Card Without Busy
The write data sequence sends out a write packet on the DATA line, receives a CRC STATUS response
from the card, and then looks for a potential busy.
The
DATABITCOUNT is the number of bits in the packet. This includes the CRC bits. There are 16 CRC
bits for the 1-bit bus, 64 CRC bits for the 4-bit bus. The number of bits/bytes/longwords that need to be
written to FLASHMEDIADATA1 corresponds with DATABITCOUNT. The user needs to write dummy data
in stead of the CRC bits to FLASHMEDIADATA1. (use all-zero or whatever. The CRC value is calculated
inside the FlashMediaInterface, and the CRC bits written to FLASHMEDIADATA1 are discarded. All
words, except the first word, written to FLASHMEDIADATA1 contain 32 bits of data. The first word
contains the remainder. Data in the first word must be left-justified.
To read the CRC status, the host must read FLASHMEDIADATA1 once. The CRC status are the three
LSB’s of the value read.
During this sequence, the host must look for events on SHIFT_BUSY1 and INTERRUPT1. This is
accomplished by polling FLASHMEDIASTATUS or FLASHMEDIAINTSTATUS, or by waiting for interrupts
SHIFTBUSY1RISE, SHIFTBUSY1FALL, INTERRUPT1RISE, INTERRUPT1FALL.
To read/write data to/from FLASHMEDIADATA1, the host can poll FLASHMEDIAINTSTAT, wait for
interrupt, or use a DMA channel. In the following figures, the DATA lines default to a “P” state: strong ‘1’
driven by host. This is only the case if DRIVEDATAMASK was set during last write to
FLASHMEDIACMD2. Writing 0x000003 to FLASHMEDIACMD1 must take place after SHIFTBUSY1 has
gone high. One or more write packets can be sent to the card using this timing diagram.
write
FLASHMEDIACMD1 =
0x40000 +
wideShiftMask
write one or more
times to
FLASHMEDIADATA1
PP
SE
dataBitCount
PP P
Host driving bus
write
FLASHMEDIACMD1 =
0x260000 +
dataBitCount +
wideShiftMask
DATA lines
shift_busy1
Note 3: Host interface will stop SCLK_OUT clock when needed to prevent transmit underrun or receive overrun. (not shown)
Data
CRC
bitcounter1
Note 1: For 4-bit wide bus, wideShiftMask is 0x400000, CRC length is 64 bits
For 1-bit wide bus, wideShiftMask = 0, CRC length is 16 bits.
Note 2: If read data packet followed by another read data packet (block read), set
readDataMask = 0x40000. If only one read data packet, set readDataMask = 0.
Z Z S crc status
E
Card driving bus
write
FLASHMEDIACMD1 =
0x000003 +
read
FLASHMEDIA-
DATA1
(get CRC status)
Host driving
bus
S
interrupt1
write
FLASHMEDIACMD1=
0x80000
Check
interrupt1 in
FLASHMEDIASTATUS
write
FLASHMEDIACMD1=
0
L .. L
E
Z
P
Z
Card signals busy
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
..
.