AFE7950EVM: RX NCO update

Part Number: AFE7950EVM

Hello Everyone,

I'd like to ask for help to achieve RX NCO switching via GPIO. I've already managed to change TX NCO this way, as written in this topic:
https://e2e.ti.com/support/rf-microwave-group/rf-microwave/f/rf-microwave-forum/1295365/afe7900evm-nco-frequency-configuration

Then I tried replacing the TX specific parts of the code by RX related things (device.TT->device.RRF, TXDIG->RXDIG, etc...). Although the first element of the RX NCO array is loaded, the others don't seem to have effect and I can't control the GPIO functions even by IOWRAP.OverrideFunction. The LMK configuration is below:

##############		Read me			##############
#In HSDC Pro DAC tab, Select AFE79xx_2x2TX_44210; Data Rate = 491.52M
#In HSDC Pro ADC tab, Select AFE79xx_2x2RX_44210; Data Rate = 491.52M ---> To capture 4 RX channels

sysParams=AFE.systemParams
sysParams.__init__();sysParams.chipVersion=chipVersion

setupParams.skipFpga = 1 # setup FPGA (TSW14J56) using HSDC Pro 
##############		Top Level			##############
sysParams.FRef			= 506
sysParams.FadcRx		= 2530
sysParams.FadcFb		= 2530
sysParams.Fdac			= 2530*4
sysParams.externalClockRx=False
sysParams.externalClockTx=False
													
##############		Digital Chain		##############

		#####	RX	#####
sysParams.ncoFreqMode="FCW"
sysStatus.rxChainDirectCtrl=True
sysParams.rxChainDirectCtrl=True
sysParams.broadcastRxNcoSel=1
sysParams.numRxNco=16
sysParams.ncoRxMode=[6,6]
		
sysParams.ddcFactorRx	=	[5,5,5,5]				#DDC decimation factor for RX A, B, C and D
sysParams.rxNco0		= 	[[1800,5400],			#Band0, Band1 for RXA 
							[750,750],        		#Band0, Band1 for RXB 
							[3000,2500],        	#Band0, Band1 for RXC 
							[1800,1800]]        	#Band0, Band1 for RXD 

		#####	FB	#####
sysParams.fbEnable		=	[False,False]
sysParams.ddcFactorFb	=	[5,5]					#DDC decimation factor for FB 1 and 2
sysParams.fbNco0		= 	[750,750]				#Band0 for FB1 and FB2 

		#####	TX	#####	


sysParams.ducFactorTx	=	[20,20,20,20]			#DUC interpolation factor for TX A, B, C and D
sysParams.txNco0		= 	[[875.5,1800],			#Band0, Band1 for TXA 
							[1987.5,1800],        		#Band0, Band1 for TXB 
							[3605,2500],        	#Band0, Band1 for TXC 
							[1800,1800]]        	#Band0, Band1 for TXD


##############		JESD		##############

		#####	ADC-JESD	#####
sysParams.jesdSystemMode= [3,3]
													#SystemMode 0:	2R1F-FDD						; rx1-rx2-fb -fb
													#SystemMode 1:	1R1F-FDD						; rx -rx -fb -fb
													#SystemMode 2:	2R-FDD							; rx1-rx1-rx2-rx2
													#SystemMode 3:	1R								; rx -rx -rx -rx
													#SystemMode 4:	1F								; fb -fb- fb -fb
													#SystemMode 5:	1R1F-TDD						; rx/fb-rx/fb-rx/fb-rx/fb
													
sysParams.jesdTxProtocol= [0,0]						# 0 - 8b/10b encoding; 2 - 64b/66b encoding 
sysParams.LMFSHdRx		= ["44210","44210","44210","44210"]
													# The 2nd and 4th are valid only for jesdSystemMode values in (0,2).
													# For other modes, select 4 converter modes for 1st and 3rd.
sysParams.LMFSHdFb		= ["22210","22210"]

sysParams.rxJesdTxScr	= [True,True,True,True]
sysParams.fbJesdTxScr	= [True,True]

sysParams.rxJesdTxK		= [16,16,16,16]
sysParams.fbJesdTxK		= [16,16]

sysParams.jesdTxLaneMux	= [0,1,2,3,4,5,6,7]			# Enter which lanes you want in each location. 
													# For example, if you want to exchange the first two lines of each 2T,
													#		this should be [[1,0,2,3],[5,4,6,7]]

		#####	DAC-JESD	#####
sysParams.jesdRxProtocol= [0,0]
sysParams.LMFSHdTx		= ["44210","44210","44210","44210"]
sysParams.jesdRxLaneMux	= [0,1,2,3,4,5,6,7]			# Enter which lanes you want in each location.
													# For example, if you want to exchange the first two lines of each 2R
													#		this should be [[1,0,2,3],[5,4,6,7]]
sysParams.jesdRxRbd		= [4, 4]
sysParams.jesdRxScr		= [True,True,True,True]
sysParams.jesdRxK		= [16,16,16,16]

		#####	JESD Common	#####
	
sysParams.jesdABLvdsSync= False
sysParams.jesdCDLvdsSync= False
sysParams.syncLoopBack	= True	#JESD Sync signal is connected to FPGA

##############		GPIO		##############
sysParams.gpioMapping	= {
						'H8': 'ADC_SYNC0',
						'H7': 'DAC_SYNC0',
						'N8': 'ADC_SYNC2',
						'N7': 'ADC_SYNC3',
						'H9': 'ADC_SYNC1',
						'G9': 'DAC_SYNC1',
						'N9': 'DAC_SYNC2',
						'P9': 'DAC_SYNC3',
						'P14': 'GLOBAL_PDN',
						'K14': 'FBABTDD',
						'R6': 'FBCDTDD',
						'H15': ['TXATDD','TXBTDD'],
						'V5': ['TXCTDD','TXDTDD'],
						'E7': ['RXATDD','RXBTDD'],
						'R15': ['RXCTDD','RXDTDD'],
						'L14': ['RX_NCOSEL_3'],
						'M14': ['RX_NCOSEL_2'],
						'P13': ['RX_NCOSEL_1'],
						'N12': ['RX_NCOSEL_0']}

##############		LMK Params		##############
lmkParams.pllEn			= False
lmkParams.inputClk		= 506 #983.04 # Valid only when lmkParams.pllEn = False
lmkParams.lmkFrefClk	= True
setupParams.fpgaRefClk	= 126.5 # Should be equal to LaneRate/40 for TSW14J56

##############		Logging		##############
logDumpInst.setFileName(ASTERIX_DIR+DEVICES_DIR+r"\Afe79xxPg1.txt")
logDumpInst.logFormat=0x21 #Modify to 0x1 to save register scequence to log file. Script takes more time to execute.
logDumpInst.rewriteFile=1
logDumpInst.rewriteFileFormat4=1
device.optimizeWrites=0
device.rawWriteLogEn=1

device.delay_time = 0
#-------------------------------------------------------------------------------------------------#
setupParams.skipLmk	=	False
AFE.initializeConfig()
lmkParams.sysrefFreq = AFE.systemStatus.sysrefFreq
lmkParams.lmkPulseSysrefMode = False
AFE.LMK.lmkConfig()

And the AFE configuration is as follows:

## Initiates AFE79xx Bring-up
setupParams.skipLmk	=	True
AFE.deviceBringup()

AFE.TOP.overrideTdd(15,3,15)

#for i in range(4): AFE.DSA.setRxDsa(i,4)

### ADC Ramp Out
# for i in range(3):
# 	AFE.JESD.ADCJESD[0].adcRampTestPattern(i,1,1)
# 	AFE.JESD.ADCJESD[1].adcRampTestPattern(i,1,1) #chNo, En, RampInc 


### RX NCO Update
rx_nco_freqs_ch_A=[ 920.5,1185,290,690,
					920.5,1185,290,690,
					920.5,1185,290,690,
					920.5,1185,290,690]

rx_nco_freqs_ch_B=[ 920.5,1185,290,690,
					920.5,1185,290,690,
					920.5,1185,290,690,
					920.5,1185,290,690]

