---
title: "Sawtooth waveform with the Arduino Due's Built-In DAC"
description: "Users of the ATmega328 based Arduino boards will recognize that the analogWrite() function doesn't actually do anything analog. It just sets the duty cycle of a pulse width…"
canonical: "https://www.baldengineer.com/sawtooth-waveform-with-the-arduino-dues-built-in-dac.html"
author: "James Lewis"
date: "2013-02-08T00:36:18Z"
lastmod: "2016-04-05T23:25:06Z"
image: "https://www.baldengineer.com/wp-content/uploads/2012/09/sawtooth-banner.png"
categories: ["arduino","microcontrollers"]
tags: ["arduino-stuff","due","sawtooth-waveform"]
---

# Sawtooth waveform with the Arduino Due's Built-In DAC


Users of the ATmega328 based Arduino boards will recognize that the analogWrite() function doesn't actually do anything analog.  It just sets the duty cycle of a pulse width modulated (PWM) signal.  The (new) [Arduino Due board](http://arduino.cc/en/Main/arduinoBoardDue), [which I have had limited time to play with](/my-first-impressions-of-the-arduino-due.html "First impressions of the Arduino Due"), actually sports two Analog DAC channels.
![Sawtooth Waveform](/wp-content/uploads/2013/02/NewFile0.bmp)
Using a very simple for() loop, it is possible to generate a sawtooth waveform using these channels.

