Uncanny Eyes is getting expensive

Hello Mark,
thank you very much for trying to help me.
Since I'm from Germany and don't speak English very well. I have to translate everything first.

I have attached two pictures. The detail must be the cause since everything worked before.

Since I wasn't sure whether I had accidentally soldered the pins together with solder, I tried to separate them with a cutter. Hence the scratches on the board.
I also ordered some wire for desoldering so I might get a better view of this area.

The problem isn't the soldering but rather the micro pins.
This is more for Hobbits.

20240210_121451.jpg


20240210_121605.jpg
 
Thanks for the pictures. Agreed on the very tiny pads !! Unfortunately, the hot glue appears to be causing too much blurring to be able to clearly see where the fault might be. Any chance that you have a heat gun that you could use to melt away the hot glue for clearer viewing ?? It may turn out to be impossible to save your T4.0, but I'm certainly willing to help if I can & pursue this as long as you still have interest in its possibilities.

Mark J Culross
KD5RXT
 
Yes, I have a heat gun.
I try to remove the glue.
However, the teensy stopped working when I changed the wire from pin 26 to 35.
 
Murphy (known in the US for the "If anything can go wrong, it will" sentiment) joined the party !!

Before adding your wires back, can you see if the Teensy is recognized when plugged into your PC. If not, unplug it & try holding down the program button as you plug it in to see if it acts any differently that way.

Mark J Culross
KD5RXT
 
We also know Murphy's law in Germany.

How should I solder the cable back on the teensy? The pin is off.

The teensy is still not recognized. Neither if I connect it with or without the program button pressed.
 
Hi,
I have now got the teensy 4.1.
Could someone please take a look at the wiring to see, if that's correct?

1707991754591.png
 
Hello,
I've not read everything in details, but I see you power the displays with 5V. It is OK if the small chips on the display are 3.3V regulators . But if the display work on 5V, it's outputs are also 5V, and the Teensy inputs are not 5V tolerant.

Funktionieren die Displays mit onboard 3.3V regler ??? Wenn es 5V ist, so es ist problematisch. Die Teensy inputs sind nicht 5V tolerant.

Angelo
 
Hello Angelo,
that's a good question.
I took a look and only found the following information.
Otherwise there is no information.
I think the black rectangular part is the voltage regulator.


Screenshot_20240215_135539_AliExpress.jpg
 
Hello,
I've not read everything in details, but I see you power the displays with 5V. It is OK if the small chips on the display are 3.3V regulators . But if the display work on 5V, it's outputs are also 5V, and the Teensy inputs are not 5V tolerant.

Funktionieren die Displays mit onboard 3.3V regler ??? Wenn es 5V ist, so es ist problematisch. Die Teensy inputs sind nicht 5V tolerant.

Angelo
FWIW, the displays used for Uncanny Eyes do not send information back to the Teensy (i.e. having a MISO pin, which would be pins 12 and 1). Thus, while it is a valid concern in general, it isn't an issue in this particular case.

When I wire prototype boards up for displays, I use a common pin layout for connecting the displays. I build a custom cable for each display, going from whatever pin out the display uses to my pin out on the prototype board. I also tend to have a switch between 3.3v and 5v for the VIN connection to the display. That way I can change displays on a whim.

In general, I prefer sending 3.3 volts, but if the display uses more than 75mA, then 2 displays might overload the 3.3v output. This assumes a Teensy 4.x uses about 100mA, and the 3.3v regulator can produce 250mA (leaving roughly 150mA for everything but the Teensy). The VIN pin can deliver roughly 5v and 500mA.

The pin out I use is:
  • Ground
  • VIN (either 3.3v or 5v)
  • SCLK (pin 13 or 27 on the Teensy 4.x)
  • MOSI (pin 11 or 26 on the Teensy 4.x)
  • MISO (pin 12 or 1 on the Teensy 4.x)
  • CS pin #1 (typically pin 22 or 0 on the Teensy 4.x)
  • D/C pin (typically pin 9 or 24 on the Teensy 4.x)
  • Reset pin (typically pin 5 or 25 on Teensy 4.x)
  • CS pin #2 (typically pin 10 or 30 on Teensy 4.x)
  • Blink (typically wired to 3.3v, but it could be connected to a PWM pin)
  • In newer boards, I have 2 extra pins that could be used in the future, such as for neopixels
