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

Thread: Question about Teensy 4.0 PWM resolution

  1. #1
    Junior Member
    Join Date
    May 2020
    Location
    Victorville, CA
    Posts
    6

    Question about Teensy 4.0 PWM resolution

    Is the ability to increase the PWM beyond 8 bits limited to analogOUTPUT only on the T4.0? Or will it also read analog at 10 bit resolution?

    Thank you,

    Mike

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,050
    analogRead defaults to 10 bits (not 8 as analogWrite), and yes, there is a function to configure for more or less than 10 if you want different resolution.

  3. #3
    Junior Member
    Join Date
    May 2020
    Location
    Victorville, CA
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    analogRead defaults to 10 bits (not 8 as analogWrite), and yes, there is a function to configure for more or less than 10 if you want different resolution.
    That's really tight! I believe there are only two or thee official Arduino's that can go higher than 10 bit. The T4.x really does have an amazing feature set for its price point.

    I just got a 4.1 today ... looking forward to playing with it. Are you aware of any libraries that could make the Teensy an audio equalizer?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,050
    Quote Originally Posted by EasyGoing1 View Post
    Are you aware of any libraries that could make the Teensy an audio equalizer?
    You could build one using several bandpass filters and mixers in the audio library, where you adjust the gain of each mixer input to control how much of that frequency range to pass to the output.

    If you're not familiar with the audio library, start with this tutorial.

    https://www.pjrc.com/store/audio_tutorial_kit.html

    Maybe skip to the first pages (or part of the walkthrough video) of section 2 to learn how the design tool works, then maybe skip to the part about filters.

    You'll need the audio shield for good quality audio input & output.

    https://www.pjrc.com/store/teensy3_audio.html

  5. #5
    Junior Member
    Join Date
    May 2020
    Location
    Victorville, CA
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    You could build one using several bandpass filters and mixers in the audio library, where you adjust the gain of each mixer input to control how much of that frequency range to pass to the output.

    If you're not familiar with the audio library, start with this tutorial.

    https://www.pjrc.com/store/audio_tutorial_kit.html

    Maybe skip to the first pages (or part of the walkthrough video) of section 2 to learn how the design tool works, then maybe skip to the part about filters.

    You'll need the audio shield for good quality audio input & output.

    https://www.pjrc.com/store/teensy3_audio.html

    And since it's all software, I'm assuming it would be a trivial matter to adjust the frequency range that each filter affects?

    And I'm a big fan of optical SPDIF ... I was poking around Google the other day to see if anyone had any projects out there where they successfully implemented optical SPDIF in the Teensy, and from what I can tell, using an optical cable for audio in and out of the Teensy is a simple matter of just getting the right jacks for the cable and then just modulating the LED directly with really no additional circuitry required ... is that true?

Posting Permissions

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