int getChangedArea(void) … note the letter ‘d’ hiding away there int PixLimit = tft.getChangedArea();. (I have a rig with 5 displays … at which point maybe it’s more obvious you need to say which one!)/*
Jeannie II
Polyphonic DIY Synthesizer/Sampler
(c) by Rolf Degen and Andre' Laska März 2026
Version 27.03.2026
Used 3.5 inch TFT ST7796S Display
*/
#define TFT_MISO 12
#define TFT_MOSI 11
#define TFT_SCK 13
#define TFT_DC 8
#define TFT_CS 10
#define TFT_RST 9
#define TFT_BL 28 // TFT Backlight
#include <Arduino.h>
#include <ST7796_t3.h> // Hardware-specific library
#include <SD.h>
#include <SPI.h>
#include <Wire.h>
// For 3.5" TFT with ST7796S
ST7796_t3 tft = ST7796_t3(TFT_CS, TFT_DC, TFT_RST);
// FrameBuffer is located in Teensy4.1 Ram2
#define TFT_height 320
#define TFT_width 480
DMAMEM uint16_t FrameBuffer[TFT_height * TFT_width];
// Setup -------------------------------------------------------
void setup(void)
{
Serial.begin(9600);
// init Background LED
pinMode(TFT_BL, OUTPUT); // TFT Backligth
digitalWrite(TFT_BL, HIGH); // TFT_Backlight on
tft.setFrameBuffer(FrameBuffer);
tft.init(320, 480);
tft.setRotation(1);
tft.invertDisplay(true);
tft.useIntermediateBuffer(tft.width() * 2 * sizeof(uint16_t)); // intermediate buffer
tft.useFrameBuffer(true);
tft.updateChangedAreasOnly(true);
}
void loop()
{
if (!tft.asyncUpdateActive())
{
tft.clearChangedArea(); // reset area boundaries - now invalid!
tft.fillRect(50, 80, 300, 210, random(65353));
tft.updateScreenAsync(false, true, true);
}
delay(1000);
}
Jack Swigert said:"Okay, Houston ... we've had a problem"
Jack Lousma said:This is Houston. Say again, please.
I've just got this up and running, and I've not had a problem. So far.Jim Lovell said:"Ah, Houston, we've had a problem"
He does - 56R. See https://protosupplies.com/wp-content/uploads/2025/03/Mini-Platform-Schematic-Page-1.pngI'm using a @KenHahn MINI board … Not sure if Ken has any resistors on the SPI lines?
... thought so ... left as an exercise for the readerHe does
setAsyncInterruptPriority(int level) method to lower the display's interrupt priority below that of the Audio library, i.e. to 224 or 240 (Audio is 208), This call must be before you do any async updates - straight after your init() call should do itDMAChannel utilities in cores to allow for low- and high-priority DMA - see this thread for discussion. Post #108 has a zip file with changes that worked for me/*
Test with Display ST7796S FrameBuffer with DMA and Audio
*/
#include <Arduino.h>
#include <Audio.h>
#include <ST7796_t3.h> // Hardware-specific library
#include <SPI.h>
#include <st7735_t3_font_OpenSans.h>
// TFT Display ST7796S
#define TFT_MISO 12
#define TFT_MOSI 11
#define TFT_SCK 13
#define TFT_DC 8
#define TFT_CS 10
#define TFT_RST 9
#define TFT_BL 28 // TFT Backlight
#define TFT_height 320
#define TFT_width 480
// For 3.5" TFT with ST7796S
ST7796_t3 tft = ST7796_t3(TFT_CS, TFT_DC, TFT_RST);
// init Audio
AudioSynthWaveformSine sine1; // xy=285,416
AudioOutputI2S i2s1; // xy=501,413
AudioConnection patchCord1(sine1, 0, i2s1, 0);
AudioConnection patchCord2(sine1, 0, i2s1, 1);
// TFT FrameBuffer is located in Teensy4.1 512MB Ram2
DMAMEM uint16_t FrameBuffer[TFT_height * TFT_width];
// Setup -------------------------------------------------------
void setup(void)
{
Serial.begin(9600);
AudioMemory(16);
// Waveform-Einstellungen
sine1.amplitude(0.5); // Lautstärke 0.0 - 1.0
sine1.frequency(440); // Frequenz in Hz (A4)
// init TFT Backlight
pinMode(TFT_BL, OUTPUT); // TFT Backligth
digitalWrite(TFT_BL, HIGH); // TFT_BL off
// init TFT ST7796S
tft.setFrameBuffer(FrameBuffer);
tft.init(320, 480);
tft.setRotation(1);
tft.invertDisplay(true);
tft.useIntermediateBuffer(tft.width() * 10 * sizeof(uint16_t)); // intermediate buffer
tft.useFrameBuffer(true);
tft.updateChangedAreasOnly(true);
tft.clearChangedArea();
tft.fillScreen(ST7735_BLACK);
tft.updateScreenAsync(false, true, true);
}
//--------------------------------------------------------------
// Main loop
//--------------------------------------------------------------
void loop()
{
tft.clearChangedArea();
tft.fillRect(20, 20, 50, 50, random(65353));
tft.updateScreenAsync(false, true, true);
delay(500);
}