ILI9225 sekilas
Item | Nilai | Sumber |
|---|---|---|
Resolusi | 176 × 220 | Driver DRM |
Antarmuka host pada driver-driver tersebut | SPI 4-kabel dengan pin RS (D/C) | Device-tree binding Linux ( |
Model register | Indeks 8-bit, nilai 16-bit | Driver Linux |
Format piksel melalui SPI | RGB565, 2 byte per piksel | Driver Linux (16 bit per kata untuk 0x22), LovyanGFX |
Satu frame penuh | 176 × 220 × 2 = 77.440 byte | Dihitung |
Readback | Tidak digunakan oleh LovyanGFX ("pin RW tidak didukung") | LovyanGFX |
Saat halaman ini ditulis, kami belum bisa mendapatkan salinan datasheet Ilitek, sehingga tegangan suplai, rentang suhu, dan batas timing SPI tidak dicantumkan. Ambil informasi tersebut dari datasheet atau spesifikasi modul yang disertakan dengan panel Anda.
Ini bukan ILI9341 dengan layar yang lebih kecil
Sebagian besar driver TFT SPI berukuran kecil, seperti ILI9341 dan ST7789V, menggunakan perintah MIPI DCS: 0x2A dan 0x2B mengatur window, 0x2C menulis piksel, dan 0x36 (MADCTL) mengatur orientasi. ILI9225 menggunakan skema berbasis register yang berbeda:
Fungsi | ILI9341 / ST7789 (MIPI DCS) | ILI9225 |
|---|---|---|
Menulis piksel | | |
Window kolom / baris | | |
Alamat awal | Tersirat oleh window | |
Orientasi dan urutan warna | | |
Ukuran parameter | Byte | Satu nilai 16-bit per register |
Pada ILI9225, 0x36 adalah register window, bukan MADCTL. Itulah sebabnya kode ILI9341 menghasilkan layar kosong atau kacau. Periksa juga board-nya sendiri: README TFT_22_ILI9225 mencatat bahwa modul 2.2″ 240×320 yang tampak sangat mirip menggunakan ILI9341.
Menulis register melalui SPI
Driver Linux mengirim indeks register sebagai satu transfer 8-bit dengan RS low. Kemudian driver menaikkan RS dan mengirim nilainya. Untuk data piksel di register 0x22, driver beralih ke word SPI 16-bit. LovyanGFX melakukan hal yang sama dengan perintah 8-bit dan data 16-bit. Dalam praktiknya:
- Penulisan register: RS low, kirim byte indeks; RS high, kirim byte tinggi nilai, lalu byte rendahnya.
- Piksel: kirim indeks
0x22, naikkan RS, lalu stream piksel RGB565, masing-masing 2 byte.
Register window: isi nilai akhirnya
Menggambar persegi panjang membutuhkan enam penulisan register: empat register window, lalu dua register alamat GRAM. Driver-driver yang kami periksa sepakat pada urutannya:
0x36= batas akhir horizontal,0x37= batas awal horizontal (kode init mengisi0x36dengan0x00AF= 175)0x38= batas akhir vertikal,0x39= batas awal vertikal (0x00DB= 219)0x20dan0x21= piksel pertama yang ditulis
Header TFT_22_ILI9225 melabeli 0x36 sebagai "start", tetapi kodenya menulis koordinat akhir di sana. Jika hanya bagian tertentu layar yang ter-update, atau piksel muncul dalam bentuk strip, periksa urutan ini terlebih dahulu.
Inisialisasi
Driver Linux, TFT_eSPI, dan LovyanGFX menggunakan nilai power-on yang sama:
- Kontrol daya:
0x11=0x0018,0x12=0x6121,0x13=0x006F,0x14=0x495F,0x10=0x0800. Tunggu 10 ms, set0x11=0x103B, lalu tunggu 50 ms. - Setup panel:
0x01=0x011C,0x02=0x0100,0x03=0x1030,0x08=0x0808,0x0B=0x1100,0x0F=0x0D01,0x15=0x0020. - Scroll dan area parsial:
0x31dan0x34=0x00DB, sisanya 0. - Gamma
0x50–0x59. - Display on: TFT_eSPI menulis
0x07=0x0012, menunggu 50 ms, lalu menulis0x1017.
Nilai gamma dan daya bergantung pada glass-nya. Jika modul Anda menyertakan kode init, gunakan nilai-nilai tersebut.
Orientasi, warna, dan inversi
- Rotasi: driver Linux mempertahankan
0x01di0x011Cdan mengubah bit AM/ID di Entry Mode (0x03):0x1030(0°),0x1018(90°),0x1000(180°), dan0x1028(270°). TFT_eSPI justru mengubah0x01(0x011C,0x001C,0x021C,0x031C) dan mengalihkan0x03antara0x30dan0x38. - Merah dan biru tertukar: byte tinggi Entry Mode menyimpan urutan warna. TFT_eSPI menggunakan
0x10untuk BGR (default-nya) dan0x00untuk RGB. - Gambar negatif: LovyanGFX menulis
0x1017ke Display Control 1 (0x07) untuk gambar normal dan0x1013untuk gambar terbalik.
Seberapa cepat bisa menggambar ulang?
Satu frame penuh berukuran 77.440 byte. Waktu di bawah ini adalah bit ÷ clock, tanpa overhead perintah:
Clock SPI | Frame penuh |
|---|---|
8 MHz (TFT_22_ILI9225 di AVR) | 77 ms |
24 MHz | 26 ms |
40 MHz (TFT_22_ILI9225 di ESP32) | 15 ms |
Pada board kelas Uno, menggambar ulang seluruh layar lambat, jadi gambar hanya bagian yang berubah.
Dukungan driver
- Arduino:
TFT_22_ILI9225(Library Manager), dengan default hardware SPI per platform. - TFT_eSPI:
ILI9225_DRIVER, default 176 × 220. - LovyanGFX:
Panel_ILI9225. - Linux: DRM driver
ili9225(drivers/gpu/drm/tiny), with device-tree propertiesrs-gpios,reset-gpios, androtation.
Our ILI9225G modules
Our 2″ 176×220 SPI modules list the ILI9225G driver. For example, PJ2007I01-24H10P150 has an active area of 31.68 × 39.60 mm, a pixel pitch of 0.180 mm, 150 nit TN glass, and a 6 o'clock viewing direction. The libraries above are written for the ILI9225 register set. Verify your bring-up with the init code provided with the module.
Related pages
For the 240×320 driver that is often confused with it, see ILI9341. For SPI wiring and bus speed, see our SPI display page.
Kode inisialisasi ILI9225
// Register model used by the Linux ili9225 driver, TFT_eSPI and LovyanGFX.
// RS (D/C) low: 8-bit register index; RS high: 16-bit value, high byte first.
void reg(uint8_t idx, uint16_t val) { rs_low(); spi8(idx); rs_high(); spi8(val >> 8); spi8(val & 0xFF); }
// Window x0..x1, y0..y1 (portrait 176x220). End goes in 0x36/0x38, start in 0x37/0x39.
reg(0x36, x1); reg(0x37, x0);
reg(0x38, y1); reg(0x39, y0);
reg(0x20, x0); reg(0x21, y0); // GRAM address = window start
rs_low(); spi8(0x22); rs_high(); // then stream RGB565 pixels, 2 bytes eachModul display yang memakai ILI9225
ILI9225: troubleshooting & FAQ
Can an ILI9341 library be used with an ILI9225 display?
No. The ILI9341 uses MIPI DCS commands such as 0x2A, 0x2B, and 0x2C to set the window and write pixels. The ILI9225 uses its own register set: an 8-bit register index followed by a 16-bit value, with the window in registers 0x36–0x39 and pixel data written to 0x22. Use a library that has an ILI9225 driver, such as TFT_22_ILI9225, TFT_eSPI (ILI9225_DRIVER), or LovyanGFX (Panel_ILI9225). The library author also notes that a similar-looking 2.2″ 240×320 module uses the ILI9341, so check the resolution printed on the board.
What SPI clock does the ILI9225 run at?
The library defaults differ quite significantly. TFT_22_ILI9225 uses 8 MHz on AVR, 18 MHz on STM32F1, 24 MHz on other ARM boards, and 40 MHz on ESP32 and ESP8266. The Linux device-tree example uses 12 MHz. If the image is corrupted, lower the clock first. We do not list the clock limit from the datasheet here because we could not obtain a copy of the Ilitek datasheet to verify it.
Why is my ILI9225 image mirrored, rotated, or rendered in the wrong position?
Orientation is determined by two registers: Driver Output Control (0x01) and Entry Mode (0x03). The Linux driver keeps 0x01 at 0x011C and changes the AM/ID bits in 0x03 (0x30, 0x18, 0x00, or 0x28 for 0°, 90°, 180°, and 270°). The window registers are a common pitfall. All three drivers we checked write the window end to 0x36 and 0x38 and the start to 0x37 and 0x39, even though the header comments label them the other way around.

