Access to more GPIOs on Teensy4.1

JDC762

Member
Looking at a project that needs 100 dedicated GPIOs to monitor state changes. They would be set as pull-up interrupts, and then a few other GPIOs for control/comms with a host Teensy (code already written and working).
MIMXRT1062DVJ6 datasheet says that the chip has 127 GPIOs (124 tightlycoupled). If I do the development work using the Teensy4.1 for a cut down bench prototype say for 50 GPIOs and say 5 for control/comms, would I be able to use/expose the other GPIOs and use them for the remaining 50 GPIOs needed (total 105)?
Is this possible, and if so, I suspect it will need the GPIO mapping file increased, and will it work with the Teensy libraries expecically if just use the extra GPIOs as basic inputs?
Welcome your thoughts.
 
would I be able to use/expose the other GPIOs and use them for the remaining 50 GPIOs needed (total 105)?

To do this, you would need to create your own PCB design using the T4 bootloader chip.


If I do the development work using the Teensy4.1 for a cut down bench prototype say for 50 GPIOs and say 5 for control/comms

13 of the 55 possible GPIO pins are quite inconvenient to access, so you might want to target use of only 42 for your prototype.

For those last 13, the SD card has 6 and the QSPI memory pads on the bottom have the other 7.

Or maybe Mark's suggestion to use I/O expander chips might be an easier path? Or you might consider mux chips, like shown on the USB MIDI page. Scroll down to "Connecting Many Buttons & Knobs/Sliders"


I suspect it will need the GPIO mapping file increased, and will it work with the Teensy libraries

Yes. On the T4 bootload chip page, scroll down to "BGA Pinout Diagram" and look for the notes about using extra pins. You'll find links to forum conversations where how to do this has been previously discussed. If you get stuck or just have questions about the details, those threads would be the place to ask.

Also see the warning about SD_B1_05. Even though it seems available, do not use that pin!
 
Paul

Thanks for your help it is much appreciated, and helps tremendously.
For the prototype I can use less pins to make it easier to access pins that are easier to get to.
As for using mux or extenders, for my application this would not be fast enough as I am using the 600MHz and the 3-5 clock cycles to get the timing I need anyway. I do not have time to switch to other devices including settle time due to induced capacitance; thanks for the suggestion though.

Top tip on pin NOT to use, I imagine that is a world of hurt finding that out the hard way.

Thanks again. How do I buy you coffee?
 
I'm trying to access a few more pins on the Teensy 4.1 a t present as part of a MIDI controller build. I've soldered wires onto the QSPI memory pads, but it's a dodgy process! Fortunately the only pad I've ripped off the board so far is a duplicate. If anyon knows of a better way to access these pins I'd love to hear it. To access the SD card slot pins I've ordered an SD card extender cable which I'm hoping can be cut and soldered onto a PCB header. The target is 48 usable pins.
 
I have searched the forum, but I can't seem to find an xls that lists out the pin mapping for the MIMXRT1062DVJ6
I have found a detailed pinout by KurtE.
However, I need an extra column that maps the actual pin on the chip to the Native, including those that are not being used.
Is this available for the 196 pins?
Really appreciate anything to save time mapping from the datasheet; I asked ChatGPT but the first few pins were wrong, so not trustworthy!!!
 
Hi All

