help micro sd configuration urgent Pantalla tft MCUFRIEND

Hello ! I am new to arduino and they gave me a tft screen of mcufriend but the problem is that I am not able to communicate with the sd and the examples given by the library of the manufacturer are very confusing and I am doing a project! and to show the temperature data through that screen! everything was fine because I decided to use the flash memory of the arduino mega but it reaches a point where the bitmap arrays are not displayed to me and I do not know what to do but if I have space left in the memory flah! I have it at 48% then because it is not displayed! Then I told myself to use an external storage but I could not with the sd! help with this case please!

Note: I have the MCUFRIEND screen tft touch 3.95 inch driver 9488

attached the manufacturer’s library and the sd code that gives the both pal one and mega


showBMP_kbv_Uno.ino (9.18 KB)

showBMP_not_Uno.ino (9.41 KB)

Leave the IDE. Please delete your v2.9.7 library directory.

Start the IDE. Install MCUFRIEND_kbv via the IDE Library Manager.

If you have a Uno, plug the shield into the Uno. Run the showBMP_kbv_Uno example.

Since you want to use a Mega, you must follow the instructions very carefully. The SD is on pins 10,11,12,13. You have to read the SD by bit-bashing SPI in software because the Mega hardware SPI pins are on 50-53.

Please quote which part you do not understand.


David ! look what happens is that I try the code showBMP_kbv_Uno. in an arduino One I gave the route as I think it would be and it does not! Blue screen remains ... something else! I have to delete the complete library! ps because in the page where they gave me the screen it says that it uses that library !! ... keep in mind that I'm not an expert and I'm just learning! If you can help me with code I would appreciate it ..... if you want to attach my code that I have and...

v2.9.7 of the library should work fine with the ILI9488. The current version is v2.9.8

I get very suspicious when someone “gives you”

The Library Manager makes sure that correct libraries are installed properly. You should always use the Library Manager whenever possible.

No, I don’t want to see your code. Just say “which” example you are running

I just want to see what library versions you are using.
File->Preferences: show verbose output during: Compilation

A lot of boring messages are produced when you compile. You only need to paste the library and memory use lines e.g.

Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino-1.8.1\hardware\arduino\avr\libraries\SPI 
Using library SdFat at version 1.0.7 in folder: C:\Users\David Prentice\Documents\Arduino\libraries\SdFat 
Using library Adafruit_GFX_Library at version 1.2.9 in folder: C:\Users\David Prentice\Documents\Arduino\libraries\Adafruit_GFX_Library 
Using library Mcufriend_kbv at version 2.9.9-Beta in folder: C:\Users\David Prentice\Documents\Arduino\libraries\Mcufriend_kbv 
Sketch uses 32204 bytes (12%) of program storage space. Maximum is 253952 bytes.
Global variables use 1057 bytes (12%) of dynamic memory, leaving 7135 bytes for local variables. Maximum is 8192 bytes.

You will have version 2.9.8-Release. I am using a Beta version.
It is unlikely that your “User name” is “David Prentice”


ok I'm using the example "showBMP_kbv_Uno" which is for the arduino one ... I am using this to see if it works ,,,, because the one that is for the mega is very complex and I do not understand .... and from libraries I have this this ! mcufiend 2.9.7 the one I told you .... spi and sd -> arduino native ....
I have ide the 1.6.12

Sketch uses 24,778 bytes (76%) of the program's storage space. The maximum is 32,256 bytes.
Global variables use 1,027 bytes (50%) of dynamic memory, leaving 1,021 bytes for local variables. The maximum is 2,048 bytes.

but when compiling I do not get it like you .....

I have one more doubt in the line of code this

char namebuf[32] = "/";   //BMP files in root directory
//char namebuf[32] = "/bitmaps/";  //BMP directory e.g. files in /bitmaps/*.bmp

Because I do not know how it goes well there! because I have in the micro sd a bmp image called 1, pero igual la he llamado

 char namebuf[32] = "/1/"; 
