English
Language : 

SAM9G25_14 Datasheet, PDF (625/1167 Pages) ATMEL Corporation – Atmel | SMART ARM-based Embedded Microprocessor
The following flowchart shows how to send a command to the card and read the response if needed. In this example, the
status register bits are polled but setting the appropriate bits in the Interrupt Enable Register (HSMCI_IER) allows using
an interrupt method.
Figure 34-7. Command/Response Functional Flow Diagram
Set the command argument
HSMCI_ARGR = Argument(1)
Set the command
HSMCI_CMDR = Command
Read HSMCI_SR
Wait for command
ready status flag
Check error bits in the
status register (1)
CMDRDY
1
Status error flags?
0
Yes
RETURN ERROR(1)
Read response if required
Does the command involve
a busy indication?
No
RETURN OK
Read HSMCI_SR
0
NOTBUSY
1
RETURN OK
Note: 1. If the command is SEND_OP_COND, the CRC error flag is always present (refer to R3 response in the High Speed
MultiMedia Card specification).
SAM9G25 [DATASHEET]
Atmel-11032E-ATARM-SAMG25-Datasheet_13-Oct-14
1625