This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS1258EVM + DAC controlled Vref

Other Parts Discussed in Thread: DAC8571, OPA301, MSP430F5529

Dear Chris,

First of all, I would like to wish you a Happy new year and thank you for your support in 2014! :) Don't worry I will have many more question in 2015. 

I am using ADS1258EVM without MMB0 based on the wiki guide that you shared. It works very well, thank you for the nice work. Right now, the Vref switches are in left position (0V-5V) but I would like to control the Vref via DAC. Before I start this work, I have some questions:

- Is it possible to fully control ADS Vref with DAC8571 through pins located on J6A?

- Do you have any recommendation for the I2C implementation? Address: 1001100 | Set S1 and S2 to Center position 

- On the EVM guide: "The output of the DAC is multiplied by two, giving a range of approx. 0V to 5V." Could you explain this behavior ?

Thank you in advance,

  • Hi Daniel,

    Happy New Year to you as well! I'll do my best to answer your questions in 2015.

    Daniel Vamos said:
    Is it possible to fully control ADS Vref with DAC8571 through pins located on J6A?

    Yes, SCL is accessible on J6A.16. SDA is accessible on J6A.20.

    Daniel Vamos said:
    Do you have any recommendation for the I2C implementation? Address: 1001100 | Set S1 and S2 to Center position 

    It has been a little while since I've used I2C myself. Nothing too particular stands out to me as being unique to the I2C implementation on the DAC8571. The DAC8571 datasheet should explain the device operation. I suppose it's worth noting that the DAC8571 is double buffered, meaning you'll have to send at least two commands:

      1. Write data to the temporary buffer (1st buffer, the output will remain unchanged).
      2. Update the DAC buffer (2nd buffer) to set the output voltage.

    Regarding switching the ADC reference on-the-fly, I don't usually see a need to do so in most applications. Usually a set input range with a 24-bit ADC is sufficient to achieve a wide-enough dynamic range. When you change the reference voltage, consider the following:

      1. You may want to recalibrate  the offset & gain calibration.
      2. Take care to correctly scale the ADC output code as the reference changes.
      3. I would also recommend restarting the ADC conversion, or ignoring the next result after switching the reference voltage.

    Daniel Vamos said:
    - On the EVM guide: "The output of the DAC is multiplied by two, giving a range of approx. 0V to 5V." Could you explain this behavior ?

    Take a look at the schematic near the end of the EVM guide. The DAC output goes to an OPA301 configured in a non-inverting gain of 2. Since the DAC reference is only 2.5V, the OPA301 allows reference voltages larger than 2.5V (up to 4.9V).

    Good questions! I decided to add these details to the FAQ section:

    Best Regards,
    Chris

  • Hello,

    Just a small detail I thought I might add - probably insignificant in the grand scheme of things but...

    Christopher Hall said:

    It has been a little while since I've used I2C myself. Nothing too particular stands out to me as being unique to the I2C implementation on the DAC8571. The DAC8571 datasheet should explain the device operation. I suppose it's worth noting that the DAC8571 is double buffered, meaning you'll have to send at least two commands:

      1. Write data to the temporary buffer (1st buffer, the output will remain unchanged).
      2. Update the DAC buffer (2nd buffer) to set the output voltage.

    All together 4 bytes are written to the device when loading new data; address byte, control byte, most significant byte, and least significant byte. The data in the control byte allows different update modes to be selected - one of the update modes latches the temporary data register and DAC data registers (both "buffers" in the double-buffered structure) with the data contained in the most significant byte and least significant byte of the transaction.

  • Dear Chris,
    One more question, shoul I apply additional external pullups on i2c bus if I am using evm without mmb0?
  • Hi Daniel,

    Yes! The stand-alone EVM does not have pullup resistors on SDA & SCL (the MMB0 was supplying the pullups resistors).

    You may not actually need to add any resistors though...
    If I recall correctly, you're using the MSP430F5529. Therefore, you can enable the MSP430's internal GPIO pull-up resistor on SDA, when configured as an input (see PxREN and PxOUT). SCL shouldn't need the pullup resistor, as it will always be configured as an output that you control.

    Best Regards,
    Chris

  • Hello Chris,

    Yes, I am using F5529. I have run into a bit trouble with I2C :( It is the first time when I am using I2C so sorry for new newbie questions.

    I have connected the MSP430F5529 P3.1 to EVM SCL and P3.0 to EVM SDA.  I am using the example shipped with DriverLib called: usci_b_i2c_ex3_masterTxSingle. Here is the following code: 

    #include "driverlib.h"
    
    #define SLAVE_ADDRESS 0x4C  // User modification 1
    
    uint8_t transmitData;
    
    void main(void)
    {
        //Stop WDT
        WDT_A_hold(WDT_A_BASE);
    
        //Assign I2C pins to USCI_B0
        GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,GPIO_PIN0 + GPIO_PIN1); // User modification 2
    
        //Initialize transmit data packet
        transmitData = 0x01;
    
        //Initialize Master
        USCI_B_I2C_initMasterParam param = {0};
        param.selectClockSource = USCI_B_I2C_CLOCKSOURCE_SMCLK;
        param.i2cClk = UCS_getSMCLK();
        param.dataRate = USCI_B_I2C_SET_DATA_RATE_100KBPS;
        USCI_B_I2C_initMaster(USCI_B0_BASE, &param);
    
        //Specify slave address
        USCI_B_I2C_setSlaveAddress(USCI_B0_BASE,SLAVE_ADDRESS);
    
        //Set in transmit mode
        USCI_B_I2C_setMode(USCI_B0_BASE,USCI_B_I2C_TRANSMIT_MODE);
    
        //Enable I2C Module to start operations
        USCI_B_I2C_enable(USCI_B0_BASE);
    
        //Enable TX interrupt
        USCI_B_I2C_clearInterruptFlag(USCI_B0_BASE,USCI_B_I2C_TRANSMIT_INTERRUPT);
        USCI_B_I2C_enableInterrupt(USCI_B0_BASE,USCI_B_I2C_TRANSMIT_INTERRUPT);
    
        while(1)
        {
            //Send single byte data.
            USCI_B_I2C_masterSendSingleByte(USCI_B0_BASE,transmitData);
    
            //Delay until transmission completes
            while(USCI_B_I2C_isBusBusy(USCI_B0_BASE))
            {
                ;
            }
    
            //Delay between each transaction
            __delay_cycles(50);
    
            //Increment transmit data counter
            transmitData++;
        }
    }
    
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector=USCI_B0_VECTOR
    __interrupt
    #elif defined(__GNUC__)
    __attribute__((interrupt(USCI_B0_VECTOR)))
    #endif
    void USCI_B0_ISR(void)
    {
        switch(__even_in_range(UCB0IV,12))
        {
        //Vector 12: Transmit buffer empty - TXIF
        case USCI_I2C_UCTXIFG:
        {
            __no_operation();
            break;
        }
        default:  break;
        }
    }
    

    I have modified the above code only 2 times as I marked.  Here is the Saleae result:

    I am in trouble. The Clock does not seems so good but I dont know why.

    I have mentioned my problem in this link but I think you can only help :) 

    I think the problem should be here: 

    GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,GPIO_PIN0 + GPIO_PIN1);

    But when I replace it to these:

    GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,GPIO_PIN0);
    GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P3,GPIO_PIN1);

    The outcome is worst...

    Any idea?

    UPDATE: I set the DAC address value, then I can read ACK after my messages.

  • Hi Daniel,

    No problem! Let me dig deeper into this on Monday... I have some hardware that I can try this out on.

    Currently, are using pull-up resistors?

    Best Regards,
    Chris
  • Hello,

    Thank you for your effort in advance. I am looking forward any outcome!

    Anyway, I have applied two 4.3K resistors on the I2C wires.

    It seems working very well. 


    Have a nice weekend!

  • Hi Daniel,

    Great job beating me to the answer!

    It turns out I was mistaken in one of my previous posts, the external pullup resistors are required. The internal pullups only work in GPIO mode. See the following thread for more details on this:  

    I was able to add pullup resistors to the ADS1258EVM and run your code, the only change I made was to the I2C address:

    #define SLAVE_ADDRESS 0x4C

    Best Regards,
    Chris