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.

DAC53202: DAC configuration is lost / incorrect on one channel leading

Part Number: DAC53202

Im attempting to ensure that I can successfully change the output voltage. My procedure is below:

  • Set the common config to 0x800
  • Set dac0 and dac1 cmp config value (identically set to 0x8000)
  • Set the dac output values

 

All writes are confirmed immediately with a readback to ensure the value has taken affect. Initially I did this with no delay and the value read back correctly.

 

We noticed that dac0 output was working correctly but dac1 output remains at 0v on two identical boards. On interrogating the registers, we noticed that values were not being held. The below screenshot shows the registers before and after the setup I2c instructions which shows that the dac1voutcmpconfig value is not sticking, I also know from testing that the dac1data value is resetting to 0.

 

I implemented some defensive coding to ensure the generalStatus register shows both dac’s as ready for commands as well as a delay before the read to take into account potential resetting time. This screenshot shows the write process I am now using:

 

For additional information, with the defensive coding I have implemented my code now gets stuck in this loop when trying to set the dac value.

 

On picoscope, this results in the following odd behaviour

 

Any light anyone can shed on this behaviour is appreciated. As mentioned before we have tested this and it is identical on two boards, we also have a dev kit on the way to see if its something electronics based but Jack assures me this is unlikely.

  • Hi Jordan, 

    The below isn't right, and you haven't explicitly shown this in the code so I cannot verify if this is what you are actually writing to the device. 

    • Set the common config to 0x800
    • Set dac0 and dac1 cmp config value (identically set to 0x8000)
    • Set the dac output values

    Please try writing the following commands in sequence and checking the outputs

    DAC0_VOUT_CMP_CONFIG (reg 0x15) 0x0800 //set gain = 1.5x, internal reference

    DAC1_VOUT_CMP_CONFIG (reg 0x03) 0x0800 //set gain = 1.5x, internal reference

    DAC0_DATA (reg 0x1C) 0x8000 //set output to midcode

    DAC1_DATA (reg 0x19) 0x8000 //set output to midcode

    COMMON_CONFIG (reg 0x1F) (0x13F9) //enable internal reference and power on VDAC0 & VDAC1

    Best,

    Katlynne Jones 

  • Hi Katlynne, 

    Thanks for your reply, i really appreciate it.

    Apologies i mistyped my common config settings value, i was already using 0x13F9.

    I have modified the init order to your spec. 

    On attempting to set the common config, DAC1 reports itself as busy via the general status register and so my defensive code will not advance. Hopefully this gives another breadcrumb but as a new user of the device i cant understand why the DAC1 channel continuously reports itself as busy whilst nothing else is happening to it.

    This screenshot shows the state of the registers (the missing ones are all set to 0, they wouldn't all fit in one shot)

    Thanks

    Jordan

  • Hi Jordan, 

    Ahh got it. I misunderstood what that screenshot was showing. Why are you setting the DAC_VOUT_CMPR_CONFIG registers to 0x8000?

    I notice the common config register is missing from these results. Can you read back all of the registers and copy/paste the results here? You don't need to screenshot the results. 

    Best,

    Katlynne 

  • Hi Katlynne,

    Thanks for your time on this, i found the issue in my code thanks to your help. I had mixed up eREG_DAC_1_CMP_MODE_CONFIG and 

    eREG_DAC_1_VOUT_CMP_CONFIG in my set function.
    Kind regards, 
    Jordan