Jump to content
  • 0

How do I use the user calibration feature on the DDR streaming example project of Eclypse Z7 + Zmod Scope?


HKO

Question

Hello,

I am using a Eclypse Z7 and Zmod Scope 1410-105 module. I started from a DDR Streaming example project. (https://digilent.com/reference/programmable-logic/eclypse-z7/demos/eclypse_platform_manual)

I am trying to configure the user calibration values to modify gain and offset of the ADC signal.

I tried to modify the values on Vitis, by modifying the values of 'ZmodScope_CalibrationCoefficients factory' directly (factory.Channel1_HighGainAdditive = something, like this) and by using the function ZmodScope_SetCalibrationCoefficients. But it doesn't work. And I am not sure if I should add a module to send the extcalib values on Vivado.

I think I am missing something here. Could you explain how it works and how it should be modified properly?

Thank you in advance.

HKO

Edited by HKO
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hey @HKO,

To describe what's going on in the project:

There are two sets of calibration coefficients stored in the Zmod Scope's SYZYGY DNA, which is an EEPROM connected to one of the Zynq's PS I2C controllers. One set is the "factory calibration", which should not be modified. The other set is the "user calibration", which is intended as a memory region that you can potentially use to store your own constants (more on this later).

The Vivado project for the demo makes use of the Zmod Scope Controller IP, which implements some simple DSP in FPGA fabric to apply offset and gain constants to incoming data. There's an AXI interface that lets you send the coefficients to the controller, a "Zmod Scope AXI Configuration" IP in the block design, controlled through the zmod_scope_axi_configuration header and source file in the software project. The controller accepts two sets of constants for each channel, one for high gain operation and one for low gain, and it picks which to use based on relay settings that it also controls. You still have to pick whether to send it the factory or user calibration though.

Both sets of calibration constants are read from the DNA EEPROM as the demo initializes, through a call to ZmodScope_ReadCoefficientsFromDna in main. The demo then sends the factory coefficients to the controller using ZmodScopeSetCalibrationCoefficients. If you wanted to modify the coefficients sent to the controller, you could do it here by modifying the values stored in the "factory" struct. You could also modify the demo to send the user coefficients, as read out of the DNA, to the controller instead, by sending the _unused_ struct to SetCalibrationCoefficients instead of the factory struct. This wouldn't do much without changing the values programmed into the DNA EEPROM though.

The format of the coefficients needed by the hardware is described in the calibration section of the Zmod Scope Controller User Guide: https://github.com/Digilent/vivado-library/blob/c50140429a5206ce4aaf2e96adc9f37f575732ce/ip/Zmods/ZmodScopeController/docs/ZmodScopeController.pdf (pages 8 and 9). The format is pretty specific, if I recall correctly, the DNA EEPROM stores data in floating point form, while the controller requires an 18-bit twos-complement fractional format.

Digilent doesn't provide a demo project that changes the values stored in the DNA EEPROM's user calibration section, but you can find some commentary on how you might do it in the Calibration Memory section (3.2) of the Zmod Scope Reference Manual: https://digilent.com/reference/zmod/scope/reference-manual#calibration_memory.

8 hours ago, HKO said:

I tried to modify the values on Vitis, by modifying the values of 'ZmodScope_CalibrationCoefficients factory' directly (factory.Channel1_HighGainAdditive = something, like this) and by using the function ZmodScope_SetCalibrationCoefficients. But it doesn't work. And I am not sure if I should add a module to send the extcalib values on Vivado.

What specifically did you try and what didn't work for you? Hazarding a guess, as mentioned with the specificity of the format of the coefficients, changing the factory cal by, for example, directly multiplying by floating point 1.5 is unlikely to work without paying careful attention to data types and formats. I would consider doing the modification to the factory calibration values before the conversion to signed 18-bit fractional occurs in the FZmodADCCalConvertToS18 calls, in the ZmodScope_ReadCoefficientsFromDna function.

Depending on your end goal, you could also postprocess acquired data in the Zynq PS, or back on a PC.

Hope this helps,

Arthur

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...