Interfacing generic MicroSD card adapter with PSOC 5LP

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

cross mob
Y_r
Level 4
Level 4
50 replies posted 50 sign-ins 25 replies posted

Hello Community and @MotooTanaka san,

I am trying to get a MicroSD card adapter with an SPI interface to interface and work with the PSOC 5LP. 
I have been trying to read through the SPI datasheet but there's no mention of using an SD card.😬

Can anyone please share any example project of successful interfacing of an SPI-based SD card adapter with PSOC 5LP?
Or the steps on how to and where to start with? Pin connections? PSOC Creator components to use?...

I have a little understanding of the working of the FAT filesystem.

Regards,
Yash

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Yash,

Have you checked out the emFile component?

There are emFile examples available.

You need to make sure the emFile example you're going to use assigns the SPI pins you need to interface to your SDCard.

Note:  Most SDCard boards can ONLY use a maximum of 3.3V as a power supply to its VDD.  Most PSoC kit/eval boards default to 5V.

Some SDcard boards can take 5V as a supply but have a LDO to 3.3V and also include SPI signal level translators.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

7 Replies
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi

Attached is a sample project I "found" somewhere, and as far as I tested tonight, 

the Examples\PSoC5LP_Fatfs can be compiled.

I'm sorry but I have not tested this by myself, but this could provide you some hints.

 

And there also are the following discussions...

https://community.cypress.com/t5/PSoC-5-3-1-MCU/sd-card/m-p/151560

https://community.cypress.com/t5/PSoC-5-3-1-MCU/SD-card-with-PSoC-5LP/m-p/176233

Note: You can search discussions by entering "SC card 5LP" in the search bar.

moto

 

 

0 Likes

Hello Tanaka-san,

"Note: You can search discussions by entering "SC card 5LP" in the search bar."
>> I did search the community but didn't find much info, which is why i created this thread hoping someone might have done what I am trying to do for now.

"Attached is a sample project I "found" somewhere, and as far as I tested tonight, 

the Examples\PSoC5LP_Fatfs can be compiled.

I'm sorry but I have not tested this by myself, but this could provide you some hints."
>> Does this mean that you are able to build the project but haven't tested it on your end?

I am currently going through the github link that you pointed to.

Thanks and Regards,
Yash

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Yash,

Have you checked out the emFile component?

There are emFile examples available.

You need to make sure the emFile example you're going to use assigns the SPI pins you need to interface to your SDCard.

Note:  Most SDCard boards can ONLY use a maximum of 3.3V as a power supply to its VDD.  Most PSoC kit/eval boards default to 5V.

Some SDcard boards can take 5V as a supply but have a LDO to 3.3V and also include SPI signal level translators.

Len
"Engineering is an Art. The Art of Compromise."

Hi Len,

"Have you checked out the emFile component?"
>>I was going through the emFile component, but it seemed to be too complex to comprehend the usage and working of the component itself - which is why i created this thread to see if someone else has already made what i am trying to do right now.
Going through the datasheet of the emFile component now.

"There are emFile examples available."
>> Planning on checking it out once I finish up trying to understand the emFile datasheet and the working.
BTW, would be great if someone can generalize the working of the component to understand it easier😅😛

"Some SDcard boards can take 5V as a supply but have a LDO to 3.3V and also include SPI signal level translators."
>> I believe the SD card module that i have is 5V input and comes under the above category with LDO and level shifters.
Is there a need of using any pull-ups on any SPI lines in this scenario?


Thanks and Regards,
Yash

0 Likes

Yash,

I've created a few designs that you emFile myself.

In general, the HW interface from the PSoC to the SD card is fairly simple.  SD card interfaces use SPI and if level-shifters don't exist on the SD card, the PSoC5 has a means to provide it.

Is there a need of using any pull-ups on any SPI lines in this scenario?

The only line that needs a pull-up is the bidirectional data line.   Many times, the pull-up is alrealy included on the SD card board.

Is there any datasheet or schematics on the SD card board you can share with us?

This way we can help you with ideas of proper hookups to the PSoC.

Are you using a PSoC5LP kit or eval board?  This info will help.

Len
"Engineering is an Art. The Art of Compromise."
lock attach
Attachments are accessible only for community members.

Hi Len,

"Is there any datasheet or schematics on the SD card board you can share with us?"
>> The MicroSD card module that I have with me has similar schematics to the image file i attached with the post.
There's a level shifter on board too.


Also, i am using the PSOC 5LP CY8CKIT-059 kit.

I am currently going through the emFile_example to start with.
Would you suggest something else?

Regards,
Yash

 

0 Likes

Yash,

Because the SDcard already has the level translators built-in, you can you virtually any GPIO pins on the CY8CKIT-059 kit.

You should be able to use any emFile example.  Once you determine which pins you plan to use for MISO, MOSI, SCK and CS, make sure you assign the these pin in the Design Wide Resource\Pins tab.

With the built-in level translators, you should not need pull-ups.

Len
"Engineering is an Art. The Art of Compromise."