I have a custom 16x32 matrix display that works well with Atmega328 MCU on certain programs, but is too slow for more intensive stuff, hence my wish to move to a Teensy or an ESP8266 MCU.
I can’t get SmartMatrix library to work with either Teensy or ESP, but have ESP8266 working with PxMatrix library on a standard “Chinese/Adafruit” display, which I use as a test bench. (My custom display uses 3W pixels and is 5 feet wide x 2-1/2 feet tall).
I don’t have “shields” and I don’t have neopixels or any of that “common stuff”. My display works well (except for speed issue) with the Adafruit RGBMatrixPanel library, eg I can scroll writing across the entire display.
Really, all I want to do is replace the 328 with a Teensy3.2 and even allowed for it on my custom PCB I’m not a software guy and understand little about libraries and APIs. I need to use all the HUB75 connections, R1,G1,B1,R2, G2, B2 because of my hardware.
I tried compiling your MatrixGFX demo program for the ESP8266, but get tons of errors, same with the Teensy. I’m confused by the many options of MatrixGFX and have difficulty selecting the Teensy configuration and the proper library, eg FeatureDemo suggests using Adafruit GFX layers. Do I need those? I don’t have “shields” yet the hardware config files only talk about shields. If effect, I will be making my own shield if I can’t get the Teensy to plug in to my current hardware setup.
I had compile errors, found out the SPI library from Arduino did not have all the keywords that SPI from PRJC had, notably setMOSI keyword. Fixed that, hardwired my 16x32 Adafruit display to Teensy 3.2. Nothing. not even a blink.
For what it’s worth, I get a clean compile for FeatureDemo on Teensy3.2 simply by uncommenting the Teeny3_ShieldV1toV3 include. Similarly, for MatrixGFXDemo I changed only line 21 to #include <MatrixHardware_Teensy3_ShieldV4.h>
The schematics for the SmartMatrix shields are in the repo. You’ll notice that they use bus transceivers. The more recent V4 & V5 shields also use a flip-flop to latch the address lines. If you can make your circuit more similar to the shields, you may have better results.
Well I didn’t think there was anything wrong with the sketches, just my implementation of them. I DID get it working by using a different MatrixHardware, making my own break out board to prevent errors in wiring, removing references to Adafruit RGBMatrixPanel (may not have been a problem, but I was pulling out all stops. I found two schematics, one was totally incorrect, the one that worked was SmartMatrix SD Shield for Teensy 3. There were minor (but important) issues with labeling, eg ADX0 is A on the panel, R0, R1 is R1, R2 on the panel. Also the requirement for two latches from the Teensy on D3 and D8. And finally D2 on the Teensy is not pin 2, thought some authors call it that, it is physically pin 4. (So when I was reading “pin #” given by some, that’s what I was using). Oh and an issue I found early was problem with SPI library. The code was using the simple Arduino library and not the Teensy enhanced SPI library that had the keyword “setMOSI”. It was a struggle.
My Teensy 3.2 is connected to the “commercial” (Chinese) panel, but I can’t get it to run on my custom display. I know the wiring is correct because I can change color of a few pixels at a time. I use the same Teensy with both displays so I can compare one display to the other. On the commercial panel I create rectangles in different colors but my custom display shows almost all pixels lit in RAINBOW colors, not recognizable as the clean rectangles of the “control”. My custom display uses HUB75 wiring protocol and works perfectly scrolling messages with an Atmega 328 (and Adafruit’s RGBMatrixPanel library). The Teensy is wired per “SmartMatrix SD Shield for Teensy 3”, and I’m using 74245 level shifters/drivers.
I realize the Atmega is a 5 volt device, connected to DM13 and 74HC138 devices, all of which require 3.1 minimum input to be recognized as logic high. With a Teensy output at 3.3 volts…well that’s way too close. I thought the level shifters would fix that. I played around with all the timing parameters in the SmartMatrix demo files, and in the .h library with no effect (except making it worse). Any ideas where I should look next? I’m going to do a complete audit of Atmega 328 voltage levels and waveforms and compare to Teensy…maybe that will give me insight.