Analog to Digital and Digital to Analog
on an Atmel Mega644/1284
ECE 4760 Cornell University

Analog to Digital

There are several ways of converting an analog level to a number using the Mega644/1284, but this discussion will concentrate on using the built-in, 8-channel, 10-bit, successive approximation analog to digital converter (ADC). As with all the Mega644/1284 peripherials, there are a large number of ways of using the buit-in ADC. The input impedance of the ADC is around 100 MOhms, but the maximum source impedance for accurate operation of the sample-and-hold is 10 KOhm. Best accuracy requires that the ADC prescalar output be less than 200 KHz (resulting in about 15 KHz sample rate), but no lower than 50 KHz (to avoid sample-and-hold droop). The ADC will operate up to 1 MHz (about 75 KHz sample rate) with reduced accuracy. Of course, you must always low pass filter the analog input appropriately before feeding it to the ADC to avoid aliasing.

Is is a good idea to read chapter 23 of the mega1284 manual before using the ADC.
There are lots of details not covered in this page, such as autotriggering modes and power saving.

Digital to Analog

There is no built-in D/A on the Mega644/1284, but there are easy ways of converting numbers to voltages. I will describe three here:

Copyright Cornell University August 15, 2012