Hello all..
I'm using a micro sd card and my card holder has no card detect ..
so i want to use the software bit CINS (card inserted) in SDHC->PRSSTAT ..
but this bit is always 1?
did someone used this bit successful?
how this bit works internally? how do they "detect" the card?
已解决! 转到解答。
hey all.
i found 2 mistakes..
one on my side .. one on mqx side
first of all the GPIO init of the SDHC pins was "wrong" ..
for card detection over the pin levels, pin 1 (DAT3) of the sdcard must have an pull-down on the host side.
pctl = (PORT_MemMapPtr)PORTE_BASE_PTR;
pctl->PCR[0] = value & (PORT_PCR_MUX(4) | PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.D1 */
pctl->PCR[1] = value & (PORT_PCR_MUX(4) | PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.D0 */
pctl->PCR[2] = value & (PORT_PCR_MUX(4) | PORT_PCR_DSE_MASK); /* ESDHC.CLK */
pctl->PCR[3] = value & (PORT_PCR_MUX(4) | PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.CMD */
pctl->PCR[4] = value & (PORT_PCR_MUX(4) | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.D3 */
pctl->PCR[5] = value & (PORT_PCR_MUX(4) | PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.D2 */
and my mistake:
i have to set the INITA bit in SDHC_SYSCTL to refresh the PRSSTAT information..
hey all.
i found 2 mistakes..
one on my side .. one on mqx side
first of all the GPIO init of the SDHC pins was "wrong" ..
for card detection over the pin levels, pin 1 (DAT3) of the sdcard must have an pull-down on the host side.
pctl = (PORT_MemMapPtr)PORTE_BASE_PTR;
pctl->PCR[0] = value & (PORT_PCR_MUX(4) | PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.D1 */
pctl->PCR[1] = value & (PORT_PCR_MUX(4) | PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.D0 */
pctl->PCR[2] = value & (PORT_PCR_MUX(4) | PORT_PCR_DSE_MASK); /* ESDHC.CLK */
pctl->PCR[3] = value & (PORT_PCR_MUX(4) | PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.CMD */
pctl->PCR[4] = value & (PORT_PCR_MUX(4) | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.D3 */
pctl->PCR[5] = value & (PORT_PCR_MUX(4) | PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK); /* ESDHC.D2 */
and my mistake:
i have to set the INITA bit in SDHC_SYSCTL to refresh the PRSSTAT information..