452
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
Figure 18-13 Data Path State Machine (DPSM)
Idle:
In this state, the data channel does not work, waiting to transmit and receive data, and the SDIO_DAT[7:0]
output is in a high-impedance state. When the data control register is written and the enable bit is set, the DPSM
loads a new value for the data counter, enters the Wait_S state when the data transfer direction is from the host
to the card, and enters the Wait_R state when the data transfer direction is from the card to the host. The Read
Wait state is entered when DPSM is enabled and a read wait has started and SD I/O mode is enabled.
Wait_R:
In this state, the DPSM waits for the start bit of the received data. If the data times out (counter equals 0, when
the receive FIFO is empty) the DPSM enters the Idle state. If the data counter is not equal to 0, the DPSM waits
for a start bit on SDIO_DAT; if the DPSM receives a start bit before the timeout, it enters the Receive state and
loads the data block counter. If the DPSM times out before detecting a start bit, or if a start bit error occurs, the
DPSM will go into the idle state and set the time-out status flag.
Receive:
In this state the DPSM receives the card's data and writes it to the data FIFO. Depending on the setting of the
transfer mode bits in the data control register, the data transfer mode can be block transfer or stream transfer.
In block mode, when the data block counter reaches 0, the DPSM waits to receive the CRC code, if the
received code matches the internally generated CRC code, the DPSM enters the Wait_R state, otherwise
the CRC failure state flag is set and the DPSM enters the idle state state.
In streaming mode, when the data counter is not 0, the DPSM receives data; when the counter is 0, the
remaining data in the shift register is written into the data FIFO, and the DPSM enters the Wait_R state. If
a FIFO overflow error occurs, the DPSM sets the FIFO error flag and enters the idle state.
Idle
Busy
DPSM enabled and Read Wait has started
and SD I/O mode has been enabled
Read wait stops
Start bit
Not busy
Read Wait
Wait_R
Data has been received
"Read Wait" has started
and SD I/O mode
has been enabled
After reset
State machine is shut down
or the Rx FIFO is empty
or timed out
or the start bit is wrong
The state machine is
shut down
or a CRC error occurs
Enable and send
State machine is
shut down
Or end of data
State machine is
shut down
Or CRC error
or timeout
Send
State machine shut down
or FIFO underflow
or data end
or CRC error
End of
packet
Wait_S
Receive
DPSM was closed
Enabled and
not sent yet
Package end
or End of data
or FIFO overflow
Data is ready