1.At power up this line(DAT3) has a 50KOhm pull up enabled in the card. This resistor serves two functions Card detection and
Mode Selection. For Mode Selection, the host can drive the line high or let it be pulled high to select SD mode. If the host
wants to select SPI mode it should drive the line low. For Card detection, the host detects that the line is pulled high.
above is from SD Version 2.00 spec
[em01]
2.When DAT3 is used for card detection, pulled-up resistor for DAT3 should be unconnected,another pulled-down resistor
should be connected to the ground.
3.
step1:set a timer;
step2:as the timer expires,open the power.
step3:if the card is in ,then the I/O will detect a High edge trigger.
4.there is three ways for detect,
1).one pin that are part of the socket as a external interupt,but some socket does not have this pin
2).set the timer ,polling ,send the one CMD ,then check the response,if getting the response,the card is in.
3). DAT3 as detect pin
[此贴子已经被作者于2009-4-3 14:29:47编辑过] |