Question about Teensy 4.1 memory pads

Status
Not open for further replies.

KillerBug

Member
On the bottom of the Teensy 4.1 are some pads for adding memory. I have plenty of memory and no more GPIO pins. Can any of these be used as GPIO? I'm guessing the answer is "NO" but I figured I'd ask anyway...just in case.
 
On the bottom of the Teensy 4.1 are some pads for adding memory. I have plenty of memory and no more GPIO pins. Can any of these be used as GPIO? I'm guessing the answer is "NO" but I figured I'd ask anyway...just in case.

You should be able to. They do have normal pin numbers. Note, there two pairs of 8 pads. Two of the pads are are 3.3v and ground. Of the remaining pads, 5 of the pads are common between the two sets of pads (49, 50, 52, 53, and 54). The remaining pad is unique (it is the CS pin). It is pin 48 in the pad nearest the edge, and pin 51 in the second set of pads. So you would have 7 pads available. I haven't personally done this, but I think KurtE was talking about it.

One thing you probably need to research is the Teensy startup code probes the two pads to see if 1 or 2 psram chips are present, to bring them up. Whatever devices you have, would need to passively be probed and not have the startup code think a psram chip is soldered in place.

The pads in the micro-SD (pins 42-47, plus of course the ground and 3.3v pads) also can be used, but you would need something like this to access the pins:

If you want to do serial I/O with flow control, pin 50 in the two sets of pads is the CTS pin for Serial8, and pin 43 in the SDIO pins is the CTS pin for Serial5. The only other CTS pin is pin 19 for Serial3 (i.e. the main SCL pin for the first I2C bus).

Perhaps though, it might be time to look at things like the MCP23017 (i2c device) that can offload 16 digital pins per device. Since there are 3 address pins for the MCP23017, that means you could offload 128 pins with 8 MCP23017's. Going even further, There are 3 I2C buses on the Teensy 4.1 (18/19, 17/16, and 24/25), so in theory you could offload 384 digital pins. I suspect you would run into various limits before you get to 384 pins. Even so, there are I2C multiplexers also that would allow you to split an I2C bus into 8 sub-buses.

However, I tend to think by the time you get up to that level, that perhaps it is time to break your system into a master processor and a bunch of slave processors. That way, you can more easily debug things if each processor only handles say 16 inputs, rather than having one giant system. If you have several slave units, if one goes haywire or is burnt out, it is easier to replace the subsystem, rather than doing an entire replacement. These slave processors don't have to be Teensy 4.1's, if all they are doing is handling I/O from multiple units. Doing it with slave processors, allows the slave to summarize things and prevents the master from having to check all 128 inputs serially (i.e. the slave might tell the master, in the last quantum, there were 3 pins that changed state, and these pins are x, y, z).
 
Last edited:
Awesome, that gets me just enough pins! Thanks people!

Normally I'd use a port multiplier or a shift register but I'm trying to keep this as Marlin-friendly as possible.
 
Status
Not open for further replies.
Back
Top