Zum Inhalt springen

WSAL18366 – 2.4inch LCD Module/en

Aus JW Tech Wiki
Version vom 6. September 2026, 00:36 Uhr von JWTechPublisher (Diskussion | Beiträge) (Freigegebene technische Dokumentation veröffentlicht; Text-only und noindex)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.

Summary

Technical overview of the Waveshare 2.4-inch TFT LCD with IL9341 controller and SPI interface for Raspberry Pi, STM32, and Arduino.

Related products at JW Tech

Technical overview

  • Resolution: 240 (vertical) × 320 (horizontal) pixels; display area 36.72 mm (H) × 48.96 mm (V); module size 70.5 × 43.3 mm
  • Operating voltage: 3.3 V or 5 V; with a 5 V supply the logic level is 5 V, with a 3.3 V supply it is 3.3 V
  • Driven by the on-board IL9341 controller through a four-wire SPI interface
  • Supported per-pixel color formats: 12-bit RGB444, 16-bit RGB565, 18-bit RGB666; the demo uses RGB565
  • Raspberry Pi wiring: VCC→3.3 V, GND→GND, DIN→MOSI (BCM 19), CLK→SCLK (BCM 23), CS→CE0 (BCM 24), DS/DC→BCM 22, RST→BCM 13, BL→BCM 12
  • STM32 example based on STM32F103RBT6: DIN→PA7, CLK→PA5, CS→PB6, DC→PA8, RST→PA9, BL→PC7
  • Arduino UNO example: DIN→D11, CLK→D13, CS→D10, DC→D7, RST→D8, BL→D9, VCC→5 V
  • Default SPI mode: SPI0 (CPHA=0, CPOL=0); CSX enables the chip when low, D/CX distinguishes command (0) from data (1)
  • On Raspberry Pi, enable the SPI interface via raspi-config and reboot
  • Available demos: C (BCM2835, WiringPi), Python (RPi.GPIO + spidev), STM32, and Arduino

Commands and examples – verify before use: 

sudo raspi-config
sudo reboot
sudo wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
sudo tar zxvf bcm2835-1.71.tar.gz
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
sudo apt-get install wiringpi
wget https://files.waveshare.com/wiki/common/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
sudo git clone https://github.com/WiringPi/WiringPi
cd WiringPi
sudo ./build
sudo su
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install
sudo apt-get update
sudo apt-get install python3-pip -y

Notes and version constraints

  • Pin mapping varies by target system and board revision; verify the exact pin assignment before connecting
  • On bookworm-based systems only the lgpio library is available; BCM2835 and WiringPi cannot be installed or used
  • The Python demo requires no extra libraries beyond RPi.GPIO and spidev; PIL may optionally be needed for image display
  • Different SPI modes (CPHA/CPOL) must match the controller; default is SPI0
  • If the display stays blank: verify that SPI is enabled and consider disconnecting the BL pin if it has no output
  • To change orientation: use Paint_SetRotate(Rotate) in C (only 0°, 90°, 180°, 270°); in Python, rotate(Rotate) allows any angle
  • Incorrect use of GPIO libraries can cause refresh issues; rebooting the Raspberry Pi typically resolves this

Source and revision record