migrating from teensy 3.x to 4.x problems, caveats, solutions

lokki

Well-known member
hi there, these are some things to remember when migrating projects from 3.x teensy boards to 4.x boards.

probably not a complete list, just the things I stumbled over, that are not that well documented (if at all)

-analogReadResolution() only works for 8 10 and 12 bits, I had it set to 11 on a teensy 3.6 notice that there is no error when compiling with 11 bits, it just goes to 12 bits in that case

-if you use any pins as analog inputs, be sure to use:
Code:
pinMode(YOUR_PIN,INPUT_DISABLE);
in setup(), otherwise you will get wrong readings both above and below mid-point and a jump in the readings at midpoint. this apparently happens because teensy 4.x has "keeper" resistors in place by default on most pins which try to hold the current state, this messes with the analog readings.

-additionaly it might be advisable to generally
Code:
pinMode(YOUR_PIN,INPUT_DISABLE);
all pins that you don't use, since it will save some power (not sure how much though)

I will add more to this post, as I discover other problems
 
I can contribute with my very recent experience. Going from a teensy 3.6 to a 4.1 with pt8211, I had serious problems with audio synthesis glitches.
On 3.6 the audio was perfect, while on 4.1 there were random glitches.
After some experimentation I found the problem:
it seems that the interrupt that handles the stream to pt8211 does not have a high priority, so some timers I used had a higher priority and caused some latencies in the audio generation (in usb audio also, indeed).
I fixed it by lowering the priority of my timers to 255
 
Back
Top