rx_nco_freqs_ch_C=[ 920.5,1185,290,690,
					920.5,1185,290,690,
					920.5,1185,290,690,
					920.5,1185,290,690]

rx_nco_freqs_ch_D=[ 920.5,1185,290,690,
					920.5,1185,290,690,
					920.5,1185,290,690,
					920.5,1185,290,690]

id_ch_A=0	
id_ch_B=1
id_ch_C=2
id_ch_D=3				

for i,freq in enumerate(rx_nco_freqs_ch_A):
	AFE.updateRxNcoInfiniteNcoMode(id_ch_A,freq,i)

for i,freq in enumerate(rx_nco_freqs_ch_B):
	AFE.updateRxNcoInfiniteNcoMode(id_ch_B,freq,i)

for i,freq in enumerate(rx_nco_freqs_ch_C):
	AFE.updateRxNcoInfiniteNcoMode(id_ch_C,freq,i)

for i,freq in enumerate(rx_nco_freqs_ch_D):
	AFE.updateRxNcoInfiniteNcoMode(id_ch_D,freq,i)
	
for i in range(2):
	for j in range(2):
		device.RRF[j].RXDIG[i].RXDIG.REGGROUP_4.config_fmixer_update_pulse=0
		device.RRF[j].RXDIG[i].RXDIG.REGGROUP_4.config_fmixer_update_pulse=1

What do you think is missing? Thank you for your help in advance!

