SD card on ILI9341 display board??

RogerClark
Fri Jun 23, 2017 10:39 pm
Guys

Just a quick question..

Has anyone used the SD card on the ILI9341 display board.

It looks like it has resistors in series with the data lines, which is possibly to make it compatible with 5V systems.

I am going to short these on my board and give it a try, but I wondered if there were any other gotya’s that I should be aware of ?

PS. I’m building a data logger


zmemw16
Sat Jun 24, 2017 12:41 am
can i ask for before & after pics?
srp

RogerClark
Sat Jun 24, 2017 1:07 am
[zmemw16 – Sat Jun 24, 2017 12:41 am] –
can i ask for before & after pics?
srp

Not sure what you mean.

They are just small SMD resistors on the back of the display PCB. I think I can solder bridge them even without using a small piece of wire (probably) and if not, I’ll just use a small strand of copper wire from puled out of the middle of an insulated wire.


ChrisMicro
Sat Jun 24, 2017 4:52 am
Hi Roger,
just a few days ago I experimented making a wav-player with a BluePill using the SD-card of an ILI9341 ( I connected only the SD-card pins).
So far the SD-card access worked.
But there are different versions of the ILI9341 boards.

RogerClark
Sat Jun 24, 2017 4:53 am
Thanks Chris

BTW. Did you connect the SD to SPI 2 or share with the display on SPI 1?


ChrisMicro
Sat Jun 24, 2017 6:00 am
I think this was one of my code experiments, but I used the STM32GENERIC:

// SD-card pins
// SCK <--> PA5
// MISO <--> PA6
// MOSI <--> PA7
#include <SPI.h>
#include <SD.h>

const int chipSelect = PA8;

// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(115200);
for(int n=0;n<5;n++)
{
delay(1000);
Serial.print(".");
}
pinMode(chipSelect,OUTPUT);

Serial.print("\nInitializing SD card...");

// we'll use the initialization code from the utility libraries
// since we're just testing if the card is working!
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Serial.println("initialization failed. Things to check:");
Serial.println("* is a card inserted?");
Serial.println("* is your wiring correct?");
Serial.println("* did you change the chipSelect pin to match your shield or module?");
return;
} else {
Serial.println("Wiring is correct and a card is present.");
}

// print the type of card
Serial.print("\nCard type: ");
switch (card.type()) {
case SD_CARD_TYPE_SD1:
Serial.println("SD1");
break;
case SD_CARD_TYPE_SD2:
Serial.println("SD2");
break;
case SD_CARD_TYPE_SDHC:
Serial.println("SDHC");
break;
default:
Serial.println("Unknown");
}

// Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
if (!volume.init(card)) {
Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
return;
}

// print the type and size of the first FAT-type volume
uint32_t volumesize;
Serial.print("\nVolume type is FAT");
Serial.println(volume.fatType(), DEC);
Serial.println();

volumesize = volume.blocksPerCluster(); // clusters are collections of blocks
volumesize *= volume.clusterCount(); // we'll have a lot of clusters
volumesize *= 512; // SD card blocks are always 512 bytes
Serial.print("Volume size (bytes): ");
Serial.println(volumesize);
Serial.print("Volume size (Kbytes): ");
volumesize /= 1024;
Serial.println(volumesize);
Serial.print("Volume size (Mbytes): ");
volumesize /= 1024;
Serial.println(volumesize);

Serial.println("\nFiles found on the card (name, date and size in bytes): ");
root.openRoot(volume);

// list all files in the card with date and size
root.ls(LS_R | LS_DATE | LS_SIZE);
}

void loop(void) {

}


RogerClark
Sat Jun 24, 2017 6:02 am
Thanks

I presume it is defaulting to SPI1


ag123
Sat Jun 24, 2017 6:10 am
i shorted those series resistors on mine, simply replace them with a single strand of wire each
http://www.stm32duino.com/viewtopic.php … 026#p27139
i removed the resistors this way and later solder wires in its place
https://www.youtube.com/watch?v=8JM4oCpWnjU
it works well for me

however, as i do not want to remove the on board LDO regulator, what i did is to connect the 5V VIN on my (baite) maple mini to VCC on the ILI9341 board. do verify voltages with a multi/volt meter. in this way i power my MM using my usb connector hooked up to the pc and in turn power up the ILI9341 board using 5v which supplies 3.3v post LDO to the LCD circuits and the SD card. i saved 2 wires that way

use good quality and preferably shorter wires if possible connecting the SPI lines as it seemed at the highest SPI speeds and with SD-Fat Beta using SD-Fat-Ex class there could be (CRC?) errors at the fastest speeds e.g. say around 2 MB per secs on maple mini and with SPI. my wires are long (30cm). And as my tests with SD Fat Ex has errors at higher speeds i did not use SD-Fat-Ex. i used the ‘old’ SD Fat class as my data logging speeds i need is rather low

note this photo is hosted on imgur hence it is not permanent, you could download the image from imgur to view its original high resolution 10mp photo
http://imgur.com/a/Z8SXl
Image


