Teensy 4.0 Pin Usage Guidance


Well-known member
Hi folks,

It's been awhile since I've had time to do much development and I could use a sanity check on some choices I'm making. I'm working on a project where I need to read in 3 channels of PWM, do some processing, then output 3 channels of PWM, a serial stream, and a potential WS2812 data stream. I'm trying allocate pins such that I keep maximum flexibility for each of these tasks.

For reading the PWM in, my current plan is to use FreqMeasureMulti. According to https://github.com/PaulStoffregen/FreqMeasureMulti/blob/master/README.md I can use any FlexPWM pin. I'm planning on pins 7,8,9. I guess I'd either have to know the PWM period and use FREQMEASUREMULTI_MARK_ONLY to get the high time or use FREQMEASUREMULTI_ALTERNATE and some logic to read what the last interval I read was. Happy to entertain other ways of figuring this out, or if there is a library that directly calculates the duty cycle of an incoming PWM signal.

For PWM out I'm thinking of using pins 4,5,6. I was hoping to be physically a bit further away from 7,8,9 to help with routing a PCB, but if I make this choice I get FLEXPWM 2.0,2.1,2.2. Then again if that conflicts with the above that would be good to know.

For the regular serial data stream I'm going to use pins 0 and 1, serial 1.

For WS2812 I plan to use pin 14 for an external LED strip, and pin 17 for an on board WS2812 indicator. I can't remember, if I use this library and the TX pins for outputs, do the RX pins remain as regular digital i/o that I can use for something else?

So there we have it. If anyone has any advice about what I'm trying to do I'd love to hear it. I definitely feel out of practice!

Thank you!