So I have done a lot of work to extended the pins available to 107 (0-106)
Attached is a xls that shows the 196 Pads for the MIMXRT1062DVJ6 and the references and descriptions of each pin.
Also attached are the files that need to be replaced in the Arduino reference library for the compiler (remember if you update Teensy in the Arduino IDE, it will overwrite these files (you will get a compile error if you are using the defines for the new pins).

I have had to put the xls in my dropbox, link is here

I would welcome a peer review of these files to ensure that they are valid before I design the devBoard for using these extra pins.

Thanks.
 

Attachments

  • core_pins (Extended).h
    127.6 KB · Views: 154
  • digital (Extended).c
    16.2 KB · Views: 146
  • pins_arduino (Extended).h
    7.8 KB · Views: 146
SD_B1_05 is the only pin to avoid as per Paul's comments above.
I just picked the pads that where next on the list. To be honest I should have perhaps picked them based on the registry so only need to read in from a minimum number of registries to get all pin states that I am interested in. However, I did avoid any pad that said test or mode on it as much as possible, to ensure that did not create a problem.
Arduino 83 is designated as SD_B1_02 in my setup as above, yes.
I am hoping that a grown-up might do a quick peer review to ensure that what I have proposed is correct.
If it is OK, it would be handy to have this on the PJRC website as a resource to say others having to create it.
 
Hi All

So I have done a lot of work to extended the pins available to 107 (0-106)
Attached is a xls that shows the 196 Pads for the MIMXRT1062DVJ6 and the references and descriptions of each pin.
Also attached are the files that need to be replaced in the Arduino reference library for the compiler (remember if you update Teensy in the Arduino IDE, it will overwrite these files (you will get a compile error if you are using the defines for the new pins).

I have had to put the xls in my dropbox, link is here

I would welcome a peer review of these files to ensure that they are valid before I design the devBoard for using these extra pins.

Thanks.
Thanks for sharing your code, you saved me days of work!

Was the board successful? Tried your code, seems to work, but I can't really test until I build a board. I get these warnings for GPIO_EMC_33-GPIO_EMC_41:

Code:
 warning: conversion from 'long long unsigned int' to 'uint32_t' {aka 'long unsigned int'} changes value from '274877906944' to '0' [-Woverflow]
  755 | #define CORE_PIN77_BITMASK      (1ULL<<(CORE_PIN77_BIT))


Did you come across similar warnings?
 
Thanks for sharing your code, you saved me days of work!

Was the board successful? Tried your code, seems to work, but I can't really test until I build a board. I get these warnings for GPIO_EMC_33-GPIO_EMC_41:

Code:
 warning: conversion from 'long long unsigned int' to 'uint32_t' {aka 'long unsigned int'} changes value from '274877906944' to '0' [-Woverflow]
  755 | #define CORE_PIN77_BITMASK      (1ULL<<(CORE_PIN77_BIT))


Did you come across similar warnings?
To be fair, I did say that I have not built this board yet. However, I did compile the code and didn't see anything like that.
I will ensure that it is pointing to the correct files and try again.
Did you get anywhere with this in the meantime?
 
To be fair, I did say that I have not built this board yet. However, I did compile the code and didn't see anything like that.
I will ensure that it is pointing to the correct files and try again.
Did you get anywhere with this in the meantime?
I ended up ignoring the warnings, and the board seems to be working just fine. I didn’t test every pin, but all the ones I needed functioned correctly. Your code worked perfectly as-is—thanks!
 
I ended up ignoring the warnings, and the board seems to be working just fine. I didn’t test every pin, but all the ones I needed functioned correctly. Your code worked perfectly as-is—thanks!
I am looking at designing my own Teensy 4.1 due to my GPIO need of 103 pins, 7 for SPI bits, 48 for IO and 48 to control the direction of 5v level shifters. I want to be able to do full 48 pin access in the 10's of Mhz for chip testing etc. Anyway I came across this post and took a look as deep in the schematics. The reason for the error is that the pins 74-80 (EMC_33-EMC41) should be referenced off GPIO8 with pin numbers < 32 rather than GPIO9 with pin numbers >=32. I attach a modified file which should stop the compiler errors and work correctly.

On a side note has anyone made up a pcb design with 103 GPIO and produced a PCB?
I would love to get either the design files or a PCB that I can play around with for testing?
 

Attachments

  • core_pins (Extended).h
    127.6 KB · Views: 53
I am looking at designing my own Teensy 4.1 due to my GPIO need of 103 pins, 7 for SPI bits, 48 for IO and 48 to control the direction of 5v level shifters. I want to be able to do full 48 pin access in the 10's of Mhz for chip testing etc. Anyway I came across this post and took a look as deep in the schematics. The reason for the error is that the pins 74-80 (EMC_33-EMC41) should be referenced off GPIO8 with pin numbers < 32 rather than GPIO9 with pin numbers >=32. I attach a modified file which should stop the compiler errors and work correctly.

On a side note has anyone made up a pcb design with 103 GPIO and produced a PCB?
I would love to get either the design files or a PCB that I can play around with for testing?
Nice catch thanks! Unfortunately, I can't share my PCB, but I'm willing to review your design or answer any hardware questions. SparkFun has some hardware files for their MicroMod Teensy Processor Board that may be helpful.
 
I also have a use case that could benefit from more pins. I previously posted about the idea of a Teesny 4 Max design to expose ALL of the pins, but I was pointed to the Teensy Micromod and it is working great EXCEPT, I still need more pins. It sounds like there might be more interest than just me. If I were to design a board and open source it so anyone can make it, maybe I could afford to buy one :) I'm curious what thoughts you all have about the best form factor for exposing 127 pins, plus power etc would be? I had considered using the same connector as the arduino portenta's because they have 100 pins each and are readily available, and would allow creating different carrier boards. Any other ideas?
 
Probably too niche to be a viable product, but as a lifelong (50yrs+) Veroboard fan for one-off projects I like the dual in-line format of the Existing Teensy boards. As the standard, 100 x 500 piece of Veroboard is 36 holes wide, perhaps a 72 pin version would be a possibility? That's an extra 24 GPIO pins over a 4.1.
 

Attachments

  • MIDI Controller Board-1.jpg
    MIDI Controller Board-1.jpg
    309.7 KB · Views: 53
perhaps a 72 pin version
Would be cool - but caught this pic on another recent thread - already hard to unsocket 24 pins
1755411167728.png

Paul noted getting the needed pins escaped for the T_4.1 already tough without more layers and more costly PCB.
Though losing Ethernet would give back a dozen?
 
I have created schematics for a Teensy4EX that uses all the available pins.
It keeps both the USB ports along with D0/D1 and also has D6/D9-D13/D32 which allows me to use SPI with three CS.
This then leaves 96 pins, 48 of these pins go to DIR pins of SN74LXC1T45's to allow 'proper' direction controlled 5v translation of the other 48 pins.
I have a project that requires very high speed access to 5v DIO and have found the auto direction 5v IC's to not work well.
The voltage translation could be left off the Teensy module and put on the carrier board instead which would make the board better for universal use. This then off course would require the 105 pins plus VCC/GND to go to connectors, this would be a cost concious choice that would also be based on ease of hand soldering the mating connector for prototyping etc.
This would be my first PCBA attempt and am finding it all a bit much atm. Component choice/stock/extended line costs/custom component ordering etc. Looks like its likely to cost £££££ to just get a few boards to prove design.
 
I have created schematics for a Teensy4EX that uses all the available pins.
It keeps both the USB ports along with D0/D1 and also has D6/D9-D13/D32 which allows me to use SPI with three CS.
This then leaves 96 pins, 48 of these pins go to DIR pins of SN74LXC1T45's to allow 'proper' direction controlled 5v translation of the other 48 pins.
I have a project that requires very high speed access to 5v DIO and have found the auto direction 5v IC's to not work well.
The voltage translation could be left off the Teensy module and put on the carrier board instead which would make the board better for universal use. This then off course would require the 105 pins plus VCC/GND to go to connectors, this would be a cost concious choice that would also be based on ease of hand soldering the mating connector for prototyping etc.
This would be my first PCBA attempt and am finding it all a bit much atm. Component choice/stock/extended line costs/custom component ordering etc. Looks like its likely to cost £££££ to just get a few boards to prove design.
Mind sharing your schematics/pcb layout with me? I've decided to go full steam ahead on this, and the more I have to copy for layout the better. It looks like it needs to be at least a 6 layer board, maybe an 8. and I'm going to design something like the micromod, as universal as possible so I can design different carrier boards, the first of which will just be a usb plug and here's every pin for breadboarding most likely. But one thing at a time :)
 
For the connector, 2 of these would give 160 pins, which I think would be enough for the 128 or so pins, plus all the power and grounds. The important thing would be deciding on a form factor that could be consistent and easy to mate up to for carrier boards. The biggest downside I see to these is that they are only rated to 85C, but I'm having a hard time finding something similiar with a higher rating that isn't HUGE in comparison. https://www.snapeda.com/parts/DF40C-80DP-0.4V(51)/Hirose/view-part/?ref=eda
 
Back
Top