Shop OBEX P1 Docs P2 Docs Learn Events
controll a DAC — Parallax Forums

controll a DAC

jaspittmanjaspittman Posts: 22
edited 2009-06-16 14:04 in BASIC Stamp
i need to output a continuous analog voltage. i am using a MAX5354 digital to analog converter. i have tried outputting a voltage with this program

voltage=512

LOW CS
SHIFTOUT DIN, SCLK, MSBFIRST, [noparse][[/noparse]voltage/16]
HIGH CS

but it doesn't work.

it outputs 5 volts instead of 2.5 (vref X 512/1024)

Comments

  • jaspittmanjaspittman Posts: 22
    edited 2009-06-16 14:04
    I think i figured out the problem. i had the DAC address wrong

    dacaddr = $2000

    voltage=512+dacaddr

    LOW CS
    SHIFTOUT DIN, SCLK, MSBFIRST, [noparse][[/noparse]voltage/16]
    HIGH CS

    I think this correct.·I will check tonight.
Sign In or Register to comment.