I searched for a library for this chip and couldn't find one, so I bit the bullet and made one. I can't really call it a library as it only implements the write dac function. I found the chip defaults in EEPROM were fine for my application so I didn't finish the write EEPROM or read dac functions.
Note that this chip is on address 0x61 and not the standard 0x60 for this chip. At the time I ordered it, they were out of stock on the standard chip. If you have a standard chip (A0 version), change the address in the def init line to 0x60. Do the same in your main program i.e. dac = MCP4728(0x60). Define your 4 channel outputs as integers between 0 and 4095 and pass them through dac.setAllVoltage(chA,chB,chC,chD). Rename the attached txt file extension to py.
I am a beginner with python, but I have breadboarded and tested this and it works fine. With 3 hardware address pins, up to 8 of theses chips can be run for a total of 32 analog outputs.
MCP4728 on Raspberry Pi
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- fcreinhart
- Posts: 1
- Joined: Sat Oct 04, 2014 7:20 pm
MCP4728 on Raspberry Pi
- Attachments
-
- Adafruit_MCP4728.txt
- (1.51 KiB) Downloaded 443 times
Please be positive and constructive with your questions and comments.