Closed wvlothuizen closed 2 years ago
Apart from the driver fixes referred to above, the CC doesn't return the 'boolean' success in get_calibrate_dio_success()
, but instead returns a status word consisting of the following flags (taken from CCCore.py):
# stat_ques_diocal : DIO timing calibration status (CCIO only)
SQD_NO_SIGNAL = 0x0001
SQD_INSUF_TIMING_MARGIN = 0x0002
SQD_BITS_INACTIVE = 0x0004
SQD_NOT_CALIBRATED = 0x0008
SQD_TIMING_ERROR = 0x0010
_cc_stat_ques_diocal_lookup = [
(SQD_NO_SIGNAL, "No signal detected during DIO timing calibration"),
(SQD_INSUF_TIMING_MARGIN, "Insufficient timing margin during DIO timing calibration"),
(SQD_BITS_INACTIVE, "Required bits were inactive during DIO timing calibration"),
(SQD_NOT_CALIBRATED, "DIO timing calibration not yet performed (successfully)"),
(SQD_TIMING_ERROR, "Runtime DIO timing violation found")
]
This is the same result as provided by get_status_questionable_instrument_idetail_diocal()
, which is meant to return the flags.
@martinr-zi
get_calibrate_dio_read_index()
indeed returns -1 when invalid
So, with the current CC implementation get_calibrate_dio_success()
should read get_calibrate_dio_status()
During debugging by ZI, it appeared that the following functions in CCCore.py are broken:
get_calibrate_dio_success()
get_calibrate_dio_read_index()
They ignore the
ccio
parameter, and when that's fixed, give erroneous results. The previous method of usingdebug_get_ccio_reg()
does seem to work correctly (but the register indices may change with firmware versions)