s6e2c2 SDIF driver

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

   

I'm trying to implement the SD card interface driver. I'm writing in c++ (including the drivers for hardware) and I'm not using the PDL driver library (writing everything myself). I sometimes look into the code to see how it should be implemented. For the SD card interface I'm looking at the example : there is a function called "Sdcard_Init", but in the driver library that function is not declared? 

   

Another problem that I faced is the register mapping for SDIF. In the datasheet I downloaded from https://www.sdcard.org/downloads/pls/pdf/partA2_300.pdf there is only a mapping until "Host Control Version", the rest of the mapping is missing, but the registers are described in the peripheral manual. I looked up the mapping in the PDL header file, but I want to be sure that mapping is correct.

   

 

   

kind regards

0 Likes
1 Solution
bharadhwajas_91
Employee
Employee
First like received First like given

You need to invert these signals as per SD card spec ,

   


As per the spec https://www.sdcard.org/jp/developers/overview/host_controller/simple_spec/Simplified_SD_Host_Control... SDCD pin level iis active in a level of low, for detecting SD card.
 

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

Hi,

   

Sdcard_Init is part of the utility folder in the PDL structure. Please check FM_PDL_2.0.1\utility\sd_card\sd_card.c after installing PDL. It is recommended that you install PDL if for SD card interfaces. You also need to enable the SD card PDL macro to use the library functions.

0 Likes
Anonymous
Not applicable

Hello,

   

I didn't look over there and indeed the example calls those functions. But I'm stuck with another problem regarding SDIF. When I insert an SD card, it interrupts but when I look into present state register, this card inserted is set to 0, and normal interrupt status also sets cardremoval to 1. When I pull the sd card out it detects as card inserted ? Could this have something to do with hardware connection to S_CD_0? I can give the the electrical scheme if needed. 

   

 

   

kind regards

0 Likes
bharadhwajas_91
Employee
Employee
First like received First like given

You need to invert these signals as per SD card spec ,

   


As per the spec https://www.sdcard.org/jp/developers/overview/host_controller/simple_spec/Simplified_SD_Host_Control... SDCD pin level iis active in a level of low, for detecting SD card.
 

0 Likes