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

Thread: Teensy 4.0 hardware timers for PWM and pins

  1. #1
    Junior Member
    Join Date
    Nov 2019

    Teensy 4.0 hardware timers for PWM and pins

    Could someone tell me how many PWM timers the Teensy 4.0 has and the respective pins? I'm looking for something like this that I got from the PWM and Tone link for the Teensy 3.6:

    FTM0 5, 6, 9, 10, 20, 21, 22, 23 488.28 Hz
    FTM1 3, 4 488.28 Hz
    FTM2 29, 30 488.28 Hz
    FTM3 2, 7, 8, 14, 35, 36, 37, 38 488.28 Hz
    TPM1 16, 17 488.28 Hz


  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Hopefully someone will have the exact information you are looking for.

    Also not sure from your question what information are you really wanting or needing. For example if you are simply wanting to to use analogWrite, then simply looking at the reference card for the T4 should give you most of the details you need. Now if your question is something like: can I do N pins of PWM output at some speed, then you need additional information, or if you simply want to know which actual timers are used for what, then you might need other information.

    But in the meantime hopefully you can extract some maybe most of the information from some of the following:

    There are lots of timers and the like: How many pins support PWM?

    One way is to look at the card that ships with the T4 which marks all of the PWM pins.
    You can also see this card up at:

    There is also lots of information in post #3 of the beta thread for T4:
    Which has table showing which timer and the like is connected to each of the pins.

    There is lots of information on each of these timers up in the datasheet, which you can download from:

    As for the clock speeds, many of them depend on how they are configured. So for example most every time I am up trying to figure out the timings and settings for things, like how fast can SPI go or the like, I have to start off looking at the CCM Clock tree which I think I have the version of IMXRT1060RM up on pjrc, is on page 1072 (Section 13.4)

    Sections 50-58 describe the different timers that are on the T4. For example chapter 54 describes the eFlexPWM system...

    But if it were me, the first thing I would do is to look at the code: For example if you look at the latest released Teensyduino and look at the file cores\teensy4\pwm.c
    Or the most up to date version (not yet released) you can look up on github in @PaulStoffregen core project:

    If you look at the array pwm_pin_info It shows which timers are used for which PWM pin.
    And farther down if you look at the actual code for analogWrite, you can walk through to see how it handles configuring each of these types of timers.

    Hope that helps a little,


  3. #3
    Junior Member
    Join Date
    Nov 2019
    Thanks Kurt, I'll look into it.

    Right now I'm generating a PWM on one timer, and reading the duty cycle on 4 independant freqencies on the 4 other pins as follows:

    Wheelspeed : FTM3 pin2
    Input frequency 1: pin5
    Input frequency 2: pin6
    Input frequency 3: pin22
    Input frequency 4: pin23

    When I wrote my first question, I was thinking that the "FreqMeasureMulti" library needed a separate timer for each input frequency, but since it can handle 8 inputs, that may not be the case. I was confusing it with generating different frequencies. I may want to eventually output than one frequency, so the basically my question is whether or not the Teensy 4.0 has more timers than the Teensy 3.6, and therefore more PWM output capability.

Posting Permissions

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