The idea of the pin out is for Teensy 3.x systems, I can use the old 128x128 display code that does both displays on the same SPI bus, and the 2 CS pins and D/C are on the special pins for the 3.x display optimizations (pins 22, 10, and 9).

For the Teensy 4.x code, I have 2 separate sets of pin outs, one for the two SPI buses, and I put one display on each bus. AFAIK, the Teensy 4.x drivers don't use the special pins, but if they did start to use the pins, I likely would use the following for the Teensy 4.1:
  • Pin 36: CS pin for the first display (or pin 10 if I didn't care about using the audio adapter)
  • Pin 37: D/C pin for the first display
  • Pin 0: CS pin for the second display
  • Pin 38: D/C pin for the second display
The idea is I can easily switch Teensys, using the Teensy 3.x CS and D/C pins for the first display, and using only pins for the second display that the Teensy 4.0 and 4.1 bring out (i.e. I don't use pins 33 - 41 on the Teensy 4.1 -- but of course the Teensy 4.0 has to have some wires to connect to pins on the solder pads underneath the Teensy). Because of this, any new Teensy board I buy that might use the eyes is only Teensy 4.1 so that I don't have to connect wires underneath the Teensy. But I do have a few Teensy 4.0s lying around. In particular, on one of the Teensy 4.0's, I lifted off the solder pads of pins 28 and 29, so I don't use those two pins.
 
Last edited:
@MichaelMeissner

Hi,
thank you for your support!

Do the MISO pins need to be connected?
I don't think so, because in the old projects with the teensy 3.2 and the TFT displays with 128x128 there was a MISO pin at the TFT, but they wasn't connected either.
There is only one pin left on the current TFTs (marked BL).

And what's with the blink?
Do I need that?
Where is this connected to the TFT’s?

When doing my wiring, I tried to connect the displays each on one side of the teensy 4.1 and also followed, how they were connected to the teensy 4.0.
Overall, my wiring is nearly the same as yours.

Can I assume, that my wiring is OK as shown?
I don't want to destroy another teensy.

If the wiring is now ok.
What should the program folder look like and which files do I have to download for it?

This is what the folder structure looks like for the project with my teensy 3.2:

Main folder „Uncanny_Eyes-master"

Folder structure teensy 3.2.jpg
 
@MichaelMeissner

Hi,
thank you for your support!

Do the MISO pins need to be connected?
I don't think so, because in the old projects with the teensy 3.2 and the TFT displays with 128x128 there was a MISO pin at the TFT, but they wasn't connected either.

If you notice, many of the 128x128 displays have a micro SD card reader, and a separate pin that is the CS pin for the SD card. Those displays need to MISO so you can read data from the SD card.


Some of the 240x240 displays have a SD card reader, and they need MISO plus the 2nd CS (i.e. the Adafruit 240x240 display). Other 240x240 displays don't have a SD card slot, and they generally don't have a pin for MISO (i.e. the round 240x240 displays, but likely other displays not from Adafruit).


Some of the 240x240 displays also don't have a CS pin for the display. On those displays, you HAVE to connect the displays to separate SPI buses. Basically the CS pin is used for the Teensy to say which SPI device it is talking to (all of the SPI devices on a SPI bus are on a party line, but if the CS is not set appropriately, then the display ignores the stuff on the SPI bus). If there is no CS pin, then in config.h you have to put -1 for the pin number.


I think (but I honestly don't know), that some displays use CS being high to be active, while others might use CS being low to be active. If there is only on device on the SPI bus, you could potentially tie that CS pin high (3.3v) or low (ground).

There is only one pin left on the current TFTs (marked BL).

And what's with the blink?
On the displays that have it, if the pin is connected to ground, it turns off the display. In theory, the BL pin has a pull-up resistor so if you don't connect it, it reads high. I generally just always wire the BL pin to 3.3v.

However, if you want, you could connect the BL pin to a pin that is capable of doing PWM (pulse width management). By blinking the pin, you could achieve a dimming of the display. However, there are some people out there that are sensitive to blinking, and it might be a good idea not to try an dim the eyes via PWM. I could imagine that if you want the eye to go to sleep and use less power, you might want to connect BL to a pin that is in the low state.

Do I need that?
Where is this connected to the TFT’s?

When doing my wiring, I tried to connect the displays each on one side of the teensy 4.1 and also followed, how they were connected to the teensy 4.0.
Overall, my wiring is nearly the same as yours.
For Teensy 4.0/4.1, it does not matter what digital pin you use for CS, RST, and DC. Pick whatever pins you aren't using for something else. For Teensy 3.1/3.2/3.5/3.6 (and maybe 3.0) there were special optimizations done if CS and DC were both among the special pins.

I personally go down the rabbit hole of trying to make pin assignments so I can mix a bunch of things together, so I sometimes go with pin assignments to avoid other uses (for example, I might not use pins 7, 8, 20, 21, and 23 which are used by the audio adapter, even if I don't have audio in this particular build).

I also tend to have a few favorite pins that I use over and over. Pin 3 is typically used as a momentary button, since it didn't have much fixed use in the past. I use 17 as the first neopixel pin because the Teensy LC had a voltage shifter for pin 17.

Can I assume, that my wiring is OK as shown?
I don't want to destroy another teensy.

If the wiring is now ok.
What should the program folder look like and which files do I have to download for it?

If you are using my sources, you should down load the whole tree, and within the src directory is (note, this is how Chris set it up, I just tweaked it):
  • src dirctory -- main files
  • src/util -- logging sub-files. The build-logging.cpp file includes these (Arduino can't handle build files in a sub-directory, so I have build-*.cpp files that include the stuff in sub-directories).
  • src/sensors -- code for the light sensor and the person sensor, included by build-LightSensor.cpp and build-PersonSensor.cpp.
  • src/displays -- abstraction for the 2 different 240x240 displays, included by build-GC9A01A.cpp and build-ST7789.cpp.
  • src/eyes -- place to put all of the various eyes (at present we only have 240x240 eyes)
  • src/eyes/240x240 -- the 240x240 eyes. The rest of the build-*.cpp as well as config.h includes these files
This is what the folder structure looks like for the project with my teensy 3.2:

Main folder „Uncanny_Eyes-master"

View attachment 33353

Yep, one of the thing that I hated about the 3.2 setup is every time I made a different configuration for the eyes (i.e. whether I had 1 eye or 2, which display was used, etc.) I had to clone the whole directory. Before Chris had come on the scene, I had re-orgranized the code so all of the stuff was in a library, and each .ino file in a separate directory just changed which defaults to use.

Unfortunately, you can't have the two different displays (GC9A01A and ST7789) in the same library, because there are bits common between the two (since GC9A01A was cloned from ST7789, and the person doing the cloning didn't try to abstract things, and get the ST7789 folk to use that abstraction). And while the linker will throw out things (like different eyes) that aren't used, unfortunately you run into some limits before it removes the unused code. I also didn't want to stray too far from Chris's code in case they/he/she came back to do more work.
 
@MichaelMeissner

Hello,
it continues step by step.

I copied all the files into a folder src and renamed it TeensyEyes after the first start didn't work.
After starting the ino file, I didn't make any changes in the Arduino IDE.
Then I tested/compiled the sketch once.

The file ST7789_Display.h tries to include another file (ST7789_t3.h).
However, this does not seem to be available.
Do I need to make any adjustments in the code?

Code:
#pragma once

#include <ST7789_t3.h>
#include <array>

#include "Display.h"

typedef struct {
  int8_t cs;           // Chip select pin, or -1.
  int8_t dc;            // DC pin.
  int8_t mosi;          // MOSI pin.
  int8_t sck;           // SCK pin.
  int8_t rst;           // reset pin, or -1 to disable reset.
  uint8_t rotation;     // The rotation value for the display (0-3).
  bool mirror;          // Mirror the display in the X direction.
  bool useFrameBuffer;  // Whether to use frame buffering.
  bool asyncUpdates;    // Whether to update the screen asynchronously (for better performance).
} ST7789_Config;

class ST7789_Display : public Display<ST7789_Display> {
private:
  ST7789_t3* display;
  bool asyncUpdates;
 
Last edited:
I think your problem is likely that you moved where the files are located and the code needs to know where to look. If you put files inside the src folder you'd need to change a line something like that.
 
I set up the folders exactly as they are on Github and then copied the corresponding files there.
I can't find a file called ST7789_t3.h
 
I have now copied the following files into the src-folder:
ST7735_t3.h
ST7789_t3.cpp
ST7789_t3.h

There is now another error:

"In file included from C:\Users\Peer\Documents\Halloween\UncannyEyes_4.1\TeensyEyes\build-ST7789.cpp:8:0:

Mehrere Bibliotheken wurden für "SD.h" gefunden / Several libraries were found for "SD.h".

C:\Users\Peer\Documents\Halloween\UncannyEyes_4.1\TeensyEyes\displays\ST7789_Display.h:3:23: fatal error: ST7789_t3.h: No such file or directory

Used/Benutzt: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

compilation terminated.

Not used/Nicht benutzt: C:\Program Files (x86)\Arduino\libraries\SD

Fehler beim Kompilieren für das Board Teensy 4.1.
 
The duplicate libraries are a routine warning. They are not fatal, the program picks one from among the libraries it found and uses that.

The fatal error is still just that it doesn't find ST_7789_t3.h in the places it expects.

On my mac it probably in a different place than on your machine. As Mike said it is part of the standard teensy package. On my mac it is at:

/Users/raine001/Library/Arduino15/packages/teensy/hardware/avr/1.59.0/libraries/ST7735_t3/src/ST7789_t3.h

but if you changed line 3 of ST7789_Display.h to: #include "src/ST7789_t3.h" I think the compiler would find the copy you put there.

One approach might be to reinstall arduino and teensyduino. I think that would fix your problem, too. Something got moved.
 
I've tried several things now.

First I copied the ST7789_t3.h file into the two folders.
Did not work.

Then in the file ST7789_Display.h I changed the code to
#include "src/ST7789_t3.h"
For me, however, the folder is called TeensyEyes and not src. The folder was previously called src, but at the beginning I got the error message that the folder must be called TeensEyes. So I changed it.

Unfortunately, everything didn't work.

I then reinstalled Arduino IDE and teensyduino.

Arduino IDE started by clicking on TeensyEyes.ino.
Try to compile the Sketch.

Now I get the error message:
Missing/(Fehlender) FQBN (Fully Qualified Board Name)
Compilation error: Missing FQBN (Fully Qualified Board Name)

I do not know how to continue. :cry:
The ST7789_t3.h include file comes from the ST7735_t3 library (https://github.com/PaulStoffregen/ST7735_t3). I would imagine that it comes from the standard Teensy installation. If not, you would need to install it in your Libraries directory.

You meant to copy the files into the libraries like I did, right?
Or how are they installed?
 
Now the compiling works, but the same error as before:

In file included from C:\Users\Peer\Documents\Halloween\UncannyEyes_4.1\TeensyEyes\ST7789_t3.cpp:19:
C:\Users\Peer\Documents\Halloween\UncannyEyes_4.1\TeensyEyes\ST7789_t3.h:6:10: fatal error: TeensyEyes/ST7789_t3.h: No such file or directory
6 | #include <TeensyEyes/ST7789_t3.h>\par
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: TeensyEyes/ST7789_t3.h: No such file or directory

The code in the file ST7789_t3.h looks like this now:

Code:
{\rtf1\ansi\ansicpg1252\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Courier New;}}
{\*\generator Riched20 10.0.19041}\viewkind4\uc1 
\pard\f0\fs22\lang1031 #pragma once\par
\par
//#include <SD/ST7789_t3.h>\par
#include <TeensyEyes/ST7789_t3.h>\par
#include <array>\par
\par
//#include "Display.h"\par
#include "displays/Display.h"\par
\par
typedef struct \{\par


The code in the file ST7789_t3.cpp looks like this now:

Code:
//#include "ST7789_t3.h"
#include "TeensyEyes/ST7789_t3.h"
#include <limits.h>
#include "pins_arduino.h"
#include "wiring_private.h"
#include <SPI.h>
 
Last edited:
Hi again,

here again is the current error code, even though the file ST7789_t3.h exists:

Code:
C:\Users\Peer\Documents\Halloween\UncannyEyes_4.1\TeensyEyes\ST7789_t3.cpp:21:10: fatal error: TeensyEyes/ST7789_t3.h: No such file or directory
   21 | #include "TeensyEyes/ST7789_t3.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: TeensyEyes/ST7789_t3.h: No such file or directory

I also took a look at the content of this file.

Is it normal that some parts of the text are displayed in red like this?

\pard\f0\fs22\lang1031 #pragma once\par
\par
//#include <SD/ST7789_t3.h>\par
#include <TeensyEyes/ST7789_t3.h>\par
#include <array>\par
\par
//#include "Display.h"\par
#include "displays/Display.h"\par
...


I also noticed that a path is displayed when I hover the cursor over the line with the include displays.
Nothing is displayed for the includes array and ST7789_t3.h.
 
I just can not manage it.
Does no one have any idea why the existing file could not be found or integrated?
 
Back
Top