class spirack.D5a_module(spi_rack, module, reset_voltages=True, num_dacs=16)
D5a module interface class. This class does the low level interfacing with the D5a module. When creating an instance it requires a SPI_rack class passed as a parameter. The analog span of the DAC module can be set via software for each of the 16 DACs individually.
Setting the voltage can happen via the set_voltage function. Other ways are the change_value_update function, which immediately updates the output of the DAC, or via the change_value function. This function writes the new value to the DAC but does not update the output until the update function is ran.
Parameters:
range_4V_bi
. If a voltage jump would occur, then ramp to zero in steps of 10 mV. Defaults to True.set_voltage(DAC, voltage)
Sets the DAC output voltage and updates the DAC output. The function calculates the DAC value for the given voltage at the currently set DAC span. It will set to max/min when the input voltage exceeds the span and prints out a warning to the user. There will always be a difference between the wanted voltage and the output voltage as long as it is not a multiple of the step size. The calculated value is floored, not rounded.
Parameters:
get_stepsize(DAC)
Returns the smallest voltage step for a given DAC. The function calculates and returns the smallest voltage step of the DAC for the set span. Voltage steps smaller than this will not change the DAC value. It is recommended to only step the DAC in multiples of this value, as otherwise steps might not behave as expected.
Parameters:
Returns - smallest voltage step possible with the DAC in its current setting (float)
get_settings(DAC)
Reads current DAC settings. This function reads back the DAC registers of the given DAC for both the code and the span. It calculates the voltage set with the read out span.
Parameters:
Returns - list with voltage (float) and span (int): [voltages, span]
change_span_update(DAC, span)
Changes the span of the DAC and immediately updates the output of the DAC. Use the constants listed below as argument for the span.
Parameters:
change_span(DAC, span)
Changes the span of the DAC without updating the output of the DAC. Only updates when update(DAC)
is called. Use the constants listed below as argument for the span.
Parameters:
change_value_update(DAC, value)
Changes the DAC value, where value
is an 18-bit integer. Calling this function changes the value of the DAC and immediately updates the output.
Parameters:
change_value(DAC, value)
Changes the DAC value, where value
is an 18-bit integer. Calling this function changes the value of the DAC, but does not update the output until the update(DAC)
function is called.
Parameters:
update(DAC)
Updates the output of the DAC to the set range or output value. This is necessary after using change_value
or change_span
. These functions write into a double buffer inside the chip, when this function is called it will be put into the output buffer.
Parameters:
Attribute | Info |
---|---|
module |
the module number set by the user (must coincide with hardware) |
span |
a list of values of the span for each DAC in the module |
voltages |
a list of DAC voltage settings last written to the DACs |
Constants |
---|
range_4V_uni |
range_4V_bi |
range_8V_uni |
range_8V_bi |
range_2V_bi |