Tone library, the Audio library and DAC/A14

pictographer

Well-known member
What is the expected behavior for using the tone() function with the DAC/A14 pin on a Teensy 3.1 and Teensyduino 1.20-rc5? Silence is the behavior I'm getting. There are no pin restrictions in the documentation.

Code:
void setup() {
  pinMode(13, OUTPUT);
  // Note: still doesn't work with pinMode(A14, OUTPUT);
}


void loop() {
  static int i = 0;
  tone(A14, 440 * i);
  delay(1500);
  ++i;
  if (i > 3) i = 0;
  noTone(A14);
  digitalWriteFast(13, i & 1);
}

I've verified that my hardware setup can produce audio using analogWrite() with delays. This generates moderately clean tones and allows software volume control. There are occasional quiet clicks which I assume are noise from whatever other switching is going on either over the USB power or in the Teensy itself.

The Audio library PlaySynthMusic example sort of works with AudioOutputAnalog, but the sound is garbled with static like poor radio reception. My hardware setup is a straight connection from A14 to the inputs of a pair of earbuds and the other connection to ground with no external filtering. Next version of the hardware will have at least a resistor and capacitor.

Is the Audio library output to A14 poor due to the lack of hardware filtering, an inherent limitation of the DAC or ...?

By the way, the Audio category is listed twice in the examples under File > Examples.
 
Back
Top