I wanted a function generator to test some code and used the DAC and analogWrite function of the teensy 3.1. It is listed at https://forum.pjrc.com/threads/2507...Using-Teensy-3-1?highlight=function+generator. Note that this code can generate up to 6 harmonics. Also note that it normalized the output for a total amplitude of one. And as configured the second harmonic dominates.
While testing the output I found the sine wave was clipped. The link gives the details of the voltage and the analog value where this happens. With a 12 bit DAC, which should be able to output to 4096, the output gets clipped at 2733 and the maximum voltage is 2.151 volts. The variable analogBits is actually half the analog bits used and is an easy way to test this.
Is there something I am missing or is this a limitation of some sort?
While testing the output I found the sine wave was clipped. The link gives the details of the voltage and the analog value where this happens. With a 12 bit DAC, which should be able to output to 4096, the output gets clipped at 2733 and the maximum voltage is 2.151 volts. The variable analogBits is actually half the analog bits used and is an easy way to test this.
Is there something I am missing or is this a limitation of some sort?