###############################################
# GC5016_DUCInt6_DDCDec6_2ch_Transceiver.txt
# Interpolate by 6, Decimate by 6, 
###############################################

###############################
# standard print file items
###############################
print table
print gc101
print analysis
print debug
print hfile 

##############################
# setup for 1 channel Transceiver
##############################
mode ab transmit
mode cd receive
splitiq 1

##############################
# clock rate of GC5016, 6x rate
##############################
fck 134.4

##############################
# startup sync - uses one shot sync internal
##############################
sync_mode 9

##############################
# general timer, sync output
############################## 
gen_timer_sync 4
gen_timer 0
soB_sync 4
 
#################################
# channel A setup for DUC
#################################
channel 0

###################################
# channel sync is set for SIA
###################################
# sck_divider sync
sck_sync 4

# channel interpolation sync
fir_sync 4
cic_sync 4
# clear data path sync
flush_sync 4

# restart nco, and LFSR sync
nco_sync 0
dith_sync 0

# use manual gain
gain_sync 7

#################################
# separate parallel IQ interface AB, change tdm for tdm IQ interface  
# send I data for new cycle until AFS is received, on negative edge of AFS send Q data
# for parallel IQ                                                                                  
#################################
bits 16
pins 16
tinf_cmplx 0
tinf_tdm 0
tinf_fs_dly 1
sck_div 0

##################################
# adjust overall gain so that number of output channels has composite real
# output that has at least .5db backoff for DAC
################################### 
overall_gain .8911

###################################
# interpolation by  6, 2 PFIR, 3 CIC
################################### 
fir_int 2
fir_coef pfir_44p8_fp9p2_fs10p2_cic6_191.taps

cic_int 3

#################################
# Up Convert Mixer value in Mhz - 0 for complex up convert in DAC or quad modulator
###################################
freq 0

###################################
# output mode is 1 channels
###################################
tout_cmplx 0
tout_rate 1
tout_nsig 1
tout_res 0
tout_sumin 0 

#################################
# channel B setup for DUC
################################# 
channel 1 
copy_channel 0

#################################
# channel C setup for DDC
#################################
channel 2

#################################
# IO Interface
# 16bit C port Real Input - 2s complement ADC
#################################
# full rate, real input, Cinput port
rin_rate 1
rin_cmplx 0
mix_rcv_sel 2
rinf_diag 1

###################################
# channel sync is set for One Shot
###################################
# zpad _Sync
rinf_zpad_sync 4
# channel decimation sync
cic_sync 4
fir_sync 4
# sck_divider sync
sck_sync 4

# clear data path sync
flush_sync 4

# restart nco, and LFSR sync
nco_sync 0
dith_sync 0

###################################
# zpad is not used
###################################
rinf_zpad 0

###################################
# select value for real down conversion, 134.4 ADC rate, Fs/4 IF
###################################
freq -33.6

###############################
# Decimate by 6 - 3 CIC, 2 PFIR
###############################
cic_dec 3

###############################
# decimate by 2 filter 
############################### 
fir_dec 2
fir_coef pfir_44p8_fp9p2_fs10p2_191.taps

###############################
# manual gain 
###############################
overall_gain 2.0
agc_freeze 1
gain_sync 7

#################################
# parIQ, C-I, D-Q, change tdm to interleaved IQ on portD
#################################
bits 16
pins 16
routf_tdm 0
sck_div 0 

#################################
# channel D setup for DDC
#################################
channel 3
# copy initial channel 2 settings
copy_channel 2