Shop OBEX P1 Docs P2 Docs Learn Events
DAC7612 Digital to Analog converter, only 11 bit resolution — Parallax Forums

DAC7612 Digital to Analog converter, only 11 bit resolution

K de JongK de Jong Posts: 154
edited 2004-10-25 00:11 in BASIC Stamp
Hi all,

I have built a prototype with the DAC7612 DA converter.

The datasheet specifies 12 bit resolution, =4096 steps from 0 to 4.095 Volts (1 mVolt each). But I only get out 2048 steps = 2 mVolt for each step.

Below is the routine I use. I have to devide my variable OutDAC by two because of the resolution problem.

WriteDAC:
HIGH LOADDACS
LOW CSDAC
SHIFTOUT Dout,Sclk,MSBFIRST,[noparse][[/noparse]ChDAC\2,(OutDAC/2)\11]
HIGH CSDAC
LOW LOADDACS
RETURN

Also a graph of the DAC output versus time is atached.

Does anybody have a good idea where to find the missing bit ??

Thanks in advance,

Klaus
988 x 484 - 78K

Comments

  • NewzedNewzed Posts: 2,503
    edited 2004-10-25 00:11
    Klaus, try writing:

    SHIFTOUT Dout,Sclk,MSBFIRST,[noparse][[/noparse]ChDAC\2,(OutDAC/2)\12]

    Sid
  • K de JongK de Jong Posts: 154
    edited 2004-10-25 00:11
    And this code goes first, Of course smile.gif)))))))))).

    OutDAC VAR Word
    ChDAC VAR Nib
    OutDAC=0
    ChDAC=2

    DO
    IF OutDAC>4095 THEN OutDAC=0
    OutDAC=OutDAC+2
    ChDAC=2
    IF OutDAC>4095 THEN OutDAC=0
    OutDAC=OutDAC+2

    ChDAC=2
    GOSUB WriteDAC

    ChDAC=3
    OutDAC=OutDAC-500
    GOSUB WriteDAC
    OutDAC=OutDAC+500

    PAUSE 200
    DEBUG CR,DEC OutDAC

    LOOP

    Klaus
Sign In or Register to comment.