analogdevicesinc / libsmu

Software abstractions for the analog signal exploration tools.
http://analogdevicesinc.github.io/libsmu/
BSD 3-Clause "New" or "Revised" License
31 stars 31 forks source link

Deafult 2V on output when setting SVMI mode after power up #186

Open jmball opened 3 years ago

jmball commented 3 years ago

I've noticed that when the device (Rev F) is first powered on, setting the channel mode to SVMI puts 2V across the channel output. This means if I want to do a DC measurement using the following:

import pysmu

s = pysmu.Session()
s.devices[0].channels["A"].write([1])
s.devices[0].channels["A"].mode = pysmu.Mode.SVMI
s.run(10)
print(s.read(10))

the device under test gets a blast of 2V when the mode changes to SVMI before the output changes during the measurement. Putting a scope on the output when I run this program shows the 2V stays active for ~18 ms, before changing to the requested 1V.

2V_scope

As far as I can tell, it's necessary to set the channel mode before triggering a measurement so this seems to be unavoidable, which is potentially damaging to some devices. I was expecting the default output on power up to be 0V to prevent the risk of damaging the device under test.

Setting the mode back to SVMI puts the output to the last measured voltage, as expected.

Is there a software solution to guarantee that the default output voltage is 0V when setting SVMI mode after power up? Or is there a way to re-order the commands that I've missed such that the 2V never shows up unless requested?

jmball commented 3 years ago

It looks like this is happening because the default DAC setting in firmware is 26600 (~2V), https://github.com/analogdevicesinc/m1k-fw/blob/a23df497be7125dd7585d8ad3628cfcaf05cd5ed/src/main.c#L18. Changing it to 0 means that required activation of SVMI mode before the read leaves the output at 0V.