PWM Output - Only 3 Channels Possible?

Status
Not open for further replies.

syso2342

Well-known member
PWM Output on Teensy 3.1 - Only 3 Channels or more possible? (incl. Custom Update Rat

Hello,

I am working on a project which uses the Audio library and PWM as control for analog filters, etc.

I read "The PWM signals are created by hardware timers. PWM pins common to each timer always have the same frequency, so if you change one pin's PWM frequency, all other pins for the same timer change.".

Is this still true? Does it mean that I can only use 3 PWM outputs (e.g. PIN3, PIN5, PIN25)? Or does this
only affect the PWM Update speed? (I want to use 31KHz Update Rate at 12 Bit).

Does the Audio Library also Interfere somehow with the PWM output or should it not be a problem if I use
AudioOutputAnalog or AudioOutputI2S?
 
Last edited:
I read "The PWM signals are created by hardware timers. PWM pins common to each timer always have the same frequency, so if you change one pin's PWM frequency, all other pins for the same timer change.".

Is this still true? Does it mean that I can only use 3 PWM outputs (e.g. PIN3, PIN5, PIN25)? Or does this
only affect the PWM Update speed? (I want to use 31KHz Update Rate at 12 Bit).

You can use all 12 PWM signals. But only 3 groups of them can have their carrier frequency independently controlled.

Does the Audio Library also Interfere somehow with the PWM output or should it not be a problem if I use
AudioOutputAnalog or AudioOutputI2S?

The audio library only touches the PWM hardware if you use AudioOutputPWM.

If you use AudioOutputI2S, several pins are required, including some of the 12 which have PWM capability. They're not used as PWM by AudioOutputI2S, so there is no interference with the PWM hardware, other than the simple fact that every pin has multiple possible features and I2S requires the use of certain pin in their non-PWM modes.
 
Status
Not open for further replies.
Back
Top