English
Language : 

K60P100M100SF2RM Datasheet, PDF (1642/1809 Pages) Freescale Semiconductor, Inc – K60 Sub-Family Reference Manual
Initialization/application of SDHC
set BCEN bit;
if (auto12 command is to use) set AC12EN bit;
}
}
write_reg(CMDARG, <cmd_arg>); // configure the command argument
write_reg(XFERTYP, wCmd); // set Transfer Type register as wCmd value to issue the command
}
wait_for_response(cmd_index)
{
while (CC bit in IRQ Status register is not set); // wait until Command Complete bit is set
read IRQ Status register and check if any error bits about Command are set
if (any error bits are set) report error;
write 1 to clear CC bit and all Command Error bits;
}
For the sake of simplicity, the function wait_for_response is implemented here by means
of polling. For an effective and formal way, the response is usually checked after the
command complete interrupt is received. By doing this, make sure the corresponding
interrupt status bits are enabled.
For some scenarios, the response time-out is expected. For instance, after all cards
respond to CMD3 and go to the standby state, no response to the host when CMD2 is
sent. The host driver shall deal with 'fake' errors like this with caution.
52.6.2 Card identification mode
When a card is inserted to the socket or the card was reset by the host, the host needs to
validate the operation voltage range, identify the cards, request the cards to publish the
relative card address (RCA) or to set the RCA for the MMC cards. For CE-ATA, the
device is connected in a point-to-point manner, and no RCA is needed. All data
communications in the Card Identification Mode use the command line (CMD) only.
Refer to CE-ATA Digital Protocol, Revision 1.1 for more details.
52.6.2.1 Card detect
The following diagram illustrates the detection of MMC, SD and SDIO cards using the
SDHC.
1642
K60 Sub-Family Reference Manual, Rev. 6, Nov 2011
Freescale Semiconductor, Inc.