OREGON STATE UNIVERSITY

You are here

TekBots

AD7705 Dual ADC

The AD7705 is a complete analog front end for low frequency measurements.  It is a 2 channel device and sends data using SPI protocols.  Gain settings, signal polarity, and update rate selection can be configured in software using the input serial port.  The device is ideal for use in a smart, microcontroller or DSP based system.

Features

  • 2 fully differential input channel ADCs
  • Programmable gain front end: gains from 1 to 128
  • 3-wire serial interface
  • 2.7 V to 3.3 V or 4.75 V to 5.25 V operation

Documentation

Quick Start with Teensy 2.0 and CP210x USB to UART

  1. Wiring: The easiest way of wiring this setup is to use a protoboard or breadboard to make a set of ground pins and Vcc pins that can be used to connect all Vcc and ground nodes.  Beyond that the setup is outlined in the diagram below.  In this testing setup there are two potentiometers that the AD7705 module will measure voltage on.  It is also possible to do this with a pair of resistors forming a voltage divider between VCC and ground and measuring the voltage from ground to the middle node.   Wiring diagram
  2. After wiring the unit, you can download the C example code below. This code is tested to compile via avr-gcc under Windows and Linux. You may need to install the avr-gcc compiler prior to using these files. A pre-compiled .hex file is included for rapid use. There is a header.h and functions.c file included in the example. The code initializes the hardware UART on the Teensy 2.0 and transmits ADC readouts repeatedly over the UART port at a baudrate of 34800. The protocol is set up for 8 data bits, no parity, and one stop bit (8N1).

    AD7705 Teensy 2.0 Example Code

  3. The sample code can be compiled from the command-line via the command 'make all' and downloaded to a Teensy 2.0 with the command 'make program' in windows. The Makefile does not currently support download automatically to Linux or Mac machines. If you have one of these platforms, download the loader from the Teensy 2.0 website and program the hex that way.

    Teensy Loader

  4. To be able to fully use a serial (UART) port on a computer a 'terminal program' should be employed. One suggested program for Windows based systems is Termite (Local Copy). Termite is a versatile tool allowing for display and entry of both ASCII characters and raw hex values. Additionally, most operating system installs will need to download and install a driver for the CP210x family of USB to UART devices. These can be downloaded directly from Silicon Labs or local but older versions for  Windows Mac, or Linux (3.x.x). Driver installation will vary system to system but often only involves a simple installer utility. Consult Silicon Labs support if help is needed.
    Please note in the image below, the configuration of Termite is shown for communicating with this example code. However the 'Port' setting for each computer may vary. For this example the operating system chose COM4. On many machines it may be COM1 or COM2. To find the com port to be used in Windows open the Windows 'Device Manager' and look under the 'Ports' section of the devices list.  The values outputted to Termite should be between 35262 and 65536.  This is because the output is a unsigned  16 bit value that scales from 0 to 2^16 (65536).  In order to derive the voltage value from the raw output a conversion is required.

termite settings termite output