ST7789_t3 (part of ST7735 library) support for displays without CS pin

@MichaelM - did you see post #103

It has a zip that I just see as missed reply post @KurtE answered for two 240x240 ST7789's for T4 …

But 1.8.10 w/1.48b1 locks up (PIT issues) with that and @mjs513 7789_rewrite, and 1.8.9 w/1.47 gives a redef PROGMEM error
 
Last edited:
@MichaelM - did you see post #103

It has a zip that I just see as missed reply post @KurtE answered for two 240x240 ST7789's for T4 …

But 1.8.10 w/1.48b1 locks up (PIT issues) with that and @mjs513 7789_rewrite, and 1.8.9 w/1.47 gives a redef PROGMEM error

@defragster - @MichaelM

Not sure if you saw the @manitou's post #71 where there are a couple of quick fixes for the PIT issue.

Just compiled @KurtE's async sketch with 1.8.10/1.48B1 without the redef PROGMEM error.

Just for ref haven't tested uncanny on 240x240 st7789's but they should work without a problem on the T4.
 
@MichaelM - did you see post #103

It has a zip that I just see as missed reply post @KurtE answered for two 240x240 ST7789's for T4 …

But 1.8.10 w/1.48b1 locks up (PIT issues) with that and @mjs513 7789_rewrite, and 1.8.9 w/1.47 gives a redef PROGMEM error

Thanks. I replied to the post, but I forgot to download the file, and when I looked on my system, I had only the earlier 128x128 versions.
@defragster - @MichaelM

Not sure if you saw the @manitou's post #71 where there are a couple of quick fixes for the PIT issue.

Just compiled @KurtE's async sketch with 1.8.10/1.48B1 without the redef PROGMEM error.

Just for ref haven't tested uncanny on 240x240 st7789's but they should work without a problem on the T4.

Thanks.
 
@defragster - @MichaelM

Not sure if you saw the @manitou's post #71 where there are a couple of quick fixes for the PIT issue.

Just compiled @KurtE's async sketch with 1.8.10/1.48B1 without the redef PROGMEM error.

Just for ref haven't tested uncanny on 240x240 st7789's but they should work without a problem on the T4.

Yes, saw the fix for PIT issue for reference - but wasn't sure I wasn't going down a rabbit hole with the other error and it was late …

Note sure what '@KurtE's async sketch' is for source?
 
Yes, saw the fix for PIT issue for reference - but wasn't sure I wasn't going down a rabbit hole with the other error and it was late …

Note sure what '@KurtE's async sketch' is for source?

Shortened the name From: uncannyEyes_async_st7735-190827a.zip to @KurtE's async sketch
 
Shortened the name From: uncannyEyes_async_st7735-190827a.zip to @KurtE's async sketch

Cool, I just wanted to make sure there wasn't a newer version I slept through :)

So I did the PIT change posted here : pjrc.com/threads/57609-Teensyduino-1-48-Beta-1
Code is running on 1.8.10 with TD 1.48b1 - though no displaying - I the @mjs513 'ST7735_t3-ST7735_T4_rewrite.zip' is the correct github source I just need to get my init settings and pins made right.

Using ST7735_t3_multiple.ino from github zip ... making 7789 no CS adjustments and it compiles - need to find the other settings to get display …

Found old sketch { 5 serial port cross transfer } that worked - only one display active … that T4 w/twin 7789's has been sitting a month - wires look good - but this version using TeensyThreads …

Picking it up and checking wires something reset - PC complained about USB device bad ... - and the Tthreads and non thread version now showing on both displays - time to check init and pin settings ...
 
@defragster - @MichaelM

Not sure if you saw the @manitou's post #71 where there are a couple of quick fixes for the PIT issue.

Just compiled @KurtE's async sketch with 1.8.10/1.48B1 without the redef PROGMEM error.

Just for ref haven't tested uncanny on 240x240 st7789's but they should work without a problem on the T4.