Best regards,
Norbert

  • Hi Norbert,

    We will test these scripts on our EVM and try to replicate this issue. Were you able to test the script from the other e2e post on your setup?

    Regards,

    David Chaparro

  • Dear David,

    The script you wrote in the other post worked fine for the TX NCOs, but had no effect on RX NCOs.

    I'm looking forward to your reply!

    Norbert

  • Hi Norbert,

    One reason that the script provided may not work is the version of the AFE79xx GUI. Can you verify that you are using the latest version of AFE79xx GUI? Please note that the latest version of the GUI should be downloaded from the AFE79xx secure folder as we have updated the name of the function used to update the NCO frequency.

    The only changes that need to be added to the basic scripts for the 16 NCO control on the Rx channels are given below. Please take these change and add them to your script. 

    sysParams.ncoFreqMode	= "FCW"
    
    sysParams.ncoRxMode		=	[6,6]
    sysParams.broadcastRxNcoSel = 1
    sysParams.numRxNCO		=	2
    
    for i in range(16):
    	for j in range(4):
    		AFE.updateRxNcoMultiNcoMode(j,500+50*i,i)
    
    
    Assign RX_NCOSEL fucntion to GPIO pins (Example given below)
    
    	'G6': 'RX_NCOSEL_0',
    	'G7': 'RX_NCOSEL_1',
    	'G8': 'RX_NCOSEL_2',
    	'R5': 'RX_NCOSEL_3',

    Regards,

    David Chaparro 

  • Dear David,

    I have updated Latte, so now Tool Version is 2.5.0 and Latte Framework Version is 5.7.3. Everything runs OK without any errors however, the RX NCOs do not seem to be changing. I have tried adding your suggested changes in the LMK config file and the AFE bringup file (separately). I have also tried overriding RX NCO functions to exclude possibility of bad GPIO control. Do you have any other ideas about what the problem is?

    Thanks,

    Norbert

  • Hi Norbert,

    The two scripts given below are updated such that I am able to use the GPIO function override function and see the Rx NCO shift. Can you give these a try on your setup? If you uncomment the 'AFE.IOWRAP.overrideFunction('RX_NCOSEL_0',1,1)' line then you should see the NCO shift by 50MHz. 

    LMK Configuration: 

    ##############		Read me			##############
    #In HSDC Pro DAC tab, Select AFE79xx_2x2TX_44210; Data Rate = 491.52M
    #In HSDC Pro ADC tab, Select AFE79xx_2x2RX_44210; Data Rate = 491.52M ---> To capture 4 RX channels
    
    sysParams=AFE.systemParams
    sysParams.__init__();sysParams.chipVersion=chipVersion
    
    setupParams.skipFpga = 1 # setup FPGA (TSW14J56) using HSDC Pro 
    ##############		Top Level			##############
    sysParams.FRef			= 506
    sysParams.FadcRx		= 2530
    sysParams.FadcFb		= 2530
    sysParams.Fdac			= 2530*4
    sysParams.externalClockRx=False
    sysParams.externalClockTx=False
    													
    ##############		Digital Chain		##############
    	
    sysParams.ddcFactorRx	=	[5,5,5,5]				#DDC decimation factor for RX A, B, C and D
    sysParams.rxNco0		= 	[[1800,5400],			#Band0, Band1 for RXA 
    							[750,750],        		#Band0, Band1 for RXB 
    							[3000,2500],        	#Band0, Band1 for RXC 
    							[1800,1800]]        	#Band0, Band1 for RXD 
    
    sysParams.ncoFreqMode	= "FCW"
    
    sysParams.ncoRxMode		=	[6,6]
    sysParams.broadcastRxNcoSel = 1
    sysParams.numRxNCO		=	2
    
    		#####	FB	#####
    sysParams.fbEnable		=	[False,False]
    sysParams.ddcFactorFb	=	[5,5]					#DDC decimation factor for FB 1 and 2
    sysParams.fbNco0		= 	[750,750]				#Band0 for FB1 and FB2 
    
    		#####	TX	#####	
    
    
    sysParams.ducFactorTx	=	[20,20,20,20]			#DUC interpolation factor for TX A, B, C and D
    sysParams.txNco0		= 	[[875.5,1800],			#Band0, Band1 for TXA 
    							[1987.5,1800],        		#Band0, Band1 for TXB 
    							[3605,2500],        	#Band0, Band1 for TXC 
    							[1800,1800]]        	#Band0, Band1 for TXD
    
    
    ##############		JESD		##############
    
    		#####	ADC-JESD	#####
    sysParams.jesdSystemMode= [3,3]
    													#SystemMode 0:	2R1F-FDD						; rx1-rx2-fb -fb
    													#SystemMode 1:	1R1F-FDD						; rx -rx -fb -fb
    													#SystemMode 2:	2R-FDD							; rx1-rx1-rx2-rx2
    													#SystemMode 3:	1R								; rx -rx -rx -rx
    													#SystemMode 4:	1F								; fb -fb- fb -fb
    													#SystemMode 5:	1R1F-TDD						; rx/fb-rx/fb-rx/fb-rx/fb
    													
    sysParams.jesdTxProtocol= [0,0]						# 0 - 8b/10b encoding; 2 - 64b/66b encoding 
    sysParams.LMFSHdRx		= ["44210","44210","44210","44210"]
    													# The 2nd and 4th are valid only for jesdSystemMode values in (0,2).
    													# For other modes, select 4 converter modes for 1st and 3rd.
    sysParams.LMFSHdFb		= ["22210","22210"]
    
    sysParams.rxJesdTxScr	= [True,True,True,True]
    sysParams.fbJesdTxScr	= [True,True]
    
    sysParams.rxJesdTxK		= [16,16,16,16]
    sysParams.fbJesdTxK		= [16,16]
    
    sysParams.jesdTxLaneMux	= [0,1,2,3,4,5,6,7]			# Enter which lanes you want in each location. 
    													# For example, if you want to exchange the first two lines of each 2T,
    													#		this should be [[1,0,2,3],[5,4,6,7]]
    
    		#####	DAC-JESD	#####
    sysParams.jesdRxProtocol= [0,0]
    sysParams.LMFSHdTx		= ["44210","44210","44210","44210"]
    sysParams.jesdRxLaneMux	= [0,1,2,3,4,5,6,7]			# Enter which lanes you want in each location.
    													# For example, if you want to exchange the first two lines of each 2R
    													#		this should be [[1,0,2,3],[5,4,6,7]]
    sysParams.jesdRxRbd		= [4, 4]
    sysParams.jesdRxScr		= [True,True,True,True]
    sysParams.jesdRxK		= [16,16,16,16]
    
    		#####	JESD Common	#####
    	
    sysParams.jesdABLvdsSync= False
    sysParams.jesdCDLvdsSync= False
    sysParams.syncLoopBack	= True	#JESD Sync signal is connected to FPGA
    
    ##############		GPIO		##############
    sysParams.gpioMapping	= {
    						'H8': 'ADC_SYNC0',
    						'H7': 'DAC_SYNC0',
    						'N8': 'ADC_SYNC2',
    						'N7': 'ADC_SYNC3',
    						'H9': 'ADC_SYNC1',
    						'G9': 'DAC_SYNC1',
    						'N9': 'DAC_SYNC2',
    						'P9': 'DAC_SYNC3',
    						'P14': 'GLOBAL_PDN',
    						'K14': 'FBABTDD',
    						'R6': 'FBCDTDD',
    						'H15': ['TXATDD','TXBTDD'],
    						'V5': ['TXCTDD','TXDTDD'],
    						'E7': ['RXATDD','RXBTDD'],
    						'R15': ['RXCTDD','RXDTDD'],
    						'L14': ['RX_NCOSEL_3'],
    						'M14': ['RX_NCOSEL_2'],
    						'P13': ['RX_NCOSEL_1'],
    						'N12': ['RX_NCOSEL_0']}
    
    ##############		LMK Params		##############
    lmkParams.pllEn			= False
    lmkParams.inputClk		= 506 #983.04 # Valid only when lmkParams.pllEn = False
    lmkParams.lmkFrefClk	= True
    setupParams.fpgaRefClk	= 253 # Should be equal to LaneRate/40 for TSW14J56
    
    ##############		Logging		##############
    logDumpInst.setFileName(ASTERIX_DIR+DEVICES_DIR+r"\Afe79xxPg1.txt")
    logDumpInst.logFormat=0x0 #Modify to 0x1 to save register scequence to log file. Script takes more time to execute.
    logDumpInst.rewriteFile=1
    logDumpInst.rewriteFileFormat4=1
    device.optimizeWrites=0
    device.rawWriteLogEn=1
    
    device.delay_time = 0
    #-------------------------------------------------------------------------------------------------#
    setupParams.skipLmk	=	False
    AFE.initializeConfig()
    lmkParams.sysrefFreq = AFE.systemStatus.sysrefFreq
    lmkParams.lmkPulseSysrefMode = False
    AFE.LMK.lmkConfig()

    AFE Configuration

    setupParams.skipLmk	=	1 
    AFE.deviceBringup()
    AFE.TOP.overrideTdd(15,0,15)
    
    for i in range(16):
    	for j in range(4):
    		AFE.updateRxNcoMultiNcoMode(j,1800+50*i,i)
    		
    # AFE.IOWRAP.overrideFunction('RX_NCOSEL_0',1,1) #GPIO Function Name, Override Enable, Override Value
    # AFE.IOWRAP.overrideFunction('RX_NCOSEL_1',1,1)
    # AFE.IOWRAP.overrideFunction('RX_NCOSEL_2',1,1)
    # AFE.IOWRAP.overrideFunction('RX_NCOSEL_3',1,1)

    Regards,

    David Chaparro 

  • Dear David,

    Thanks for your help, the scripts you provided do solve my problem. However, I cannot see the difference between my scripts and yours, but I will proceed from yours. Thank you again!

    Best regards,
    Norbert

  • Hi Norbert,

    When testing with your script were the below lines remove? These parameters are not setting up the Rx NCOs correctly and one of the parameters, rxChainDirectCtrl, is not a valid parameter used by Latte. So these may be the source of the issue with your script. 

    sysParams.ncoFreqMode="FCW"
    sysStatus.rxChainDirectCtrl=True
    sysParams.rxChainDirectCtrl=True
    sysParams.broadcastRxNcoSel=1
    sysParams.numRxNco=16
    sysParams.ncoRxMode=[6,6]

    Regards,

    David Chaparro