CURRENT ISSUE
Contests
Feature Article
|
|
Issue #213 April 2008
Programmable Power
Build a Simple USB DAC
by Yoshiyasu Takefuji
Start | USB Communications | Firmware | MAX517 (DAC) Programming | Firmware, Software, & LIBUSB | Host Device Driver Installation | Testing | Sources & PDF
MAX517 (DAC) PROGRAMMING
The MAX517 is an 8-bit DAC where two-wire programming is needed to set analog OUT0. Three bytes (slave address byte, command byte, and output byte) must be sent to the MAX517 to set the analog output (see Figure 3).
![]() |
| Figure 3 —This is a MAX517 8-bit DAC programming timing chart. |
As you can see in Figure 1, AD1=AD0=1 makes the slave address byte 01011110. The command byte becomes 00000000. The output byte is given by “data[2]” with a range of 0 to 255 in the usbFunctionSetup function in the firmware, which is equivalent to the value of the parameter “i” in the usb_control_msg function in the host program.
Analog output can be determined by: ![]()
In Figure 1, the Ref0 pin is connected to 5 V and the DAC resolution is 0.0195 V. Therefore, the analog output should be between 0 and 4.98 V. Figure 4 is a simplified DAC diagram.
![]() |
| Figure 4 —This is a simplified DAC diagram of a MAX517. |
|

