Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Teensy 4.1 as stable clock source

  1. #1
    Junior Member
    Join Date
    Apr 2020

    Teensy 4.1 as stable clock source

    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.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    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.

  3. #3
    Senior Member
    Join Date
    Sep 2021
    YOu can get almost any frequency by modifying the PLL settings (and by probably not using the analog* functions)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts