Right Teensy Board for me

Rrecc

New member
Hey,

I am trying to figure out the correct processor I should get for my needs. I want to generate a pwm of a programmable frequency from 2 pins and control the time difference between the rising edges of those 2 pins. I am hoping to generate a frequency in the range of 4–10 MHz, and the time difference should have a resolution of 4-steps (0,t/4,t/2,3t/4) where t is the time period of the pwm. Which Teensy board should I get to achieve this? Also, what software libraries would I require?

Thank you for the advice in advance!
 
I can't help you with the specifics, but all 3 of the Teensies currently available (Teensy 4.0, Teensy 4.1, and the Teensy MicroMod from Sparkfun all use the same processor inside. The memory provided with the Teensy, the form factor, and the pins available are different, but the processor inside is the same.
 
Hey,

I am trying to figure out the correct processor I should get for my needs. I want to generate a pwm of a programmable frequency from 2 pins and control the time difference between the rising edges of those 2 pins. I am hoping to generate a frequency in the range of 4–10 MHz, and the time difference should have a resolution of 4-steps (0,t/4,t/2,3t/4) where t is the time period of the pwm. Which Teensy board should I get to achieve this? Also, what software libraries would I require?

Thank you for the advice in advance!
The PWM clock frequency for T4 is 150 MHz (F_CPU/4), so at 4 MHz you have ~38 clocks per period and at 10 MHz you have 15 clocks. That's enough resolution to get pretty close to your desired offsets of 1/4, 1/2, 3/4 period. See section 55 of the reference manual for the iMXRT1062 processor. This section describes FlexPWM, and sub-section 55.4.1.3 describes how to generate phase-shifted PWM. There is no high-level API for this feature, so there is a learning curve, but you can start from code in cores\Teensy4\pwm.c to produce your own application-specific code.
 
Sounds like Teensy 4.0, since you're only talking about using a couple pins. So no need for the extra pins and features on Teensy 4.1.

If you use Sparkfun products, maybe their MicroMod Teensy would be a better fit. But for just a couple pins to generate waveforms, Teensy 4.0 is probably best.
 
Back
Top