# HG changeset patch # User Mychaela Falconia # Date 1500153758 0 # Node ID b0da2db4e36b33fc66e991082d3586fab726ee61 # Parent 394daa4ad6e88328bb4851a04f7910ac41a9c9b7 fc-rfcal-txband: basis run implemented diff -r 394daa4ad6e8 -r b0da2db4e36b autocal/Makefile --- a/autocal/Makefile Sat Jul 15 21:06:43 2017 +0000 +++ b/autocal/Makefile Sat Jul 15 21:22:38 2017 +0000 @@ -11,7 +11,7 @@ rxupload.o sockopts.o tsidsock.o TXBAND_OBJS= l1tmops.o rvinterf.o sockopts.o tsidsock.o txbandmain.o \ - txcalchan.o txcalconf.o txpwrmeas.o txvout.o + txbasis.o txcalchan.o txcalconf.o txpwrmeas.o txvout.o TXBASIS_OBJS= l1tmops.o rvinterf.o tsidsock.o txpwrmeas.o txstandbas.o diff -r 394daa4ad6e8 -r b0da2db4e36b autocal/txbandmain.c --- a/autocal/txbandmain.c Sat Jul 15 21:06:43 2017 +0000 +++ b/autocal/txbandmain.c Sat Jul 15 21:22:38 2017 +0000 @@ -24,14 +24,14 @@ }; struct tx_calchan_range tx_calchan_900[] = { - { 0, 27, 14}, - { 28, 47, 40}, - { 48, 66, 57}, - { 67, 85, 76}, - { 86, 104, 95}, - { 105, 124, 114}, - { 975, 994, 985}, - { 995, 1023, 1009} + { 0, 27, 14}, + { 28, 47, 40}, + { 48, 66, 57}, + { 67, 85, 76}, + { 86, 104, 95}, + {105, 124, 114}, + {975, 994, 985}, + {995, 1023, 1009} }; struct tx_calchan_range tx_calchan_1800[] = { @@ -115,8 +115,11 @@ do_rfpw(AFC_ENA_FLAG, 0); /* any previous calchan needs to be cleared out first */ + printf("Initializing calchan table\n"); init_tx_calchan(); upload_tx_calchan(); + /* run the basis measurements */ + txcal_basis_run(); } diff -r 394daa4ad6e8 -r b0da2db4e36b autocal/txbasis.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autocal/txbasis.c Sat Jul 15 21:22:38 2017 +0000 @@ -0,0 +1,39 @@ +/* + * The basis steps of Tx power level calibration are implemented here. + */ + +#include +#include +#include +#include +#include "txband.h" + +extern double tx_power_meas(); +extern vout_t dbm_to_vout(); + +extern struct txcal_band *txcal_band; +extern struct tx_basis_point tx_basis[MAX_BASIS_POINTS]; +extern unsigned num_basis_points; + +txcal_basis_run() +{ + unsigned n; + double meas; + + printf("Performing the calibration basis run\n"); + do_txpw(TX_PWR_LEVEL, txcal_band->start_plnum); + printf("Starting RF Tx on the DUT\n"); + do_rfe(RX_TX_TCH); + + for (n = 0; n < num_basis_points; n++) { + do_txpw(TX_APC_DAC, tx_basis[n].apc); + usleep(20000); + meas = tx_power_meas(); + printf("APC DAC=%d: %.2f dBm\n", tx_basis[n].apc, meas); + tx_basis[n].vout = dbm_to_vout(meas); + } + + printf("Stopping RF Tx on the DUT\n"); + do_rfe(STOP_ALL); + return(0); +}