Post Go back to editing

CN0540 LSB Range & LSB to Amplitude Peak-to-Peak

Thread Summary

The user is experiencing issues with the AD7768-1 DOUT range appearing as 16-bit instead of 24-bit in raw mode, and with the relationship between the input signal and the LSB peak-to-peak value breaking down at a 7V DC bias. The support engineer confirmed that the 16-bit appearance is due to scaling and suggested using `get_iio_attr` to obtain full 24-bit raw data. The 7V DC bias issue is likely due to the signal exceeding the CN0540's linear input range, causing clipping or saturation, which is not apparent in SI mode due to internal scaling.
AI Generated Content
Category: Software
Product Number: AD7768-1
Software Version: ADI-Kuiper_2021_R2

System setup

  • DAQ: DE10-Nano + CN0540
  • Signal source: Signal generator, 10 kHz sine wave (P10 jumper open)
  • Software/versions: ADI 2021_R2
  • Total_Gain = Level Shifter Inverting Gain × FDA Gain = 0.3 × 2.67 = 0.8
  • Sampling rate: 256,000
  • Sampling length: 16,384
  • Data acquisition methods: IIO Oscilloscope GUI, function rx() in pyadi-iio rx_tx.py (rx_output_type = "raw")

Question 1: About LSB range
The range of raw values from AD7768-1 DOUT is -8,388,608 to +8,388,608 (24-bit).
Therefore, for a 1 Vp-p signal, the expected output data range should be:
1000 mVpp2×0.8÷(40968388608)=±81920021000 mVpp​×0.8÷(83886084096​)=±819200

However, when I input a 1 Vp-p signal, whether using IIO Oscilloscope or rx(), the obtained data range is only within 0 ~ 65,536 (16-bit) fig1-① & fig2. Only the first index of the data output from rx() is in 24-bit format (fig1-②). I believe this represents the deviation of the DC bias in the signal chain relative to Vcom at 2.5 V.
For example:
1441792×(40968388608)÷0.8=0.88 V1441792×(83886084096​)÷0.8=0.88 V
This means the DC voltage in the signal is 2.5 V+0.88 V=3.38 V2.5 V+0.88 V=3.38 V.

fig1

Is this LSB range difference due to scaling? How can I obtain all data as the original 24-bit raw data?


Question 2: Conversion between data amplitude and actual signal amplitude
I used sine wave signals with different DC biases as input to the CN0540, and acquired data with rx_output_type = "raw" (default). The peak-to-peak value of the LSBs (fig2-②) is close to the value of the input signal (fig2-①) , as shown in the figure2 when DC bias = 0 or 5. However, when DC bias = 7, this relationship no longer holds.

A similar question is mentioned in this link, but no conclusion was reached: What are output units IIO oscilloscope CN-0540?

Additionally, the relationship “LSB peak-to-peak × 0.8 ≈ input signal peak-to-peak” seems to hold only when rx_output_type = "SI". How should I interpret this phenomenon?

  • Hi  ,

    Let me check this and I'll get back to you asap.

    Regards,

    Ivan

  • Hi ,

    Thank you for your reply. If you have any suggestions I could try, or any other information for reference, please let me know.

  • Hi sam007,

    Sorry for the delay in replies and happy holidays to you.

    Question 1

    Yes, this is due to the scaling and formatting of the IIO making it look like a 16-bit data. You can see the full 24-bit if you use raw, disable scale, or right-shift the packed data.

    Question 2

    The 0 or 5 bias works because it is still in linear range of the device, however on the 7v it is outside the cn0540 linear input range and it no longer matches the assumed scale.

    "SI" works since it applies channel gain, full-scale assumptions, and internal scaling constants. Which can cause mapping clipped signals into "volts".

    Regards,

    Ivan

  • Hi Ivan,

    No problem at all. Thank you, and happy holidays to you too!

    Question 1
    In fact, I obtained the data under the configuration rx_output_type = "raw" (function rx() in pyadi-iio rx_tx.py), but the data still appears to be 16-bit. Besides this, is there any other place where I can disable scale to obtain raw data?

    Question 2
    In the CN0540 documentation, it is mentioned that the DC offset in the signal can be up to 13 V, so I used a 7 V DC offset for verification. At the same time, I was still using rx_output_type = "raw" and did not use rx_output_type = "SI", yet the data seems to be obtained through "SI". I don’t quite understand why this issue occurs.

    Best regards,

    Sam007

  • Hi  ,

    For reading the raw code, have you tried using get_iio_attr in getting the raw code of the device? 

    For the second question, what is your current setup for this? Where are you inputting the 7v? Are you using an IEPE sensor or is it directly to the cn0540?

    Regards,

    Ivan

  • Hi Ivan,

    Thank you for your reply.

    I will try to use get_iio_attr in getting the raw code of the device.
    For the second question, I used a signal generator to produce a sine wave with a 7V DC bias, removed the P10 jumper, and connected it directly to the CN0540, Could this cause any issues?

    Best regards,

    Sam007

  • Hi Sam007,

    I just want to confirm that the setup is correct. Typically, we use an IEPE sensor connected to the CN0540 with the P10 jumper installed to enable the internal current source. That said, your configuration should still be workable since you are using a signal generator with a manually applied 7 V DC bias and disconnected the P10 by removing the jumper.

    To double-check, are the CN0540 and the signal generator sharing a common ground? If the grounds are not common, this can lead to asymmetric waveforms, offsets, or other measurement artifacts.

    Another potential issue is that the 7 V DC bias may be pushing the analog front end outside its linear operating range. When combined with the selected channel gain (0.8), the effective input signal—including both the DC offset and AC swing—may be approaching or exceeding the ADC’s usable input range, which can result in clipping or saturation.

    This could also explain why the signal appears correct when viewed in SI mode but not in raw mode. SI mode applies internal scaling constants, channel gain, and full-scale assumptions, whereas the raw output reflects uncalibrated ADC codes and will more clearly show saturation effects.

    At this point, I recommend reducing the gain and reviewing the AD7768 datasheet used on the CN0540, particularly the full-scale input voltage and input range specifications.

    Regards,
    Ivan

  • Hi Ivan,
    The CN0540 and the signal generator share a common ground. All of my data was acquired in RAW mode, but it appears to be from SI mode, which is my main source of confusion. 
    Anyway, thank you for the information and suggestions you provided above. I will follow them to try to determine the possible cause.
    Best regards,
    Sam007

  • Hi  , 

    Please let us know if you need further assistance or have any updates on this issue.

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.