Test to use FlexBus instead of normal port for Output

Hi,
I made a test project to check whether Kinetis’s FlexBus could be used for output with SmartMatrix on Teensy 3.6. (based on the teensylc branch)

This is a simple test project (for PlatformIO. with small changes it can be used with Arduino IDE as well) based on the SmartMatrix library.
My aim was to check whether the FlexBus can be used to output data to LED panels. (In some way I think it is similar to the I2S bus on ESP32, so maybe parts of that work could be used wit FlexBus on Teensy also) Theoreticaly FlexBus can output 32 bits paralel - which would mean 5pcs HUB75 ports. Unfortunatly on the Teensy 3.6 not all FlexBus pins are available, so I use it in 16 bit mode, which means 2pcs HUB75 ports. The FlexBus interface generates the write clock for itself, so it is not needed to send every frame twice - less time, less memory. The schematic I used for the test can be found in the TeensyRGB_FlexBus_Test_sch.pdf file.
The project worked, so the FlexBus can be used to send out data paralell on 2pcs HUB75 ports. However this is not a finished project, the code is not ‘clean’, there could be errors also (I am still a beginner in the ARM/Arduino/C++ world), but I hope this work could be useful for others to get ideas from it.
Beside the FlexBus there are some minor improvements in the library (supporting larger fonts, supporting smaller bit depths, some new module mappings.
The project can be found on GitHub:https://github.com/wsandor/SmartMatrix_FlexBus_Test

1 Like

That’s great, thanks for sharing! @easone is working to add Teensy 4.0/4.1 support using FlexBus to SmartMatrix Library. I don’t know if that helps you, or if you’re already set on the Teensy 3.6:

(there’s not details of the port in that thread yet, but the driver is going to focus on the pins accessible with just the Teensy 4.0, and a single HUB75 output. I’ll be working on a shield for the Teensy 4)

Nice work! Driving 2 panels in parallel on Teensy 3.6 is really cool. I think FlexBus on T3.6 has some similarities to FlexIO on T4.0 which is what I’m using. It has the same advantage that the clock signal is generated in hardware so there’s no need for sending each pixel twice. However there aren’t enough FlexIO pins available to drive more than 1 panel in parallel for T4.0, at least if we want to keep a process that uses DMA to transfer data instead of the CPU.

Louis, thanks for the info, I haven’t known about it yet. I will check.

I checked FlexIO on the data sheet. FlexIO is more versatile and complex that the FlexBUS, but if it is configured to the Motorola 68K/Intel 8080 Bus Interface mode then I think it behaves almost like the FlexBus as I use on Teensy 3.6.