-
Notifications
You must be signed in to change notification settings - Fork 89
DACx311
DACx311 is a library for PyBBIO to interface with TI's DACx311 series digital-to-analog converters:
- DAC5311 - 8-bit
- DAC6311 - 10-bit
- DAC7311 - 12-bit
- DAC8311 - 14-bit
They use an SPI insterface, and require 3 GPIO pins to communicate.
There is an example program at PyBBIO/examples/DACx311_test.py.
Note: the DACx311 DACs 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 8-bit DAC5311
The class for the 10-bit DAC6311
The class for the 12-bit DAC7311
The class for the 14-bit DAC8311
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 DAC, which is used when converting values to voltages.
Sets the output voltage of the DAC to the given integer value from 0 to 2(# of bits)-1 (so for the 8-bit DAC5311 that 0-255).
Sets the output voltage of the DAC to the given floating point voltage.