char namebuf[32] = "/1.bmp/";

I do not know how to call! and sorry if I'm tired but something of a project and I must understand well...

Please try the example bitmaps that come with the library.

You can copy them to your microSD card root directory i.e. /
Or copy the whole bitmaps directory to the SD

Run the sketch. It should display all the BMP pictures.

Then copy your BMP to the same directory. It will be displayed with all the other pictures. Make sure that the name ends with .bmp

When this is all working you can create special directories for your BMP pictures.
And specify the directory in namebuf

Then you can try the non-Uno program on your Mega.

The Library Manager should work fine in IDE v1.6.12 but it is wise to upgrade the IDE occasionaly.
I am still using IDE v1.8.1 on my desktop PC. And v1.8.7 on my laptop PC.

I suspect that you are a non-English speaker. These things are difficult for English speakers. If you do not understand something, ask the question.


okay ! can already accommodate the “showBMP_Uno” code using the arduino one logically! already the images are shown etc … but I have to use it is a mega and seeing the code of the mega I understand the more but there is a section that I do not understand! what is

/ MCUFRIEND UNO shields have microSD on pins 10, 11, 12, 13
// The official <SD.h> library only works on the hardware SPI pins
// e.g. 11, 12, 13 on a Uno
// e.g. 50, 51, 52 on a Mega2560
// e.g. 74, 75, 76 on a Due
// if you are not using a UNO,  you must use Software SPI:
// install v1.0.1 of the <SdFat.h> library with the Arduino Library Manager.
// edit the src/SdFatConfig.h file to #define ENABLE_SOFTWARE_SPI_CLASS 1
// copy all your BMP files to the root directory on the microSD with your PC
// (or another directory)

#include <SPI.h>             // f.k. for Arduino-1.5.2
#define USE_SDFAT
#include <SdFat.h>           // Use the SdFat library
SdFatSoftSpi<12, 11, 13> SD; //Bit-Bang on the Shield pins

those libraries do not understand well for what they are and in the part that says that I modify a file I almost do not understand it so I have to modify it! and also I look for it and I can not find the library where is this sdFat

The IDE Library Manager can be found from the Sketches menu.

Install or Upgrade Adafruit_GFX, MCUFRIEND_kbv, SdFat libraries via the Library Manager..
You can see the versions that were used when I compiled the showBMP_not_Uno example in #3.

I am sure that there will be Arduino Tutorials written in your own language that show how to use the Library Manager. Google Translate is pretty good. But it is never as good as a document written in your native language.

This is also a good reason for adding your country and language to your Forum profile.
There are members from every country in the world.


okay ! but the problem is that I can not find that file that says there that I modified it, I can not find it! "src / SdFatConfig.h file to #define ENABLE_SOFTWARE_SPI_CLASS 1" of that they do not explain it to me or anything like that! I do not know if it's necessary to change that file

Thanks for adding your country. There are many Spanish speakers on the Forum. I only speak English.

I updated my “SdFat” library via the Library Manager. You can see from #3:

Using library SdFat at version 1.0.7 in folder: C:\Users\David Prentice\Documents\Arduino\libraries\SdFat

I edited line #55 in this file:

C:\Users\David Prentice\Documents\Arduino\libraries\SdFat\src\SdFatConfig.h

I strongly recommend that you use the Library Manager. You will find the SdFatConfig.h file in a similar place on your PC.
I also recommend that you select “verbose Compilation” in IDE File->Preferences


if I install it by the administrator but look, it does not work out like you

and I get that it is installed in the library manager!

The IDE gets installed in Program Files which requires Administrator permission.
System libraries like SPI go in Program Files with the rest of the IDE

The Library Manager puts User libraries like Adafruit_GFX in your User directory.

Look carefully at where my libraries are located in #3.

You get serious problems when people put User libraries into Program Files directories.

I suggest that you delete these directories from Program Files e.g. MCUFRIEND_kbv

Then restart the IDE and installl them properly with the Library Manager.

This is very technical. Ask a friend or teacher to help you.