s6e2c2 SDIF driver | Cypress Semiconductor

s6e2c2 SDIF driver

Summary: 3 Replies, Latest post by bhwj on 03 Nov 2016 02:44 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
stevend_1820326's picture
User
2 posts

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

BMAH's picture
Cypress Employee
196 posts

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.

 

stevend_1820326's picture
User
2 posts

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

bhwj's picture
Cypress Employee
32 posts

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_spe... SDCD pin level iis active in a level of low, for detecting SD card.
 

Log in to post new comments.