genuinequality

Download free music MP3s on genuine quality, the world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, The world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, stats, charts, biographies and concerts. stats, charts, biographies and concerts.

Saturday, July 19, 2025

Arduino with Multiple Displays

A while back I tried to use several SSD1306 displays with an Arduino (see OLED MIDI Display – Part 2) and got into trouble with memory. I have another need for multiple displays coming up, so thought I'd revisit the idea to see what could be done. …
Read on blog or Reader
Site logo image Simple DIY Electronic Music Projects Read on blog or Reader

Arduino with Multiple Displays

By Kevin on July 19, 2025

A while back I tried to use several SSD1306 displays with an Arduino (see OLED MIDI Display – Part 2) and got into trouble with memory. I have another need for multiple displays coming up, so thought I'd revisit the idea to see what could be done.

This shows use to use several cheap SPI-based displays together with an Arduino.

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

These are the key Arduino tutorials for the main concepts used in this project:

  • Adafruit Mini TFT 0.96" 160x80
  • Adafruit ST7735 GFX Library
  • https://emalliab.wordpress.com/2025/07/19/small-microcontroller-displays/

If you are new to Arduino, see the Getting Started pages.

Parts list

  • Arduino Uno.
  • 2x 0.96" ST7735 60x180 SPI TFT displays.
  • Breadboard and jumper wires.

I'm using displays that look like this - note the order of the pins.

The Circuit

The display pins are connected to the Uno as follows:

BLK N/C Backlight control - not required
CS D10/D7 Chip select - one for each display.
DC D8 Data/Command
RES D9 Reset
SDA D11 Data (MOSI)
SCL D13 Clock (SCLK)
VCC 5V Power
GND GND Ground

Notes:

  • I'm using the Arduino Uno's hardware SPI peripheral so the use of D11/D13 is fixed and can't be changed.
  • All signals apart from CS are shared between both boards.
  • However - need to ensure that the boards are only reset once!

The Code

There are several software libraries that could be used for these kinds of displays. I'm using the Adafruit libraries:

  • Adafruit_GFX
  • Adafruit_ST7735_Library

These aren't always ideal for generic no-name displays as they are geared up to support Adafruit products directly.

A case in point: there is no generic initialisation for a ST7735 display, but rather a number of bespoke initialisations that relate to Adafruit's range of displays only. I was looking for some means of setting the display size (160x80) but that isn't possible.

But as it happens, there are two initalisation options that map onto the above boards:

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <SPI.h>

#define TFT_CS1 10
#define TFT_CS2 7
#define TFT_RST 9
#define TFT_DC 8

//#define TFT_TYPE INITR_MINI160x80
#define TFT_TYPE INITR_MINI160x80_PLUGIN // Inverted display

Adafruit_ST7735 tft1 = Adafruit_ST7735(TFT_CS1, TFT_DC, TFT_RST);
Adafruit_ST7735 tft2 = Adafruit_ST7735(TFT_CS2, TFT_DC, -1);

void setup() {
tft1.initR(TFT_TYPE);
tft2.initR(TFT_TYPE);
}

Notes for this initialisation code:

  • The use of pins D11 and D13 for SPI is assumed, and RST and DC are common.
  • I'm using the "INITR_MINI160x80_PLUGIN" initialisation option which is the same as "INITR_MINI160x80" but with the colours inverted. Without this, the built-in colour options aren't correct for my boards.
  • Notice how in the second initialisation I'm using "-1" as the RESET pin so that the first display isn't reset again after being initialised.
  • Both instances have their own CS pin defined.
  • The resolution and display size is fixed at 160x80.

In my case I also used setRotation(3) to rotate the displays by 180 degrees.

Here is my complete test code that prints the current millis() count to each display in a different colour.

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <SPI.h>

#define TFT_CS1 10
#define TFT_CS2 7
#define TFT_RST 9
#define TFT_DC 8

//#define TFT_TYPE INITR_MINI160x80
#define TFT_TYPE INITR_MINI160x80_PLUGIN // Inverted display

Adafruit_ST7735 tft1 = Adafruit_ST7735(TFT_CS1, TFT_DC, TFT_RST);
Adafruit_ST7735 tft2 = Adafruit_ST7735(TFT_CS2, TFT_DC, -1);

void setup() {
tft1.initR(TFT_TYPE);
tft2.initR(TFT_TYPE);
tft1.setRotation(3);
tft1.fillScreen(ST77XX_BLACK);
tft2.setRotation(3);
tft2.fillScreen(ST77XX_BLACK);
}

void loop() {
unsigned long time = millis();
tft1.fillRect(10, 20, tft1.width(), 20, ST77XX_BLACK);
tft1.setTextColor(ST77XX_GREEN);
tft1.setCursor(10, 20);
tft1.print(time, DEC);
delay(100);

time = millis();
tft2.fillRect(10, 20, tft2.width(), 20, ST77XX_BLACK);
tft2.setTextColor(ST77XX_MAGENTA);
tft2.setCursor(10, 20);
tft2.print(time, DEC);
delay(400);
}

Closing Thoughts

This is a really good start. What I'd like to do is see how far I can push it, see how many displays it is possible to hook up, and what the overheads of updating them might be.

Then depending on where that leaves me, I can have a think about if I need an alternative microcontroller, like a RP2040 or ESP32 - something with several cores might be particularly useful for this - and see how things go.

Then I can start to think about the musical uses I have in mind.

Kevin

Comment
Like
You can also reply to this email to leave a comment.

Simple DIY Electronic Music Projects © 2025.
Unsubscribe or manage your email subscriptions.

WordPress.com and Jetpack Logos

Get the Jetpack app

Subscribe, bookmark, and get real‑time notifications - all from one app!

Download Jetpack on Google Play Download Jetpack from the App Store
WordPress.com Logo and Wordmark title=

Automattic, Inc.
60 29th St. #343, San Francisco, CA 94110

Posted by BigPalaceNews at 9:55 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Search This Blog

About Me

BigPalaceNews
View my complete profile

Blog Archive

  • June (50)
  • May (82)
  • April (84)
  • March (87)
  • February (90)
  • January (74)
  • December (72)
  • November (95)
  • October (105)
  • September (112)
  • August (116)
  • July (96)
  • June (100)
  • May (105)
  • April (95)
  • March (131)
  • February (111)
  • January (104)
  • December (98)
  • November (87)
  • October (126)
  • September (104)
  • August (97)
  • July (112)
  • June (113)
  • May (132)
  • April (162)
  • March (150)
  • February (342)
  • January (232)
  • December (260)
  • November (149)
  • October (179)
  • September (371)
  • August (379)
  • July (360)
  • June (385)
  • May (391)
  • April (395)
  • March (419)
  • February (356)
  • January (437)
  • December (438)
  • November (400)
  • October (472)
  • September (460)
  • August (461)
  • July (469)
  • June (451)
  • May (464)
  • April (506)
  • March (483)
  • February (420)
  • January (258)
  • December (197)
  • November (145)
  • October (117)
  • September (150)
  • August (132)
  • July (133)
  • June (117)
  • May (190)
  • January (48)
Powered by Blogger.