MCUFriend_kbv BAD BMP ID for bitmaps

I've been googling up and down but I haven't been able to find any results.

I've gotten pretty far with my experimentation with my LCD panel, setting orientation, inverting colors (mine needed this) and more, but I was unable to create any decent graphics to show on my panel.

I tried creating an array of the bitmap (using an online tool) but was unable to due to lacking c++ skills (setAddrWindow, pushColors etc.).

Then I tried the showBMP_kbv_UNO example, formatting my SD card to FAT16 and converted my image to 24-bit truecolor bitmap. The result was BAD BMP ID.

I even tried downloading that tiger.bmp image that was available with an online tutorial, still the same results.

Further googling mentioned something that different controllers could handle bmp's differently. E.g 5-5-6 instead of 5-6-5 etc.

I'm unable to determine if my controller needs any special setup for this task, so was hoping for some guidance.

It's a 9488 shield bought from China, and the registry values are as follows:

reg(0x0000) 00 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 54 80 66 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x000A) 00 08 Get Power Mode
reg(0x000C) 00 06 Get Pixel Format
reg(0x0061) 00 00 RDID1 HX8347-G
reg(0x0062) 00 00 RDID2 HX8347-G
reg(0x0063) 00 00 RDID3 HX8347-G
reg(0x0064) 00 00 RDID1 HX8347-A
reg(0x0065) 00 00 RDID2 HX8347-A
reg(0x0066) 00 00 RDID3 HX8347-A
reg(0x0067) 00 00 RDID Himax HX8347-A
reg(0x0070) 00 00 Panel Himax HX8347-A
reg(0x00A1) 00 93 30 93 30 RD_DDB SSD1963
reg(0x00B0) 00 00 RGB Interface Signal Control
reg(0x00B4) 00 02 Inversion Control
reg(0x00B6) 00 02 02 3B 3B Display Control
reg(0x00B7) 00 06 Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00 ILI9481, HX8357-B
reg(0x00C0) 00 0E 0E 0E 0E 0E 0E 0E 0E Panel Control
reg(0x00C8) 00 B0 B0 B0 B0 B0 B0 B0 B0 B0 B0 B0 B0 GAMMA
reg(0x00CC) 00 03 Panel Control
reg(0x00D0) 00 00 00 Power Control
reg(0x00D2) 00 00 00 00 0C NVM Read
reg(0x00D3) 00 00 94 88 ILI9341, ILI9488
reg(0x00D4) 00 97 00 00 Novatek ID
reg(0x00DA) 00 54 RDID1
reg(0x00DB) 00 80 RDID2
reg(0x00DC) 00 66 RDID3
reg(0x00E0) 00 00 07 0C 05 13 09 36 AA 46 09 10 0D 1A 1E 0F GAMMA-P
reg(0x00E1) 00 00 20 23 04 10 06 37 56 49 04 0C 0A 33 37 0F GAMMA-N
reg(0x00EF) 00 00 00 00 00 00 ILI9327
reg(0x00F2) 00 58 04 12 02 22 22 FF 0A 90 14 88 Adjust Control 2
reg(0x00F6) 00 00 00 00 Interface Control

It looks like you have a 9488_555 display. It has a serious hardware fault. I kludge the colours to give reasonable graphics.

You will never get perfect colour photos.

Regarding BMP. If the BMP file displays on your PC, it should display on the TFT.
PC programs like IrfanView can transform JPEGs into BMP. Scale a big picture into 320x480 for your TFT.

I don't know about any Online program for creating BMP files. What program have you been trying to use?

It looks as if I have put five tiger*.bmp examples in the library extras/bitmaps folder.
Note that some of these use Colour Palettes. The tiger_240x312x4.bmp file is a 16-colour Palette BMP. The example sketch can display it if you alter PALETTEDEPTH to 4

David.

Thanks David,

I tried uncommenting the definition of PALETTEDEPTH 8 and it did not work, I will try setting it to 4 - but to be honest I do not think it'll make any difference as what I've googled says the BMP ID is embedded in the file so changing this won't make a difference.

I'll try when I get a chance though.

Could you explain how you've read out the information that it's a 555 display?

All the example BMP files in the extras/bitmaps are valid BMP files. They should all be viewable on your PC. All BMP files start with "BM" i.e. the first two bytes of the header are 0x42, 0x4D.

The formats differ. I provide several examples.

Note that a Uno does not have enough SRAM for a 256-colour Palette. (PALETTEDEPTH=8). You can not render Marilyn
You should be fine with 16-colour Palette (PALETTEDEPTH=4) or 2-Colour Palette (PALETTEDEPTH=1) . You can render Betty and Tigers.

Pure guesswork about 9488_555 based on you whingeing about colours and 556.
The library does a diagnostic test. It can distinguish between regular ILI9488 shields and the ones with the hardware defect. You can tft.readReg(0x0C)

David.

Thank you David!

The tiger.bmp successfully painted with depth 4 :slight_smile: