08 September 2006

Analog-to-Digital Interfacing

The ADS7841 is a 4-channel, 12-bit sampling Analog-to-Digital Converter (ADC) with a synchronous serial interface. The resolution is programmable to either 8 bits or 12 bits. It is a product of Burr-Brown form Texas Instrument, see the product page.

This ADC give the 12-bit Binary Code Decimal (BCD) output value therefore the maximum value is 999 integer. If we want to convert this value to the real value, we must divide this value by 4096 (12-bit) and multiply by the maximum real ouput. Suppose the real maximum of output is 5V, the ratio should be 5/4096 = 0.00122. We can use 0.00122 multiply the output from ADS7841 to get the real ouput value.

This is an example how to interface ADS7841 with 8051. I use SDCC as C Compiler. My schematic is shown below. I still do not convert to the real value so my variables are integer.

Schematic: 8051 interface to ADS7841

- ADS7841 [pdf]

Source Code (For SDCC)
- ads7841.h
- test_ads7841.c

Note: require lcd.h

Related Links
- ADS7841 Products Page

No comments: