The DAC (analogWrite to A0 in Arduino Nano 33 IoT, MKR, and Zero boards) isn’t specified to work to the extreme limits. Basically it doesn’t go below 50mV or above 3.25 volts. While the Arduino documentation doesn’t mention this, the datasheet does in section 37.11.5. While the DAC is 10 bits, the analogWrite function reduces …
The SAMD21 based Arduino boards have a 10 bit DAC, so naturally I wanted to generate a sine wave! Some years ago when I was teaching microcontrollers I had students build a DAC using a resistor ladder. The microcontroller, a 68HCS12, used a timer interrupt to advance the value to the DAC by indexing a …