This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AFE7900: Regarding the compensation of phase imbalance between channels of AFE7900

Part Number: AFE7900

Tool/software:

Hello support team,

We have designed a custom AFE7900 board with identical front end chain for each individual ADC channels ( Channel A, Channel B, Channel C, Channel D). Each channel is having frequency range of 35-60 MHz. all channels are having identical transmission line lengths and lumped components. 

I am capturing IQ digital data for each channels with ZCU102 FPGA board. from the captured digital IQ data, I have calculated the relative phase difference between channel A and B, Channel A and C, channel A and D, channel B and C. 

from the calculations, I found out that the there is some fixed phase difference delay as below 

When I am providing same identical RF inputs to channel A, channel B, Channel C, and Channel D with 0 deg phase difference from function generator. below is what I am getting from the captured IQ through calculations of inverse tan of (Q/I) and phase difference of channel A inverse tan of (Q/I) - Channel B inverse tan of (Q/I).

35 MHz = channel A - channel B = 2.3 deg 

45 MHz = channel A - channel B = 5 deg 

60 MHz = channel A - channel B = 7.7 deg 

-----------------------------------------------------------

35 MHz = channel A - channel C = 2.8 deg

45 MHz = channel A - channel C =  5.2 deg 

60 MHz = channel A - channel C = 8 deg 

----------------------------------------------------------

35 MHz = channel A - channel D = 2 deg

45 MHz = channel A - channel D =  3.8 deg 

60 MHz = channel A - channel D = 5.5 deg 

-----------------------------------------------------------

35 MHz = channel B - channel C = 0.4 deg

45 MHz = channel B - channel C =   0.8 deg 

60 MHz = channel B - channel C =  2 deg 

-----------------------------------------------------------

what could be the reason of this fixed phase difference variation when I am providing identical RF inputs with 0 deg phase difference? (as we have done proper length matching as well for the JESD serdes lines and all 4 input RF channels are identical in terms of transmission line length and components). and Is there any way inside AFE7900 to compensate for phase difference ?

Kindly request you to provide guidance for this. This is important for us as we are measuring relative phase from the captured IQ digital data. 

  • Hello support team,

    Is there any update on the above raised query!

  • Hi Maitry,

    Some phase difference is expected due to routing differences on both the PCB and substrate. This fixed phase difference can be compensated inside the AFE by shifting the phase of the NCO. To do this you can reference the two functions below.

    def RxPhaseOffset(rxch,phaseOff):		
    	phaseNum=int(phaseOff/(360./2**16))
    	device.closeLastPageSel()
    	device.writeReg(0x12,rxch)
    	device.writeReg(0xE1,(phaseNum>>8)&0xFF)
    	device.writeReg(0xE0,phaseNum&0xFF)
    	device.writeReg(0x12,0x0)
    
    def TxPhaseOffset(txch,phaseOff):
    	phaseNum=int(phaseOff/(360./2**16)) #The phase offset is phaseNum*(360/2^16) degrees
    	device.closeLastPageSel()
    	device.writeReg(0x19,txch<<4) # Open the TX TOP for the desired channels 
    	if sysParams.ncoFreqMode == '1KHz':
    		device.writeReg(0x111,(phaseNum>>8)&0xFF) #Upper 8 bits of phaseNum
    		device.writeReg(0x110,phaseNum&0xFF) #Lower 8 bits of phaseNum
    	elif sysParams.ncoFreqMode == 'FCW':
    		device.writeReg(0x391,(phaseNum>>8)&0xFF) #Upper 8 bits of phaseNum
    		device.writeReg(0x390,phaseNum&0xFF) #Lower 8 bits of phaseNum
    	device.writeReg(0x19,0x0) #Closing page

    Regards,

    David Chaparro 

  • Hello David, 

    Thank you for your response. 

    What I understand from you above given functions as below. 

    • Converting a phase (in degrees) to a 16-bit hardware representation.

    • Selecting the receiver channel.

    • Writing the phase value to specific hardware registers.

    • Deselecting the channel for safety/reset.

    I need to modify LMKConfig.py file and add this at the bottom of .py file. 

    # --------------------- Phase Offset Correction ---------------------
    def RxPhaseOffset(rxch, phaseOff):
    phaseNum = int(phaseOff / (360. / 2**16))
    AFE.device.closeLastPageSel()
    AFE.device.writeReg(0x12, rxch)
    AFE.device.writeReg(0xE1, (phaseNum >> 8) & 0xFF)
    AFE.device.writeReg(0xE0, phaseNum & 0xFF)
    AFE.device.writeReg(0x12, 0x0)

    Immediately after AFE.initializeConfig() parameter, add below. 

    # --------------------- Apply Phase Offsets Relative to Ch1 ---------------------
    # These values are based on your theoretical average phase differences

    RxPhaseOffset(1, 0.0) # Ch1 is reference
    RxPhaseOffset(2, 2.3) # Ch2 lags → advance it for 35 MHz 
    RxPhaseOffset(3, 2.8) # Ch3 lags → advance it for 35 MHz 
    RxPhaseOffset(4, 2) # Ch4 lags → advance it for 35 MHz 

    print("Phase offset calibration applied to RX channels.")

    Is above understanding is correct? or can you provide one proven example with the use of above function inside the latte script?

    Awaited your response. 

  • Hi Maitry,

    The RxPhaseOffset function calls should be added after the AFE.deviceBringup line, in the configAFE.py script. The NCO phase can only be modified after the device has been fully configured. 

    Regards,

    David Chaparro 

  • Hello David, 

    Thank you for your quick response. 

    Can you provide a proven modified configAFE.py script so that I can take a reference of that, check and validate the same in my board?

    For example, If I want to make a phase offset for 35 MHz as per below, could you provide one modified configAFE.py script based from which I can take a reference?

    35 MHz = channel A - channel B = 2.3 deg 

    35 MHz = channel A - channel C = 2.8 deg

    35 MHz = channel A - channel D = 2 deg

    35 MHz = channel B - channel C = 0.4 deg

  • Hi Maitry,

    It will be simply adding the same lines you mention above to the configAfe script. 

    setupParams.skipLmk = 1 
    AFE.deviceBringup()
    AFE.TOP.overrideTdd(15,0,15)
    device.closeLastPageSel()
    setupParams.skipLmk = 0setupParams.skipLmk = 1 
    AFE.deviceBringup()
    AFE.TOP.overrideTdd(15,0,15)
    device.closeLastPageSel()
    setupParams.skipLmk = 0
    
    RxPhaseOffset(1, 0.0) # Ch1 is reference
    RxPhaseOffset(2, 2.3) # Ch2 lags → advance it for 35 MHz 
    RxPhaseOffset(3, 2.8) # Ch3 lags → advance it for 35 MHz 
    RxPhaseOffset(4, 2) # Ch4 lags → advance it for 35 MHz 

    Regards,

    David Chaparro

  • Hello David, 

    Thank you for your clarification. I will try and update you for the same.