element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • 'Choose another store...'
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs DAC8775 Quad-Channel DAC EVM - part 4: Current Mode
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 23 Jul 2018 1:56 PM Date Created
  • Views 1499 views
  • Likes 12 likes
  • Comments 16 comments
  • dac
  • spi
  • dac8775
  • texas_instruments
  • hercules
  • ti_rt
Related
Recommended

DAC8775 Quad-Channel DAC EVM - part 4: Current Mode

Jan Cumps
Jan Cumps
23 Jul 2018

In this post, I program the current mode of the DAC8775, the subject of the Quad-Channel, Analog Output Module RoadTest.

image

The DAC will, within limits, try to source the current you're defining

 

 

Configurable Current

 

Additional to the traditional voltage mode, this DAC can source current. It has a number of ranges that can be controlled:

image

 

image

In this exercise I'm setting the mode to 0101: 0 - 20 mA.

 

In code:

 

    TX_Data_Master[0] = 0x04;
    TX_Data_Master[1] = 0x10; // output on, default slew rate
    TX_Data_Master[2] = 0x05; // slew rate off, 0 - 20 mA mode
    /* Initiate SPI3 Transmit and Receive through Polling Mode */
    spiTransmitAndReceiveData(spiREG3, &dataconfig1_t, 3, TX_Data_Master, RX_Data_Master);

 

I've used the EEVBlog µCurrent to measure the current. I've wired it straight over the outputs. The DAC has the duty to generate the requested current for the µCurrent's shunt.

It has headroom of +15 to -15 V to do this, because that's the range I've set the DAC's internal Buck-Boosters at.

image

In the photo at the top of the article, I'm pushing 20 mA, and have set the µCurrent to mA mode. It uses a 0R01 shunt in that case.

The µCurrent outputs 1 mV per mA of current in that mode and my multimeter reads 19 mA. We're in the ballpark.

Note: my DMM, a Brymen BM235, doesn't have a lower voltage range. All measurements are within the specs of meter, µCurrent and DAC.

 

The code to generate 20 mA:

 

    TX_Data_Master[0] = 0x05;
    TX_Data_Master[1] = 0xff;
    TX_Data_Master[2] = 0xff;
    /* Initiate SPI3 Transmit and Receive through Polling Mode */
    spiTransmitAndReceiveData(spiREG3, &dataconfig1_t, 3, TX_Data_Master, RX_Data_Master);

 

For these current levels, you don't need a µCurrent. Most DMMs have a low enough Burden voltage (internal shunt) to deal with that.

Once we're in the lower bit range of the DAC, the µCurrent shows it value.

 

0xffff is 20 mA. If we divide the value by 1024, we get 0x003f, and the output should be 19.53125 µA.

 

    TX_Data_Master[0] = 0x05;
    TX_Data_Master[1] = 0x00;
    TX_Data_Master[2] = 0x3f;
    /* Initiate SPI3 Transmit and Receive through Polling Mode */
    spiTransmitAndReceiveData(spiREG3, &dataconfig1_t, 3, TX_Data_Master, RX_Data_Master);

 

With the µCurent in µA mode (shunt is 10R), I measure 18 µA. Again close.

 

image

 

Related Blog
DAC8775 Quad-Channel DAC EVM - unlicensed roadtest part 1: Raw SPI
DAC8775 Quad-Channel DAC EVM - part 2: Firmware
DAC8775 Quad-Channel DAC EVM - part 3: Slew Rate Control
DAC8775 Quad-Channel DAC EVM - part 4: Current Mode
DAC8775 Quad-Channel DAC EVM - part 5: HART Interface
  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 5 years ago +4
    Hi Jan, Posting about this type of experiment is very interesting and important for the forum. I always learn some new things from your blogs. What do the Stars know? John
  • michaelkellett
    michaelkellett over 5 years ago +4
    I've just bumped up the user rating - not that I pay them any attention. This is the kind of stuff we want to see - I wish I had more time to do some more of my own. I've not encountered HART before -…
  • snidhi
    snidhi over 5 years ago +3
    Hi Jan, You are doing great work. I am following your blog very closely. I myself wanted to dive in the unique world of ADCs and DACs. By following your measurement techniques I kind of am getting the…
  • Jan Cumps
    Jan Cumps over 5 years ago

    The HART experiment is finished. It works image.

    DAC8775 Quad-Channel DAC EVM - part 5: HART Interface

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago in reply to Jan Cumps

    They should get rid of the stars. I think they are worthless.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 5 years ago in reply to Jan Cumps

    Here's a capture

    image

     

    The yellow trace is the HART signal (0.5 Vp, 1200 Hz) that I present to the HART pin via a capacitor.

    The blue trace is the AC component modulated on the DACs 10 mA current. 1 mV represents 1 mA.

    Forgive the noise on signal 2. The low current measure / probe capabilities in my lab are mediocre. The most important thing is that I can make the HART current visible.

     

    Here's a capture with the DC component of the DAC's output current visible:

    image

     

    Code change:

     

        TX_Data_Master[0] = 0x04;
        TX_Data_Master[1] = 0x30; // output on, default slew rate with HART
        TX_Data_Master[2] = 0x05; // slew rate off, 0 - 20 mA mode
        /* Initiate SPI3 Transmit and Receive through Polling Mode */
        spiTransmitAndReceiveData(spiREG3, &dataconfig1_t, 3, TX_Data_Master, RX_Data_Master);

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 5 years ago in reply to Jan Cumps

    I finally got the board working with the HART pin broken out. I'll now update the firmware and do a first test ...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 5 years ago in reply to Jan Cumps

    I put the capacitor back. It still didn't work, so it was "something else". I feared for a moment that I destroyed the board.

     

    Luckily, it turned out that it was one of the bodge wires on the break-out board that came loose. The circuit is ok and I can start over.

     

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube