Skip to content
alexanderhiam edited this page Dec 8, 2012 · 3 revisions

ADS786x is a library for PyBBIO to interface with TI's ADS786x series analog-to-digital converters:

  • ADS7866 - 12-bit
  • ADS7867 - 10-bit
  • ADS7868 - 8-bit

They use an SPI insterface, and require 3 GPIO pins to communicate.

There is an example program at PyBBIO/examples/ADS786x_test.py.

Note: the ADS786x ADCs use their supply voltage as a reference, so if a different reverence voltage is used, level shifting of the SPI lines will be required.

API

Classes:

ADS7866

The class for the 12-bit ADS7866

ADS7867

The class for the 10-bit ADS7867

ADS7868

The class for the 8-bit ADS7868

Methods:

Each class above has these methods.

init(data_pin, clk_pin, cs_pin, vref=3.3)

Each class is initialized with three GPIO pins for the SPI interface. The optional vref argument is the reference voltage of the ADC, which is used when converting values to voltages.

read()

Triggers a conversion and waits for and returns the results as an integer value from 0 to 2(# of bits)-1 (so for the 8-bit ADS7868 that 0-255).

readVolts()

Calss read() then converts the results to a floating point voltage value and returns it.

Clone this wiki locally