Teensy 4.0 DAC Function

LiliV

New member
Hi, I have a question regarding the Teensy 4.0. On the Teensy 3.2 there is a pin called A14 specially designed to connect to a DAC. The corresponding pin on the Teensy 4.0 is called On/Off, and I wonder whether it could still function as a pin to connect a DAC to. If not, where would it be suitable for a DAC to be soldered in instead? I would be really thankful for your answer!
 
On the Teensy 3.2 there is a pin called A14 specially designed to connect to a DAC
On a Teensy 3.2, pin A14 is the output of the onboard DAC.
For a Teensy 4.x [which has no onboard DAC's], you could use the I2S interface to connect an external DAC of your choice.

Paul
 
On a Teensy 3.2, pin A14 is the output of the onboard DAC.
For a Teensy 4.x [which has no onboard DAC's], you could use the I2S interface to connect an external DAC of your choice.

Paul
Thank you very much! I read that the I2S interface is designed especially for audio purposes, in my project I don’t do anything with sound. Do you have other options for me or would the I2S interface still work?
 
You would probably want to use an SPI DAC in that case. There are many options at various bit depths (from 12 to 18 bits) , both single and multi-channel. Most are surface-mount, but a few through-hole DAC chips still exist.
 
Thank you! Another question: I already have a code that should function with the Teensy 3.2 board. If I buy an Arduino Duo board, could I still use the same code (with a couple of appropriate adjustments) or should I completely rewrite the code?
 
If your DAC update rate is not too high, there are lots of I2C options, too. Try googling "Adafruit DAC Qwiic". They have various breakout boards for 1-chan 12-bit, 4-chan 12-bit, 1-chan 16-bit, etc.
 
If I buy an Arduino Duo board,

Maybe you should ask for advise about Arduino's boards on Arduino's forum. Of course it's ok to talk about Arduino's products here, but as a practical matter of reaching people with knowledge and experience using those boards, asking in the proper place matters.


could I still use the same code (with a couple of appropriate adjustments) or should I completely rewrite the code?

Please understand you're asking us for programming advice for code we can't see.

But as a general rule, completely rewriting code rarely turns out to be as easy as it initially appears. Usually best to make a relatively small edit, if you can. Without knowing anything else about your program, my advice would be to try the simplest thing first, and if that doesn't work out try something only incrementally more complex as the next step.
 
Back
Top