2.4 mcufriend - looking for information

I like to display an image on a 2.4" mcufriend TFT display .( b&w worldmap )
I don't have a SD-card ( I ordered some but it take 3to4 weeks )
Question :
Can I display a bitmap on yhe whole schreen without using a SD-card.
As the internet is a jungle ( I'm always looking at the wrong place ) can someone help me with a tutorial ( internet adresses - pdf ) how to use without SD card.
What's the maximum size of the bitmap without SD card. ( X by Y and KB )

Could be all silly questions but after spending houres on the net I'm still as stupide as before .( did not found the info )

Thanks and best regards ,
Marco from france

Yes, you can display a 240x320 monochrome image. It uses 240 x 320 / 8 = 9600 bytes

Look at the drawBitmap_kbv example.

You can create the array data on your PC from JPG, PNG, ... with an online web program. Scale to fit your screen.

MCUFRIEND_kbv takes up a lot of Uno memory. You will only get one 9.6kB image in Flash memory.

If you have a Zero or Due, there is plenty of Flash memory to store many b+w images.

A Zero or Due has enough SRAM to decode JPEG images. Which means you can store several full colour images in Flash.

Why do you want to avoid SD card? It gives you unlimited storage of .BMP files. Even a Uno can render .BMP images.

I am guessing that you have a French Radio Amateur licence.

David.

OK David , thanks for all the info .
It's much clearer now for me .
I will not avoid a SD card but I don't have one for the moment . They are ordered but I have to wait for them.
Yes , I have a french amateur licence (F8VOA ). I'm amateur radio user and builder since 1979 and have German ( DA4BE and Belgian ON8GO licences ).

Thanks a lot
Marco

A last question ,
how quick can a bipmap image response ?
I mean , I will use it as back-ground image for a rotator controller .
The image must remain clear as the needle turns around .
The needle of the rotator needs abt one minute for a whole 360° and will change every 10° of position.
So I have to update every 1.667 seconds the image .
I wonder if the TFT is quick enough for this use .

Marco

Yes you can use a background image. You have to redraw the background as you move the "needle".
If you make sure to minimise the pixels drawn it can work smoothly. This requires careful design.

Redrawing a flat background colour is easy.
Redrawing a complex colour background photo is hard.

Please provide a real example. And with real dimensions. A 64x64 animated picture is easier than a 256x256 picture.

David.

Hi David ,

A very good year to you and all the readers .
I received finaly my SD-cards (Kingston 16G - formatted FAT32) and installed a .BMP file on it .
Then I tried to use the " showBMP_kbv_Uno sketch " on IDE 1.8.8 .
The SD is recognized so fr so good but no picture on the screen ( 2.4" MCU )
Only the blue screen from the 'fillScreen command '.
I receive following warning from the sketch in the void loop:
converting to non-pointer type 'int' from NULL [-Wconversion=NULL] if(f!=NULL){...

Any suggestions to this matter or for an other better sketch to try the BMP.

Thanks , Marco , France

Copy the example BMP files from the extras/bitmaps directory to your SD card.
View the BMP files on your PC. You should see your own BMP file as well as my examples.

Then put the SD into the display socket and run the showBMP example sketch.

What does it say on the Serial Terminal?

I presume that you are using a Uno.

David.

OK , David , thanks a lot ,
Now I have the bitmaps on mij screen .
I can see even my own bitmaps .
They are to great or to small , I have to adapt them but it's one step in the right direction .
I'll play a little bit with this tool and let know the results
Many thanks ,
Marco

Use IrfanView or similar program on your PC. You can re-size a JPEG to fit your TFT and then save as a BMP file.

What was your problem?

David.

The problem : I did not use the the samples ( in the extras ) but tried directly my own bitmap . It seems that not all the bitmap are usable for this .

I'm familar with IrfanView and will try a bitmap with that tool.I have a picture of a worldmap with my location in the middle and will use that.

Marco

Please post your original BMP. I thought that I supported quite a few of the common BMP styles.

Most microcontroller programs can only render 24-bit colour.

Irfanview can produce 2-colour, 16-colour, 256-colour palettes. Useful for Flash memory. Size is not critical for SD card.

David.

I made a bitmap with irfan and it is just fine . I don't see an " attached button " , so how upload an image or others ?

Marco

Start a reply. Then press [Preview]. It offers Attachments. From memory it dies not like BMP. You have to ZIP it. Alternatively rename to an approved type.

David.

Good morning ,

my own bitmap I could not see , was my own mistake ( wrong extension )
On the other hand , I can not visualize betty_1 , betty_4 , marilyn , tiger240x317x4 and tiger178x160x4.

But that’s no issue for me .
Attached the bitmap I will use for my antenna rotator project .

If you are familiar with , I rebuild a steering box for a HAM-IV CDE antenna rotator ( almost 40 years old device )

Marco

wereldmap_2_1.zip (32 KB)

The BMP example can render different BMP formats. However some formats require some SRAM for the colour Palettes. Your Uno can render 2-colour, 16-colour Palettes but not 256-colour Palette. Edit the BMPDEPTH from 0 to 4 (16-colour)

I have attached a ZIP which contains your image in different formats. They should all display on the PC. You need more SRAM to show the world_235x240x8.bmp version.

Since your image has very few colours you should see no difference except for the monochrome version.
However, look at the file sizes. Your original 24-bit image with 262k colours is BIG.

You could embed the monochrome image in a Uno’s Flash memory but it does not look as good as the colour images. You can store as many colour images as you want on an SD.

David.

world.zip (108 KB)

OK , that's clear .
I was playing around with the SD ( work like a USB-stick in som matter )
The world map shouldn't be 100% as I will use the map as a back-ground .
The only thing is that I need to adjust the map exactly in the middle of the tft screen . The center of the map ( that's my home - in amateur radio we called that QTH-locator - mine is JN12CW ) should be x,y zero point .
And ... I have to study the rules of SD-cards and bitmaps in order to write a simple sketch ( showing the map on TFT 2.4" and 3.5 " ).
Many thanks for all the help you gave me David , I learned a lot.

Marco

Hi David , I'm a liddle bit lost . I tried to adapt some sketches into a simple SD-card reading sketch but I don't have sufficient knowledge . Itried to find some instructions but without succes .
Do you know where to find a simple sketch which I can introduce in my own sketch . Better was : to find the info neaded to write it by my self - a hint here is mostly welcom.

Marco

You can strip my SD example down to 24-bit colour .BMP files. Just like Adafruit and other examples.

And if you know your SD filename, there is no need to scan directories. Just like Adafruit.

But another approach is to create a .RAW file from the .BMP if you know the size and shape of your image.
This is what the UTFT utility does.

Of course life is more versatile if you use the established PC formats like .BMP or .JPG
These contain information about size, colour palettes etc

David.

OK , thanks , I started to strip your example but was lost in this . The problem with this methode is :

Every time after stipped some lines from the code , I rewrtite the code into the MEGA . But this methode is not working 100% . Even when I go to far in the stripping , the screen will continue working for a while . Then , at the end the sketch and screen stop working ( no more picture on the screen ) and it is impossible to find out at exactly what moment ( during the stripping ) it went wrong .

I will try again if there is no other way .

Thanks for your help
Marco

Post your code. Someone might show you where you have gone wrong.

Personally, I am happier with a printed listing.
I can sit down with a cup of tea and a pencil. It is easy to see which statements you can remove. A pencil is MUCH better than a pen.

This applies to any computer program that is difficult to follow.

I suspect that you use pencil and paper when designing your radio equipment.
You might draw a schematic and layout with CAD tools when you have made your main design decisions.

David.