Teensy 4.1 used in.place of t3.2?

mindwave

Member
If you've tried to buy a teensy 3.2 lately your either willing to shell out $192 ( just saw one on unnamed vendors site) or working with other boards. 4.1 for example seems reasonably priced from a digital bookstore. But as this is my first attempt at creating a teensy project (teensy synth by notes and volts) I am now faced with the sketch conversion . since the socs are different seems as though some work would be needed, but what's the best way to start? Wanting to learn. Thanks. J
 
Make sure 5V doesn't touch any pin but VIN. T_4.1 pins are only usable with 3.3V.

Look at the PJRC Card for the two devices. Identify pin/function used on each and confirm it hasn't moved.

Try to build and see what warnings/errors might appear with regard to external libraries.

Generally, it is just faster with more resources, pay attention to any places where loop or processing was timing dependent.

Any common TeensyDuino supported interface should generally work the same from the high level 'Arduino' interface.
 
but what's the best way to start?

I know this is probably too obvious, but seriously if you haven't yet, just select Teensy 4.1 in the Tools > Boards menu and then click Verify to see if your code compiles. If you've already addressed hardware issues like which pins have the peripherals your code uses, and you've taken care that none of the signals are 5 volts (Teensy 3.2 is 5 volt tolerant, Teensy 4.1 isn't), then odds are pretty good it will work if your code compiles.

In some cases the much higher speed of Teensy 4 can cause trouble. Switching mux chips is the most common issue. You can try running slower with Tools > CPU Speed. Maybe even try running at only 24 MHz for the sake of testing. If it works when running slow, but you want to run faster, then you know it's just a "simple" matter of finding the right places to add delays.

If you do get compiler errors you can't solve, we can try to help. But we need to at least see the error messages. Seeing the actual source code greatly increases the chances we can help you fix the problem. If your code is proprietary, maybe spend some time to trim it down to just the part giving you the error, and hopefully sharing that small part won't be such a problem. We're pretty good at helping with code problems when we can copy the code into Arduino and reproduce the error by just clicking Verify. ;)
 
Wow thanks

Ok I was bored so I guessed you are referring to the synth here: https://www.notesandvolts.com/2018/05/teensy-synth-part-1.html
That part you can certainly test with the Teensy 4.1 and its own audioboard.

Note the schematic here: https://www.notesandvolts.com/2019/01/teensy-synth-part-10-hardware.html
It later replaces the Teensy Audio board with the Teensy 3.2 DAC which the Teensy 4.1 do not have.

Great information and suggestions, I really appreciate the thoughts.

And yes the N/V was the project I wanted to address since he's got it layed out pretty much step by step building it out as you go, it will help me learn Teensy/arduino peocesses as well a shelp fill in a gap!

I've got the 4.1 and the sound board to start., Ill let you know how it goes.

I was just amazed, when I first saw it the 3.2 was all over amazon at $1 above retail, then I decide I have the time and NO ONE has any and those that do are $100+

One reason Im moving in this direction is how well its layed out, BUT also because the RASPI (my 1st board) went sky high over a year ago

Thanks again!

J
 
In general, it depends.

If you only use the basic devices (first I2C bus, first Serial port, first SPI bus, 10 analog input pins, pins 0..23 as digitial pins) then it should work fine.

If you want to do stuff with audio, it will need reworking:

  • The audio I2S pins are completely different;
  • Because of the I2S difference, you want to use the Audio shield revision C on the Teensy 3.x boards, and the Audio shield revision D on the Teensy 4.x boards;
  • The Teensy 4.x does not have a DAC pin (digital to audio converter) that you can produce low grade sound on.

Using serial port 2 and 3 on the Teensy 3.x uses different pins compared to the Teensy 4.x.

As mentioned, the Teensy 4.x is not tolerant of 5 volt digital input.

The Teensy 4.x does not have an analog reference that would allow you do to analog reads with a lower voltage than 3.3 volts.

Some displays have special optimizations if you use certain pins on the Teensy 3.x microprocessors. The Teensy 4.x microprocessors have different optimizations, and different special pins. The displays should still work, but they might be slightly slower.

I've written two documents that touch on the differences. The first is an entry that I did in the unofficial Teensy wiki some time ago about the differences. The second is a google document where the first sheet attempts to compare all of the Teensy LC/3.x/4.x for uses of each pin:

 
In general, it depends.

If you only use the basic devices (first I2C bus, first Serial port, first SPI bus, 10 analog input pins, pins 0..23 as digitial pins) then it should work fine.

If you want to do stuff with audio, it will need reworking:

  • The audio I2S pins are completely different;
  • Because of the I2S difference, you want to use the Audio shield revision C on the Teensy 3.x boards, and the Audio shield revision D on the Teensy 4.x boards;
  • The Teensy 4.x does not have a DAC pin (digital to audio converter) that you can produce low grade sound on.

Using serial port 2 and 3 on the Teensy 3.x uses different pins compared to the Teensy 4.x.

As mentioned, the Teensy 4.x is not tolerant of 5 volt digital input.

The Teensy 4.x does not have an analog reference that would allow you do to analog reads with a lower voltage than 3.3 volts.

Some displays have special optimizations if you use certain pins on the Teensy 3.x microprocessors. The Teensy 4.x microprocessors have different optimizations, and different special pins. The displays should still work, but they might be slightly slower.

I've written two documents that touch on the differences. The first is an entry that I did in the unofficial Teensy wiki some time ago about the differences. The second is a google document where the first sheet attempts to compare all of the Teensy LC/3.x/4.x for uses of each pin:


Michael, those links are great thanks!

hopefully it will be a fun learning curve, one of the items Im VERY interested in is adding the MIDI IN/OUT.
I know the engineer that MSFT hired in 1987 to "fix" the Midi implementation in wwindows....you know the one that STILL isnt right....
 
Back
Top