MichaelMeissner
Senior Member+
I came in here with a very similar question.
I'll be joining a Teensy-based project soon. I'm an electronics noob, but I'll be doing the software/DSP development. To already get started I'd like to create a most minimal setup that would allow me to do some testing...
Is the following layout a correct interpretation of the above posts?
Note, pin 14 is different from pin A14, which unfortunately is different from the first DAC pin in the 3.5/3.6.
Pin 14 is a digital pin, and it is the 13th pin on the right (starting with the USB up top). While in theory you can use it for output, because it is a PWM pin, you want to use the the first DAT (digital to analog) pin, which is A21, which is the 17th pin on the right.
Unfortunately, the Teensy models don't use the same pin number for the DAT, so which analog pin you use depends on the model:
- The original Teensy 3.0 did not have a DAT pin;
- The Teensy 3.1 and 3.2 have a single DAT pin, which is A14, and the pin is on the back row (replacing the reset pin on the Teensy 3.0);
- The Teensy LC has a single DAT pin, which is A12, and it is in the same location as A14 on the Teensy 3.1/3.2 (the LC doesn't have the underneath pads like the 3.1/3.2 does, so it loses 2 analog pins);
- The Teensy 3.5 and 3.6 have a pair of DAT pins, which are A21 and A22, and are now on the main row of pins.
Typically, you would want to feed the Teensy DAT pins through an amplifier before hooking them to an output device.
The original Arduino microprocessors did not have any DAT pins, and they created the function analogWrite which you could write to a PWM pin and it would rapidly turn it on/off. For LEDs, it gave the appearance of adjusting the strength of the light, since your brain would average out the on and off periods of the light. Similarly for sounds, it could allow you to think a particular tone was being generated if you feed a PWM pin to a speaker.
When the first Arm Arduino (zero) came out, and then the Teensy 3.1, the same analogWrite function was used. If you did analogWrite to a DAT pin, instead of rapidly turning a digital pin on/off, it changes the voltage that the pin generates, so it generates a smoother tone.
Last edited: