Teensy 4.1 as stable clock source


Well-known member
Hi All

I have a project where I need to generate a number of synthesised signals, those being simulated Quadrature encoder out up to about 30MHz (count rate) and a wave form of Sine, Sawtooth and Square wave of up to 1MHz.

To reduce the burnden on the Teensy I have selected some parts to create these waveforms but they both require a stable clock source.

I'm wondering how stable a clock source I can generate from the T4.1 at 25MHz and 16Mhz? This would save me two external crystals/oscillators but do not want to go this way if the stability is much worse that what I would get with a dedicated clock source.
The PWM pins can generate waveforms that are an integer divide of the peripheral clock, which is 150 MHz when Teensy 4.1 runs at 600 MHz.

So you can get 25 MHz with analogWriteFrequency() and analogWrite(). But you can't get 16 MHz. The closest integer divide would be 16.66667 MHz.

The clock stability will be based on the 24 MHz crystal Teensy 4.1 uses, which is a fairly ordinary 30 ppm, plus any "phase noise" from the PLL which multiplies it up to 600 MHz.
YOu can get almost any frequency by modifying the PLL settings (and by probably not using the analog* functions)