-
Notifications
You must be signed in to change notification settings - Fork 87
ADS786x
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.
The class for the 12-bit ADS7866
The class for the 10-bit ADS7867
The class for the 8-bit ADS7868
Each class above has these methods.
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.
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).
Calss read() then converts the results to a floating point voltage value and returns it.