Well it compiles, but it doesn't run. I was testing with a single eye, as I need to re-solder pin 27 once again (sigh). I used one of the cheap no CS displays. I've run the graphics test with the no CS display, and it runs fine, so I have the wires connected correctly. Note, I do have the PIT fix installed in startup.c.

When I run it, the adafruit splash screen comes up, but nothing after that. Here are the messages on the USB serial monitor:


Code:
IOMUXC_GPR_GPR17:aaaaaaaf IOMUXC_GPR_GPR16:7 IOMUXC_GPR_GPR14:aa0000
Initial Stack pointer: 20070000
ITCM allocated: 65536  DTCM allocated: 458752
ITCM init range: 0 - 9a40 Count: 39488
DTCM init range: 20000000 - 20001b20 Count: 6944
DTCM cleared range: 20001b20 - 200042c0 Count: 10144
Now fill rest of DTCM with known pattern

/home/meissner/Arduino/teensy-eyes/uncannyEyes_async_st7735/uncannyEyes_async_st7735.ino Sep 23 2019 09:49:06
Init
Create display #0
ST7789_t3::init mode: 8
Init ST77xx display #0
Rotate
done
Display logo
$0: Using Frame buffer
 420 :    141  55775    0: 108    0: 456
Long wait
0 : updateScreenAsync FAILED
Long wait
 424 :    140  56173    0: 108    0: 465
0 : updateScreenAsync FAILED
Long wait
 394 :    147  53498    0: 103    0: 479
0 : updateScreenAsync FAILED
Long wait

Here is my config.h:

Code:
//#define SERIAL_tt Serial // Send debug_tt output here. Must have SERIAL_tt.begin( ## )
//#include "debug_tt.h"
// Pin selections here are based on the original Adafruit Learning System
// guide for the Teensy 3.x project.  Some of these pin numbers don't even
// exist on the smaller SAMD M0 & M4 boards, so you may need to make other
// selections:

// GRAPHICS SETTINGS (appearance of eye) -----------------------------------

// If using a SINGLE EYE, you might want this next line enabled, which
// uses a simpler "football-shaped" eye that's left/right symmetrical.
// Default shape includes the caruncle, creating distinct left/right eyes.
// Otherwise your choice, standard is asymmetrical
  #define SYMMETRICAL_EYELID

#define SINGLE_EYE			// temporarily disable 2nd eye

// Enable ONE of these #includes -- HUGE graphics tables for various eyes:
#ifdef USE_ST7789
#include "graphics/default_large.h"   // 240x240
#else
#include "graphics/defaultEye.h"      // Standard human-ish hazel eye -OR-
//#include "graphics/dragonEye.h"     // Slit pupil fiery dragon/demon eye -OR-
//#include "graphics/noScleraEye.h"   // Large iris, no sclera -OR-
//#include "graphics/goatEye.h"       // Horizontal pupil goat/Krampus eye -OR-
//#include "graphics/newtEye.h"       // Eye of newt -OR-
//#include "graphics/terminatorEye.h" // Git to da choppah!
//#include "graphics/catEye.h"        // Cartoonish cat (flat "2D" colors)
//#include "graphics/owlEye.h"        // Minerva the owl (DISABLE TRACKING)
//#include "graphics/naugaEye.h"      // Nauga googly eye (DISABLE TRACKING)
//#include "graphics/doeEye.h"        // Cartoon deer eye (DISABLE TRACKING)
//#include "graphics/Nebula.h"  //Dont work
//#include "graphics/MyEyeHuman1.h"
//#include "graphics/Human-HAL9000.h"
//#include "graphics/NebulaBlueGreen.h"
//#include "graphics/SpiralGalaxy.h"
//#include "graphics/ChameleonX_Eye.h"  //no work
//#include "graphics/MyEye.h"
#endif
// Optional: enable this line for startup logo (screen test/orient):
#if !defined(ADAFRUIT_HALLOWING)    // Hallowing can't always fit logo+eye
  #include "graphics/logo.h"        // Otherwise your choice, if it fits
#endif

// EYE LIST ----------------------------------------------------------------


// DISPLAY HARDWARE SETTINGS (screen type & connections) -------------------

  //#define TFT_SPI        SPI
  //#define TFT_PERIPH     PERIPH_SPI

  // Enable ONE of these #includes to specify the display type being used
  #include <ST7735_t3.h> // TFT display library (enable one only)

  #define SPI_FREQ 48000000    // TFT: use max SPI (clips to 12 MHz on M0)

// This table contains ONE LINE PER EYE.  The table MUST be present with
// this name and contain ONE OR MORE lines.  Each line contains THREE items:
// a pin number for the corresponding TFT/OLED display's SELECT line, a pin
// pin number for that eye's "wink" button (or -1 if not used), and a screen
// rotation value (0-3) for that eye.

eyeInfo_t eyeInfo[] = {
#ifdef ST77XX_ON_SPI_SPI2
  //CS  DC MOSI SCK RST WINK ROT INIT
  // Going to try to NO CS displays.
   {-1,  9, 11, 13,  8, -1,  0, INITR_144GREENTAB }, // LEFT EYE display-select and wink pins, no rotation
#ifndef SINGLE_EYE
   {-1, 36, 35, 37, 39, -1,  0, INITR_144GREENTAB }, // RIGHT EYE display-select and wink pins, no rotation
#endif
#else
#ifndef SINGLE_EYE
   {0,  2,  26, 27,  3, -1,  0, INITR_144GREENTAB }, // RIGHT EYE display-select and wink pins, no rotation
#endif
   {10, 9,  11, 13,  8, -1,  0, INITR_144GREENTAB }, // LEFT EYE display-select and wink pins, no rotation
#endif
};
// INPUT SETTINGS (for controlling eye motion) -----------------------------

// JOYSTICK_X_PIN and JOYSTICK_Y_PIN specify analog input pins for manually
// controlling the eye with an analog joystick.  If set to -1 or if not
// defined, the eye will move on its own.
// IRIS_PIN speficies an analog input pin for a photocell to make pupils
// react to light (or potentiometer for manual control).  If set to -1 or
// if not defined, the pupils will change on their own.
// BLINK_PIN specifies an input pin for a button (to ground) that will
// make any/all eyes blink.  If set to -1 or if not defined, the eyes will
// only blink if AUTOBLINK is defined, or if the eyeInfo[] table above
// includes wink button settings for each eye.

//#define JOYSTICK_X_PIN A0 // Analog pin for eye horiz pos (else auto)
//#define JOYSTICK_Y_PIN A1 // Analog pin for eye vert position (")
//#define JOYSTICK_X_FLIP   // If defined, reverse stick X axis
//#define JOYSTICK_Y_FLIP   // If defined, reverse stick Y axis


#define TRACKING            // If defined, eyelid tracks pupil
#define AUTOBLINK           // If defined, eyes also blink autonomously
  //#define BLINK_PIN         1 // Pin for manual blink button (BOTH eyes)
  //#define LIGHT_PIN      A2 // Photocell or potentiometer (else auto iris)
  //#define LIGHT_PIN_FLIP    // If defined, reverse reading from dial/photocell
  //#define LIGHT_MIN       0 // Lower reading from sensor
  //#define LIGHT_MAX    1023 // Upper reading from sensor

#define IRIS_SMOOTH         // If enabled, filter input from IRIS_PIN
#if !defined(IRIS_MIN)      // Each eye might have its own MIN/MAX
  #define IRIS_MIN      120 // Iris size (0-1023) in brightest light
#endif
#if !defined(IRIS_MAX)
  #define IRIS_MAX      720 // Iris size (0-1023) in darkest light
#endif

I'm using the ST7735_t3 that came with the 1.48-beta1 release & ardinuo 1.8.10, but I've also tried it with 1.47 and arduino 1.8.9 with the same result. Do I need a replace ST7735_t3?
 
@MichaelMeissner

Try this for the eye.info setup in config.h as to opposed whats there. I am getting it to display the eye but for some reason its smaller than the display - let me know how it works out:

Code:
{-1,  9, 11, 13,  8, -1,  0 }

EDIT: Also don't use asynch updates. It should work with or without the initRgreentab specified
 
Last edited:
@KurtE

With your latest DMA changes getting some very strange results with the 7789 with no CS pin - its only displaying to a smaller area on the screen like its set for 160x160? Then if I do a rotation test it rotates that block but leaves the previous blocks.

EDIT: I am using tft.init(240,240, SPI_MODE2)
 
@KurtE

With your latest DMA changes getting some very strange results with the 7789 with no CS pin - its only displaying to a smaller area on the screen like its set for 160x160? Then if I do a rotation test it rotates that block but leaves the previous blocks.

EDIT: I am using tft.init(240,240, SPI_MODE2)

UPDATE: Downloaded you latest library and now everything is working - must have something screwy.
 
@MichaelMeissner

Did some testing at least with 1 display on SPI and it seems to be working now with @KurtE's sketch in post #1-3 BUT you will need to download his latest library updates: https://github.com/KurtE/ST7735_t3/tree/T4_DMA_LOW.

Testing was done with a 240x240 7789 without a CS pin. Think I need to delete the multiple copies of IDEs I have installed :)
 
@MichaelMeissner @mjs513 ...

Sorry I was out of town this weekend and have not kept up with all that is going on... Just got back, now to play with dogs, ...
 
I am close to seeing if it works. I got the ST7735_t3_multiple.ino coded to work on my SPI0 / SPI1 system with NO_CS 7789's:
Code:
ST7789_t3 tft = ST7789_t3(-1, 3, 26, 27, 4);
ST7789_t3 tft1 = ST7789_t3(-1,  10, 12);
// … 
void setup()
// ...
  tft.init(240,240, SPI_MODE2) ;  // use for ST7789 without CS)
  tft1.init(240,240, SPI_MODE2) ;  // use for ST7789 without CS)

Had it working on another sketch already - tracked the pin #'s - and wires to setup the eyeInfo[] …

Do I put SPI_MODE2 in for INITR_144GREENTAB?
 
I am close to seeing if it works. I got the ST7735_t3_multiple.ino coded to work on my SPI0 / SPI1 system with NO_CS 7789's:
Code:
ST7789_t3 tft = ST7789_t3(-1, 3, 26, 27, 4);
ST7789_t3 tft1 = ST7789_t3(-1,  10, 12);
// … 
void setup()
// ...
  tft.init(240,240, SPI_MODE2) ;  // use for ST7789 without CS)
  tft1.init(240,240, SPI_MODE2) ;  // use for ST7789 without CS)

Had it working on another sketch already - tracked the pin #'s - and wires to setup the eyeInfo[] …

Do I put SPI_MODE2 in for INITR_144GREENTAB?

No - don't need to from using only the one 7789(no_cs) that I tested assuming you are talking about uncanny eyes. If not you just use the initR(240, 240, SPI_MODE2).
 
Left eye working - had to go rotate 2 as it was downside up
Right eye blank until I did Rotate 2
>> Seems there is a rectangle around the iris when the pupil is closed - when pupil shows the iris square goes away. Both eyes.

