AD7391 digital to analog converter


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2004
    Posts
    24

    Default AD7391 digital to analog converter

    Am trying to interface a 16F84 to the AD7391 DAC, but with limited success. I have wired the DAC for unipolar output mode, with a 2.5V reference voltage and I am getting irratic output voltage. Can anyone see where I'm going wrong? Thanks

    ' AD7391 10-bit DAC evaluation programme

    TRISB=0 'portb outputs

    DEFINE SHIFT_PAUSEUS 100

    'AD7390 pins
    sdi var portb.0 ' data pin
    clk var portb.1 ' clock pin
    ld var portb.2 ' load strobe
    clr var portb.3 ' clear

    led var portb.4 'indicator led

    volt var word ' required voltage
    v1 var volt.highbyte
    v2 var volt.lowbyte

    low clr
    pause 1
    high clk
    pause 1
    high ld

    pause 1000
    high clr

    main: volt=0 'set voltage to zero
    gosub AD7390
    volt=205 'set voltage to 0.5V
    gosub AD7390
    volt=410 'set voltage to 1.0V
    gosub AD7390
    volt=615 'set voltage to 1.5V
    gosub AD7390
    volt=820 'set voltage to 2.0V
    gosub AD7390

    goto main

    AD7390: freqout led,500,1000
    high ld
    pause 10
    shiftout sdi,clk,5,[volt] 'msb first, clk idles high
    pause 10
    low ld
    pause 5000
    return

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i can't really check the datasheet here but, if the DAC is a 10 bit, what aboout using
    Code:
    shiftout sdi,clk,5,[volt\10] 'msb first, clk idles high
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Jun 2004
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    If only it were that simple Steve. Have tried sending the 10 bit data and still the same results. The data sheet does say that if 16 bits are sent, the first 6 bits are ignore, but thanks for the reply.

  4. #4
    Join Date
    Aug 2005
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    Unfortunately the Dac doesn't allow you to shiftin data to test whether the shiftin/out commands work with the ic.I have found the commands work with eeproms but not always with other ic's.Therefore you must write your own.Attached is an example for a Max 1270 A/D.

  5. #5
    Join Date
    Aug 2005
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    Heres that attachment.

  6. #6
    Join Date
    Aug 2005
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    One more time .I just put VB6 on my pc and it hijacked my extensions.
    Attached Files Attached Files

  7. #7
    Join Date
    Jun 2004
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    Thanks arniepj. Will give it a try and let you now how I get on

Similar Threads

  1. analog and digital
    By lerameur in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th June 2008, 02:40
  2. PortA analog and digital IO
    By krohtech in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th November 2007, 02:25
  3. Digital to Analog Converter
    By kutsi in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 27th June 2007, 19:17
  4. Replies: 2
    Last Post: - 14th April 2006, 09:42
  5. Analog pins for digital input
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th September 2005, 00:32

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts