SD card reading ? - Page 1
Forum section: electronics / general

author: Jan Audio
author_rank: Frequent Contributor
timestamp: August 27, 2019, 02:35:18 pm
content: Hi, i have this ILI9341 display, it also has SD card.Does it have a controller ?, so i can download the manual,Or has the SD card a standard protocol without some controller ?How does it work ?thanks

author: MarkF
author_rank: Super Contributor
timestamp: August 27, 2019, 06:46:31 pm
content: If you have theAdafruit breakout board, the SD card has a SPI interface with it's own Chip Select pin.The SPI data and clock lines go to both the ILI9341 controller and the SD Card.Separate Chip Select pins determine which device you are talking to.I have one of their OLED Displays that works the same way. However, I have not tried reading from the SD Card.I believe they have sample code to read from the SD Card for one of their breakout boards but couldn't be bothered to search for it.

author: Fire Doger
author_rank: Regular Contributor
timestamp: August 27, 2019, 07:56:35 pm
content: Every SD Card has it's own controller embedded. They are not the same but they have to follow standard in comunication.You can interface it in 2 ways, 1 is SPI and the other is native SD. Arduino boards most of the time breakout only SPI pins.ILI9341 is an LCD controller, it has nothing to do with SD. They usually put an SD in same board because most of the time you need to store some graphics (images) to display in TFT.To be able to read content from SD in PC from file explorer you have to use a filesystem library in your MCU.It's practical impossible to write your own library since you don't know anything about how SD or filesystems works. Search for a good library for your platform and use it.https://openlabpro.com/guide/interfacing-microcontrollers-with-sd-card/

author: amyk
author_rank: Super Contributor
timestamp: August 28, 2019, 12:15:17 am
content: SD is a serial protocol (although there is a mode where you can use it as a 4-bit parallel bus for faster transfers). Anything that can do I/O with the right voltage levels can interface with one.Most of the spec has been "declassified", so you can easily find and read it. I recommend doing that.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: August 28, 2019, 10:50:35 am
content: As far as I know, talking to an SD card using the SPI protocol is free, the native protocol requires a license.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: August 28, 2019, 11:00:01 am
content: Thanks all, i,m busy with it.Quote from: Fire Doger on August 27, 2019, 07:56:35 pmDoes china also ?Quote from: Fire Doger on August 27, 2019, 07:56:35 pmI like doing so eventually, it works for DOS and windows.I get info out of those librarys when i,m stuck.Thanks for the link, i have some problems :I downloaded that site yesterday, i followed the instructions, it all works to the point i have to send command 1 ( initiate initialize ).I send command one with 4 zero bytes following, and a CRC of 0xFF, only i get no response of zero, even after waiting 1000ms before getting the response.maybe i filled the wrong arguments ?, this site says : arguments 2, what is arguments 2 ?What to fill instead of those zeros as agruments ?One more thing : i have a HC card, while i still get the 1 response, not the 5 response from command 8.

author: amyk
author_rank: Super Contributor
timestamp: August 28, 2019, 11:37:12 am
content: Quote from: GromBeestje on August 28, 2019, 10:50:35 amTechnically speaking, yes. But if you're not making a commercial product (and even then, if you're in China...), no one cares.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: August 28, 2019, 11:44:32 am
content: I,m only intrested in the SPI protocol.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: August 28, 2019, 02:37:04 pm
content: I also have another problem : if i connect the scope to the CLK, it all works.Once the scope is not connected to CLK, it wont work, weird.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: August 29, 2019, 01:21:33 pm
content: I got it all working.The sample at end fixes for without scope connected.The problematic commands you have to repeat until right response.Time to take a look at the FAT32.