Both working in SYNC - Adafruit logo splits across matching edges:
Code:
eyeInfo_t eyeInfo[] = {
  //CS  DC  MOSI  SCK RST WINK  ROT INIT
   {-1, 10, 11,   13, 12, -1, 2, SPI_MODE2 }, // LEFT EYE display-select and wink pins, no rotation
   {-1, 3,  26,   27, 4,  -1, 2, SPI_MODE2 }, // RIGHT EYE display-select and wink pins, no rotation

Crosspost update :: indeed it works the same with :: INITR_144GREENTAB
 
Left eye working - had to go rotate 2 as it was downside up
Right eye blank until I did Rotate 2
>> Seems there is a rectangle around the iris when the pupil is closed - when pupil shows the iris square goes away. Both eyes.

Both working in SYNC - Adafruit logo splits across matching edges:
Code:
eyeInfo_t eyeInfo[] = {
  //CS  DC  MOSI  SCK RST WINK  ROT INIT
   {-1, 10, 11,   13, 12, -1, 2, SPI_MODE2 }, // LEFT EYE display-select and wink pins, no rotation
   {-1, 3,  26,   27, 4,  -1, 2, SPI_MODE2 }, // RIGHT EYE display-select and wink pins, no rotation

Crosspost update :: indeed it works the same with :: INITR_144GREENTAB
Glad you confirmed it working - my second display I think is dead have to do some troubleshooting on it in the morning.
 
Glad you confirmed it working - my second display I think is dead have to do some troubleshooting on it in the morning.

Yes, good to see it working - not going to buy one - it is creepy

Just rotated right eye and it still works - it seems after first moving to this the one eye was offline until ??? I think I may have just seen the last of what was an intermittent display. I was moving it around and now backlight only :(

So this worked a bit as well... PJRC DIY break with SPI and SPI1 using 26/27 wired from POGO's as above::
Code:
   {-1, 10, 11,   13, 12, -1, 0, INITR_144GREENTAB }, // LEFT EYE display-select and wink pins, no rotation
   {-1, 3,  26,   27, 4,  -1, 0, INITR_144GREENTAB }, // RIGHT EYE display-select and wink pins, no rotation

Odd no pupil open doesn't have the iris box clipped. Not sure where that is in code after a quick glance.
 
Left eye working - had to go rotate 2 as it was downside up
Right eye blank until I did Rotate 2
>> Seems there is a rectangle around the iris when the pupil is closed - when pupil shows the iris square goes away. Both eyes.

I now have both no-CS (generic display) and CS10 (Adafruit display) working. But the box around the sclera if the pupil is small or zero is annoying.

Now to re-solder pin 27 tomorrow.
 
Cool - yes and glad I got to see that before a display went away :( … they were cheap

Yeah that box is odd - only when no or maybe minimal pupil open - hope that helps find it. Of course looks odd fully closed.
 
Well looks like my second 7789(noCS) is dead but was playing around with Iris settings to see where the box would disappear (yes it was annoying me as well) - these seem to work
Code:
#define IRIS_SMOOTH         // If enabled, filter input from IRIS_PIN
#if !defined(IRIS_MIN)      // Each eye might have its own MIN/MAX
  #define IRIS_MIN      500 // Iris size (0-1023) in brightest light
#endif
#if !defined(IRIS_MAX)
  #define IRIS_MAX      700// Iris size (0-1023) in darkest light
#endif
 
Well looks like my second 7789(noCS) is dead but was playing around with Iris settings to see where the box would disappear (yes it was annoying me as well) - these seem to work
Code:
#define IRIS_SMOOTH         // If enabled, filter input from IRIS_PIN
#if !defined(IRIS_MIN)      // Each eye might have its own MIN/MAX
  #define IRIS_MIN      500 // Iris size (0-1023) in brightest light
#endif
#if !defined(IRIS_MAX)
  #define IRIS_MAX      700// Iris size (0-1023) in darkest light
#endif

Hmmm, that doesn't seem to help me (currently using the Adafruit display). I did define LIGHT_PIN (and LIGHT_MIN/LIGHT_MAX), and put a pot that I cranked up as high as possible. Once the iris was scaled up to the max. it wouldn't change size, or create the frame.
 
Hmmm, that doesn't seem to help me (currently using the Adafruit display). I did define LIGHT_PIN (and LIGHT_MIN/LIGHT_MAX), and put a pot that I cranked up as high as possible. Once the iris was scaled up to the max. it wouldn't change size, or create the frame.

Interesting. I only tested with a photo resistor on the 7735 displays and that seemed to work fine (but of course lower resolution) which used the original eye files. Wonder if the issue might be the with the scaled up image files that @KurtE had to do to work with the 240x240 7789's. Wonder if you would see the same behavior with the original eye files.

EDIT: don't bother trying with the smaller eyes - the scaling is all messed up on the display. Unless its just me
 
Back
Top