# SPI TFT-LCD drawBitmap

**URL:** <https://forum.amebaiot.com/t/spi-tft-lcd-drawbitmap/5143>\
**Category:** SDK\
**Tags:** evb-amb82\
**Created:** [October 10, 2026, 3:16am UTC](https://forum.amebaiot.com/t/spi-tft-lcd-drawbitmap/5143 "2026-10-10T03:16:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkuo2000](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/rkuo2000/32/1105_2.png) [@rkuo2000](https://forum.amebaiot.com/u/rkuo2000)\
**Post date:** [October 10, 2026, 3:16am UTC](https://forum.amebaiot.com/t/spi-tft-lcd-drawbitmap/5143/1 "2026-10-10T03:16:54Z")

</div>

Application: Muse-Charm  
EVB : AMB82-mini  
SPI : ILI9341 TFTLCD  
example : [EdgeAI-AmebaPro2/Arduino/AMB82-mini/ILI9341\_Bitmap at main · rkuo2000/EdgeAI-AmebaPro2 · GitHub](https://github.com/rkuo2000/EdgeAI-AmebaPro2/tree/main/Arduino/AMB82-mini/ILI9341_Bitmap)

failed code : [ILI9341\_Bitmap\_org.ino](https://github.com/rkuo2000/EdgeAI-AmebaPro2/blob/main/Arduino/AMB82-mini/ILI9341_Bitmap/ILI9341_Bitmap_org.ino)

void drawBitmap(int16\_t x, int16\_t y, int16\_t w, int16\_t h, const unsigned short \*color)  
{  
tft.drawBitmap(x, y, w, h, color);  
delay(500);  
}

bug found by codex :  
The loop itself is fine. The likely cause is your installed AmebaILI9341::drawBitmap() (/home/rkuo/.arduino15/packages/realtek/hardware/AmebaPro2/4.1.1-build20260922/libraries/SPI/src/AmebaILI9341.cpp:248):

- It casts away `const` and swaps the source image’s bytes in place.
- It passes that array to SPI as both the transmit and receive buffer, allowing received data to overwrite the image.

That is unsafe for your `const ... PROGMEM` images and can break repeated drawing. All seven image arrays have the correct size and contain nonblack pixels.

I updated ILI9341\_Bitmap.ino (ILI9341\_Bitmap.ino:25) to transmit RGB565 bytes directly, preserving the image arrays and bypassing the faulty bulk transfer.

The modified sketch compiles successfully with your AMB82 toolchain. Upload it to verify the display; drawing may be slower with this workaround.

fixed code : [ILI9341\_Bitmap.ino](https://github.com/rkuo2000/EdgeAI-AmebaPro2/blob/main/Arduino/AMB82-mini/ILI9341_Bitmap/ILI9341_Bitmap.ino)

1. This is drawing much slower, is it possible to fix ILI9341 SPI driver ?

2. SPI1 did not work :  
#define TFT\_CS SPI1\_SS  
AmebaILI9341 tft = AmebaILI9341(TFT\_CS, TFT\_DC, TFT\_RESET, &SPI1);

---

<div class="post-metadata">

**Author:** ![KevinKL](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/kevinkl/32/2632_2.png) [@KevinKL](https://forum.amebaiot.com/u/KevinKL)\
**Post date:** [October 12, 2026, 12:01pm UTC](https://forum.amebaiot.com/t/spi-tft-lcd-drawbitmap/5143/2 "2026-10-12T12:01:16Z")

</div>

Hi @rkuo2000 ,

1. Please find the attached patch of `AmebaILI9341.cpp` and `AmebaILI9341.h` for replacement. We have updated the `drawBitmap()` such that data is transmitted through the TX-only stream API via a private staging buffer and wait on TX\_BUSY between chunks.
2. To use SPI1, kindly rename object SPI to SPI1 in your example code.

Thank you.

[AmebaILI9341\_patch.zip](https://forum.amebaiot.com/uploads/short-url/8lLf0qiqzdnQH1AdGOurWjLXUFd.zip) (5.4 KB)
