In this exercise you will use the embedded programming and sampling techniques and presented in previous classes to build a simple noise generator using a DAC coupled with audio speakers. The basic idea is to generate a sinusoidal signal of a controlled frequency and output it into the DAC, this principle is known as Numerically Controlled Oscillator (NCO).
For this exercise, we will use the AVR MCU found in the Arduino Uno board: the ATmega328.
The ATmega328 doesn't have a DAC so an external DAC was built using the R-2R resistor ladder network. The schematic and wiring of the Arduino and the DAC with the audio speakers is shown below. Don't worry, it will, probably, be wired by the teaching assistant ;).
WARNING: Both the Arduino and the speakers must be connected to the same ground! That means that if you're using a USB speaker, plug it in the same PC or laptop that you plugged the Arduino.
You will implement an application that generates a sine wave with a given frequency using a look-up table. The sine wave frequency will be controlled by the voltage value read by the ADC. In order to do this, you will configure the MCU's ADC through it's registers. You can use your source code from the Digital Voltmeter exercise. The generated sine samples must be sent to the 8-bit DAC through the MCU's Port B. Understanding and implementing these operations is up to you, but the supplied documentation might help you a lot.