This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DAC8571: Python code for the DAC8571 and RPi

Part Number: DAC8571
Other Parts Discussed in Thread: ADS1115,

Hello,

We are thinking of improving the drive resolution of a system that it used in photographic focus stacking at micron levels, these are current and voltage mode drivers for driving Voice Coil and Piezoelectric Motors. Our system is now based around the MCP4725 12 Bit DAC and ADS1115 16 Bit ADC and works quite well, but I believe the addition of the DAC8571 will improve upon this. The main controller utilized is a Raspberry Pi 3B and the controlling code is written in Python.

Could you point to a reference example of the Python code used to control the DAC8571. We've purchased a couple DAC8571 already, but could use a couple samples in case I smoke these.

BTW the ADS1115 are absolutely beautiful parts to work with, I appreciate the effort in the design of the ADS1115 as I'm a semi-retired analog/RFIC designer and did quite a bit of precision analog chip design (have a couple patents on LDO and precision voltage dividers).

Best,

Mike

mawyatt2002@earthlink.net

  • Hi Mike,

    Welcome to E2E and thank you for your query. Glad to know that you find our products useful. At this moment, we don't have any support for Python for our DACs. Having said that I found some examples on the web for interfacing Raspberry Pi with DAC8571 using python. You should be able to get some clue about how to get started. I am writing some pseudocode that will help you get started with the correct programming sequence of DAC8571.

    Third-party links: https://www.element14.com/community/community/raspberry-pi/blog/2015/04/21/raspberry-pi-2-fun-with-i2c-dacs-and-adcshttps://learn.sparkfun.com/tutorials/raspberry-pi-spi-and-i2c-tutorial

    PSEUDOCODE:

    -----------------------------------------------------------------------------------

    //Configuration:

    SLAVE_ADDR1: 0x4C // A0 is pulled-down

    SLAVE_ADDR2: 0x4E // A0 is pulled-up

    //Write mid-code and update DAC

    CONTROL_BYTE: 0x10

    MSDB: 0x7F

    LSDB: 0xFF

    <START> SLAVE_ADDR1/2 <ACK> CONTROL_BYTE <ACK> MSDB <LSDB> ACK> <STOP>

    //Power-dwon DAC with 1k pull-down

    CONTROL_BYTE: 0x11

    MSDB: 0x40

    LSDB: 0x00

    <START> SLAVE_ADDR1/2 <ACK> CONTROL_BYTE <ACK> MSDB <LSDB> ACK> <STOP>

    -----------------------------------------------------------------------------------

    Hope that answers your question.

    Regards,

    Uttam Sahu

    Applications Engineer, Precision DAC

  • Hi Uttam,

    Thanks for the reply and help.

    After viewing the links I've found that the DAC8671 has a quad output version, I was not aware of this. Since I was planning on using a separate DAC for X and Y axis, now I can use a single DAC with 4 outputs!

    Need to spend some more time studying these links, thanks again.

    Best,

    Mike