The MCP4725 is a 12 bit digital to analog converter and can be powered from 2.7 to 5.5 volts. Datasheet link.

It is very simple to use. It has a 7 bit addressing scheme with a 3 bits that are variable and called A0, A1 and A2. A2 and A1 are chosen at the order process and are selected by selecting part numbers. A0 is broken out to a pin and is to be tied either to GND or to VDD. On the adafruit board it is pulled low and also broken out.

The ID of the standard chip with A0 pulled low. is 0x62. 0x62 is the first 7 bits of the first byte we send out, which comes out to 0b1100010. When we tack on the R/W bit as the LSBit this comes to:

0b11000100 or 0xC4 for Write
0b11000101 or 0xC5 for Read

Writes to set the output of this chip are done as a 12bit values which range from 0x000 which is 0 to 0xFFF which is VDD - 1LSB.

This chip has a bunch of fancy features such as power down modes for low power and EEPROM to store output values. We don't need to use any of this stuff and just want to use the fast mode and 0 for the power down vales. This makes the chip behave just as we want it, output an analog signal when we tell it to!

To do this, write the following:

0xC4, 0x0P 0xQR 

PQR are is the hex value from 0x000 to 0xFFF of the analog output we want.

To do this in the bust pirate, just set the thing up in I2C, turn on the 5 volt rail (its OK to do this, the device will talk to the chip just fine) and send out the following:

[0xC4 0x0P 0xQR]

with PQR the number we want to send out.

  • mcp472.txt
  • Last modified: 2019/03/31 14:50
  • (external edit)