Porting from Teensy 3.2 to 4.0?

Hi folks,

With the ongoing supply issues regarding the 3.2, I'm now looking to transition a project to the 4.0. But I am not the original manufacturer of the hardware or firmware I'm using for this so I'm not super familiar with the intricacies of it (though I do have a decent understanding of it). I'm also very new to Teensys as a whole so please forgive me if these are stupid questions!

The manufacturer was at one point considering porting to the 4.0 but ultimately went a different direction with hardware, choosing to move away from the Teensy entirely. I want to pick up where he left off and port the current hardware and firmware to be compatible with the 4.0.

One thing he said to me is that some functionality would be lost due to the 4.0 having less extra serial ports than the 3.2, but from what I can find on the PJRC site the 4.0 has more serial ports than the 3.2!

Say I were to just mount a Teensy 4.0 in the place of a 3.2 in my project, both flashed with the same firmware. What wouldn't work? What would I maybe need to change? Just trying to get a sense of how much of a project this will be!

TIA!
Reider

Edit: here's the GitHub repo, if it helps: https://github.com/Tom-evnut/TeslaBMSV2
 
Some time ago, I wrote up the following in the unofficial Teensy wiki about the commonality of Teensys:

I have a google spreadsheet that tries to go over in detail all of the pin usages between the different processors:

In particular, going from the Teensy 3.2 to 4.0:
  • The Teensy 4.0 does not support 5v inputs on digital pins;
  • The underneath solder pad layout is completely different;
  • The Teensy 4.0 does not have the inner pins A10, A11, and AREF.
  • The Teensy 4.0 does not have a DAC (digital to analog) converter (i.e. pin A14). The pin in the A14 position on the Teensy 4.0 is an on/off pin (connect the pin to ground for a few seconds and it turns off the Teensy until you connect it to ground again).
  • The Teensy 4.0 hs 7 serial UARTs compared to 3 on the Teensy 3.2. Serial1 is in the same location on both. Pins 7/8 are Serial3 on the Teensy 3.2 while they are Serial2 on the Teensy 4.0. Serial3 is now on pins 14/15;
  • The Teensy 4.0 does not have any touch pin support;
  • The I2S pins are in completely different locations. If you use the audio shield, you will need to use revision C for the Teensy 3.2 and revision D for the Teensy 4.0;
  • Pins 21/20 supported PWM on the Teensy 3.2, while they don't on the Teensy 4.0, but there are other PWM pins on the Teensy 4.0 that aren't present on the Teensy 3.2;
  • Various new features are on the Teensy 4.0 that aren't on the 3.2 (2nd I2S bus, default speed is 600Mhz, more memory, SD port available via solder pads, S/PDIF support, more UARTS, more CAN buses, etc.)

<edit>
I forgot:
  • Teensy 4.0 has a second SPI bus, though to use it, you will need to solder wires to the underneath solder pads;
  • Teensy 4.0 has 5 inner pins that can be connected to a USB header to give you USB host support (i.e. Teensy acts as a master rather than slave) on the second USB port;
  • Teensy 4.0 does not have the alternate SPI ports that the Teensy 3.2 had which needed to be used when the revision C audio shield was mounted (the I2S pins overlap with the default SPI pins);
  • Teensy 4.0 does not have fixed pins for Serial1/2/3 CTS pins, but it uses 'xbar' pins. Note if using 'xbar', the CTS signal is inverted.

If at all possible, design your PCB so that you can use either a Teensy 4.0 or Teensy 4.1 (i.e. leave 1" behind the Teensy to allow for the larger 4.1 board, and don't use the underneath solder pads). There is at least one PCB that takes the Teensy 4.0 and brings out the micro SD card reader as well as pins 23 to 33, and lays them out the same as the Teensy 4.1 (https://oshpark.com/shared_projects/vzG532jm).
 
Last edited:
Back
Top