RogerClark
Sat Jun 24, 2017 6:51 am
@ag123

Thanks

I’m currently feeding 3.3 into its Vcc, and I also connected its Vcc to its LED (I soldered a strap on the back of the board)

I’m not sure if I can feed the backlight LED with 5V or not


ag123
Sat Jun 24, 2017 7:02 am
for the backlight, i feed a normal gpio pin directly from my maple mini to the backlight pin.
http://www.stm32duino.com/viewtopic.php … 193#p27193

But before you do that, try first with a resistor say a few hundred ohms connecting in series to the backlight pin and measure voltages. i tried that and found that there is actually series resistors on ILI9341 board to the backlight led. i.e. it is not ‘shorted’. after that i connect my stm32 gpio pin directly to the backlight instead. hence i can turn on/off backlight from gpio from my sketch

as for using 3.3v VCC, my only concern is that the dropout would leave the lcd as well as sd card with 2+ volts. my guess is that it should still work but to prevent issues, i feed the 5v pin into VCC so that downstream of the ILI9341 LDO i’d get 3.3v. i do not want to remove the LDO on the ILI9341 board as i think it is useful and power is ‘separated’ i.e. the LDO on maple mini won’t need to supply the LCD and SD card


david.prentice
Sat Jun 24, 2017 2:33 pm
What is the problem?

You can feed 5V to the VCC pin. The LDO will provide 3.3V for SD and TFT. (and XPT2046 if mounted)

If you only have 3.3V, you make the solder-bridge to disable the LDO.

Since the STM32 has got 3.3V GPIO all the electronics will work just fine. You need no extra components.
In contrast to Arduino Uno/Mega owners with 5V GPIO that must use level shifters.

The backlight already has a series resistor. It should be fine with a 3.3V supply.
I would add some extra series resistance for a 5V supply.

No, you can’t switch the backlight LED with the STM32 GPIO. You need an extra transistor.
Some of these Red ILI9341 displays have this transistor mounted on the pcb.

David.


RogerClark
Sat Jun 24, 2017 11:02 pm
[david.prentice – Sat Jun 24, 2017 2:33 pm] –

I would add some extra series resistance for a 5V supply.

Yes. Thats what I was referring to. I need to confirm what value is necessary , if at all


ag123
Sun Jun 25, 2017 8:13 am
on my board for the backlight led pin i initially connected a 220 ohm resistor measure voltages and worked out the on board series resistance.
it turns out that the on-board series resistance is 900 ohm in my case
http://www.stm32duino.com/viewtopic.php … 193#p27193
my guess is that if you have an ohmmeter (or a multimeter with it) you may like to try measuring it directly
it is better not to assume it is 900 ohm as there are forum posts on some sites which gives it at 4 ohm which is not ok

5v / 900 ohm ~ 5.56 mA, i’d guess it is pretty safe if it is indeed the case


stevestrong
Sun Jun 25, 2017 8:16 am
On my TFT board with SD card slot there are no resistors at all on the SD card lines.
EDIT
I use the board with 3.3V.

ag123
Sun Jun 25, 2017 8:22 am
it do sound like there are various ‘versions’ of ILI9341 boards floating around, my guess is that the components between different batches of boards are different or even within the same batch it may be different. hence, to be safe, it’d probably be better to be somewhat careful, have a multi-meter handy and measure voltages etc, lest one gets a ‘magic smoke’ scenario

my board don’t have that touch screen controller, i saved a dollar perhaps but i’d not recommend it (the one without touch screen) as a touch screen is useful really


RogerClark
Sun Jun 25, 2017 10:40 am
I have several boards, I’ll see if any are different or if they all have the SD resistors

Pito
Mon Jun 26, 2017 4:17 pm
SDcard’s SPI signal path resistors – they usually put there 1k resistors to avoid excessive currents when connecting Sdcard to 5V logic (poor man’s level shifter), but I would not short them, better do what I do just now :) -> replace those 1k resistors with 22-47ohm resistors in all 4 SPI Sdcard signals (if possible) to avoid ringing and other mess..

RogerClark
Mon Jun 26, 2017 9:46 pm
[Pito – Mon Jun 26, 2017 4:17 pm] –
SDcard’s SPI signal path resistors – they usually put there 1k resistors to avoid excessive currents when connecting Sdcard to 5V logic (poor man’s level shifter), but I would not short them, better do what I do just now :) -> replace those 1k resistors with 22-47ohm resistors in all 4 SPI Sdcard signals (if possible) to avoid ringing and other mess..

OK.

I will need to order some SMD resistors , as I dont have any SMD of that value.

( i could solder conventional resistors but it would be messy )


ag123
Tue Jun 27, 2017 6:27 am
i shorted those spi lines, replace with wires it seemed to work just ok for me, no problems so far :?

RogerClark
Tue Jun 27, 2017 10:51 am
[ag123 – Tue Jun 27, 2017 6:27 am] –
i shorted those spi lines, replace with wires it seemed to work just ok for me, no problems so far :?

I will do that until I get some resistors


Leave a Reply

Your email address will not be published. Required fields are marked *