
13-12
MCF5249UM
MOTOROLA
FlashMedia Interface
13.4.2
FLASHMEDIA INTERFACE OPERATION
The FlashMedia interface is build around two Interface Shift Registers, each of which work independently.
The following figure shows a block diagram of one interface shift register.
Figure 13-9 One Interface Shift Register
The processor interface sends commands to the interface shift register. One command instructs the
interface shift register to do one of the following:
Transmit a packet of N bits to the FlashMedia device. The number of bits N is programmable. It is
also programmable if bits 15:0, or bits 47:0 in SD wide bus mode, need to be replaced with a valid
CRC or not. CRC insertion is possible for MemoryStick data packet and SecureDigital data packets.
CRC insertion is not possible for SecureDigital command packets.
Receive a packet of N bits from the FlashMedia device. The number of bits N is programmable. After
reception of all bits, the interface shift register will display on status line CRC_IS_0 if CRC check was
successful or not. CRC check is done for MemoryStick data packets and for SecureDigital data
packets. No CRC check is available for SD command packets.
Wait for an interrupt event from the FlashMedia device
After writing a command to the interface shift register, the processor needs to monitor TxBUFFEREMPTY
or RxBUFFERFULL, and read or write data to the interface as required.
When the transmit shift register is empty, new data is loaded from the TxBUFFERREG. If the transmit
buffer register is empty, the interface shift register will stop the SCLK_OUT clock, and wait for new
data to be written in the TxBUFFERREG.
When the receive shift register is full, data is transferred to the RxBUFFERREG. If the receive buffer
register is full, the interface shift register will stop the SCLK_OUT clock, and wait until the
RxBUFFERREG is read to empty.
If the number of bits in the packet to sent/receive from the FlashMedia is greater than 32, multiple
longword transfers to the buffer register are needed. All of these, except the first, contain 32 packet
bits. The last data word for the transfer always contains packet bits 31-0, even if CRC transmit or
check is on.
If e.g. a 48-bit transfer is requested to the FlashMedia, the first data word will contain 16 bits, the
second one will contain 32 bits. The first word is LSB aligned for receive data, MSB aligned for
transmit data.
Interface
Shift
Register
BS (MemoryStick mode only)
Serial data
CommandBits
bitCounter
shift_busy
int_level
crc_is_0
TxBufferEmpty
RcvBufferFull
loadTxShiftReg
storeRcvShiftReg
stopclock
(to clock generator)
SERIAL DATA
RxBufferFull
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
..
.