K60 SDHC Module CINS Bit in PRSSTAT Register is always 1 !?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

K60 SDHC Module CINS Bit in PRSSTAT Register is always 1 !?

跳至解决方案
1,592 次查看
monXii
Contributor III

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?

1 解答
1,112 次查看
monXii
Contributor III

hey all.

 

i found 2 mistakes..

 

one on my side .. one on mqx side :smileyhappy:

 

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..

在原帖中查看解决方案

1 回复
1,113 次查看
monXii
Contributor III

hey all.

 

i found 2 mistakes..

 

one on my side .. one on mqx side :smileyhappy:

 

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..