upgrade to Teensy 4.0 from 3.5 board

Status
Not open for further replies.

Buzz

Well-known member
As it says can I use the same code and just rewire my pins to the 4.0 ?? or am I missing some critical stuff ?? only pins that need to change are Rx2/3 and Tx2/3

OR If you know of a resource that might have this info please point me to it

Thanks Buzz
 
Really depends on your code and the connected hardware, neither of which we can see.

The pins on Teensy 3.5 are 5 volt tolerant when used as inputs, but Teensy 4.0 is 3.3V only. So if you have any hardware connected which drives the Teensy 3.5 pins with 5V signals, that would be the main concern. You can damage the Teensy 4.0 hardware with strong (low impedance) 5V signals.

Code-wise, a first check would be to simply change Tools > Boards to Teensy 3.5 and click Verify to check if your code compiles. If you've used only the normal Arduino functions and libraries, it will probably work. But there are some exceptions. The main one that comes up is pin muxing, like row-column connected keypads, where a delay is needed between changing the rows and reading the columns. Teensy 4.0 is much faster, so if you have speed sensitive code, it might need delays added.

OR If you know of a resource that might have this info please point me to it

All the features of both boards are explained on their product pages. Maybe comparing them side-by-side might help?

https://www.pjrc.com/store/teensy40.html

https://www.pjrc.com/store/teensy35.html
 
Remember these are quite different CPUs. If you're not using any special things and esp. no hard coded register-accesses or such, chances are good.
 
Really depends on your code and the connected hardware, neither of which we can see.

The pins on Teensy 3.5 are 5 volt tolerant when used as inputs, but Teensy 4.0 is 3.3V only. So if you have any hardware connected which drives the Teensy 3.5 pins with 5V signals, that would be the main concern. You can damage the Teensy 4.0 hardware with strong (low impedance) 5V signals.

Code-wise, a first check would be to simply change Tools > Boards to Teensy 3.5 and click Verify to check if your code compiles. If you've used only the normal Arduino functions and libraries, it will probably work. But there are some exceptions. The main one that comes up is pin muxing, like row-column connected keypads, where a delay is needed between changing the rows and reading the columns. Teensy 4.0 is much faster, so if you have speed sensitive code, it might need delays added.



All the features of both boards are explained on their product pages. Maybe comparing them side-by-side might help?

https://www.pjrc.com/store/teensy40.html

https://www.pjrc.com/store/teensy35.html

Thanks Paul , I am aware of the 3.3vdc tolerance , I can scale the voltage with a divider , my SW Eng. said he used a 4.0 with our code But I need to check some outputs to see if they function, I gonna just hook one up and use my existing code and try it out ! all of my analog ins/outs are the same pins.
 
Ill let you guys know how it goes

I got it working , had to change some pins for analog outs ( Pwm filtered ) ,we have some memory issues but we have another product that uses the 4.0 so we just need to apply that fix , the Speed is WAY better now. not to bad actually ! thanks all
Buzz
 
Ok I needed to go to the 4.1 board for the 4k Eprom BUT I cannot load the program now ?? same teensyduiono same Visual micro and Visual studio ??? it run the blink prog. and fails when I try to program in VS then I press the button and get a red led that dims some ( that com's right > ) never get a program OK , anyhow got any tricks/tips ?
also in visual micro do you use teensy 4.0 for the 4.1 board ??

I tried holding the button down and powering up held it for 20 sec. then released , no help but now blink does not work ? humm , I did the reset for 20 sec and got blink back.

Ok I used the Arduino IDE and tried to load up BLINK and have the same problem , Bad board ???( changed usb ports also )

The board is not being recognized , I can see my 4.0 board but not the 4.1 board ??
in Visual studio with everything exactly the same.
 
Last edited:
I did the reset for 20 sec and got blink back.

If the LED blink restore process worked, that's a good sign your Teensy 4.1 hardware is working.

When it's running that LED blink, your computer is supposed to see it as a RawHID device. So best to use Arduino which will show you all Teensy device types in the Tools > Ports menu. If you use other software, it may only recognize COM ports.

While troubleshooting, best to keep the Teensy Loader window visible. And turn off Auto mode, so it won't immediately reprogram. That way you can look at that little window to see if Teensy is detected. After pressing the button (not for 13 to 17 seconds) Teensy should also be using HID protocol which is recognized by Teensy Loader. The window changes from "Press Button...." to a bright color image of the Teensy model you're using.

Bad USB cables are by far the most common problem, where the Teensy hardware is good but your PC can't see it. Charge only cables are the most common issue. But we've also seen plenty of cases where a low quality cable worked at 12 MBit speed on Teensy 3 but could not reliably communicate with Teensy 4 which uses 480 Mbit speed.

So the 2 main pieces of advice: try another known-good USB cable, and make sure you are testing with Teensy Loader or the Tools > Ports menu, or other software which will show HID protocol devices. If you use software which only shows COM ports, you won't see Teensy using HID protocol even when it is working perfectly.
 
Turns out on this computer they software was to old for 4.1 hence not having the board in my list , I got it running ( tried it on another comp. and it finally worked ) did the upgrades and Im OK now !

thanks for the help and INFO !
 
Status
Not open for further replies.
Back
Top