LoginSignup
0
0

70歳の挑戦... 8bitパラレルTFT(ILI9488,480x320)をラズパイ Pico(W)でも使ってみた

Posted at

 購入後、ピンも付けず眠らせていたラズパイ「Pico W」をもったいないので使うことに。数年前の素の「Pico」は使ってましたが、久しぶりなので思い出すのにチョッと苦労。無事WiFiに繋げられホッとしました(これでネットに接続できるなんてひと昔前にはね...)。WEBからのLED点灯・消灯も出来ました。まあ、これは今回の主題ではないのでこれぐらいにして。
 TFTディスプレイモジュールを繋ぎ動作させた結果を報告します。

1.3.95" 8bitパラレル接続のTFTディスプレイモジュール ILI9488 480x320
2.Raspberry Pi Pico W
3.TFT_eSPIライブラリ使用
4.ArduinoIDE -> File -> Examples -> TFT_eSPI -> 480x320 -> UTFT_Demo_480x320.ino を実行

Pico_ParallelTFT.jpg

1ループ後のスコアが「560msecs」と結構速いです。欲張って「LovyanGFX」でもと思いましたが、よく見たらPicoはサポート対象外でした、残念。それとこのボードにタッチ機能はないようで試してません(アマゾンの商品紹介には書いてありましたが...)。以下に、何をどのように設定したのか記します。
 まず、Pico、ILI9488、Parallelなので「Setup100_RP2040_ILI9488_parallel.h」でピンの定義などをします。

Setup100_RP2040_ILI9488_parallel.h(抜粋)

#define USER_SETUP_ID 100
// Interface
#define TFT_PARALLEL_8_BIT

// Display driver type
#define ILI9488_DRIVER

// These pins can be moved and are controlled directly by the library software
#define TFT_DC   28    // Data Command control pin
#define TFT_RST   2    // Reset pin

//#define TFT_RD   -1  // Do not define, read pin permanently connected to 3V3

// Note: All the following pins are PIO hardware configured and driven
  #define TFT_WR   22

  // PIO requires these to be sequentially increasing - do not change
  #define TFT_D0    6
  #define TFT_D1    7
  #define TFT_D2    8
  #define TFT_D3    9
  #define TFT_D4   10
  #define TFT_D5   11
  #define TFT_D6   12
  #define TFT_D7   13

次に、これをインクルードするために、「User_Setup_Select.h」の次の行だけ有効に。他はそのまま。

User_Setup_Select.h(抜粋)

#include <User_Setups/Setup100_RP2040_ILI9488_parallel.h> // Setup file for Pico/RP2040 with 8-bit parallel ILI9488

そして、最後に

User_Setup.h(抜粋)

// User defined information reported by "Read_User_Setup" test & diagnostics example
#define USER_SETUP_INFO "User_Setup"

// Tell the library to use parallel mode (otherwise SPI is assumed)
#define TFT_PARALLEL_8_BIT

#define ILI9488_DRIVER     // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)

// Tell the library to use 8-bit parallel mode (otherwise SPI is assumed)
#define TFT_PARALLEL_8_BIT

// The ESP32 and TFT the pins used for testing are:
#define TFT_CS   -1//27//33  // Chip select control pin (library pulls permanently low
#define TFT_DC   28//12//15  // RS Data Command control pin - must use a pin in the range 0-31
#define TFT_RST  2//33//32  // Reset pin, toggles on startup

#define TFT_WR   22//14// 4  // Write strobe control pin - must use a pin in the range 0-31
#define TFT_RD   -1//32// 0  // Read strobe control pin

#define TFT_D0   6//23//12  // Must use pins in the range 0-31 for the data bus
#define TFT_D1   7//19//13  // so a single register write sets/clears all bits.
#define TFT_D2   8//18//26  // Pins can be randomly assigned, this does not affect
#define TFT_D3   9//26//25  // TFT screen update performance.
#define TFT_D4   10// 5//17
#define TFT_D5   11// 4//16
#define TFT_D6   12// 0//27
#define TFT_D7   13//15//14

(見にくくてごめんなさい。ESP32用のPIN番号も残してあります。)
TFT_PARALLEL_8_Bitの定義が2か所にありますし、ピンの定義が「Setup100_RP2040_ILI9488_parallel.h」とダブってます、さらにコンパイル時に「TOUCH_CS pin not defined」のWarningも出ますが、まあいいかな、動きますし。今回は以上です。雑ですみません。最後まで見ていただきありがとうございます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0