Changes between Initial Version and Version 1 of HardwareUsersGuides/RadioBoard_v1.4/Usage/TxDCOffset


Ignore:
Timestamp:
Apr 9, 2007, 11:40:07 PM (17 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HardwareUsersGuides/RadioBoard_v1.4/Usage/TxDCOffset

    v1 v1  
     1[[TracNav(HardwareUsersGuides/RadioBoard_v1.4/TOC)]]
     2
     3== WARP Radio Board TX DC Offset Calibration ==
     4
     5The radio transceiver on the WARP Radio Board uses a direct conversion architecture. One side-effect of this is a sensitivity to DC offsets in the transmitted signal. Any DC component in the transmit waveform results in carrier leakage at RF. In addition to any DC component in the user's transmitted waveform, the radio board itself introduces a small DC offset due to variations in component values and board assembly.
     6
     7To avoid these problems, users should be careful to transmit waveforms with zero DC component, and should calibrate their radios.
     8
     9=== Calibrating a Radio ===
     10
     11The residual DC offset due to component variations can be estimated using a special calibration mode of the radio board. During calibration, the algorithm estimates DC offsets for the I and Q channels on a given radio board. These values are then stored to the radio board's EEPROM. Once stored, the DC calibration values can be read by user applications each time the board is used.
     12
     13The calibration algorithm is not publically available. However, we do distribute an FPGA configuration file which executes the calibration process automatically.
     14
     15 1) Download a copy configuraiton file - TxDCO_Calibrate.bit
     16 1) Use the DIP switch on the WARP FPGA Board to select which radios should be calibrated. Each switch position corresponds to a radio. The LSB (Radio #1) is the bottom switch; MSB (Radio #4) is the top.
     17 1) Connect a serial cable to the FPGA board and set your terminal emulator to 57600bps
     18 1) Power on the FPGA board and wait for a few minutes; this allows components to warm up
     19 1) Configure the FPGA using TxDCO_Calibrate.bit
     20 1) The terminal will display the status as it runs. Wait for the calibration of each radio to complete.
     21
     22You can repeat this process whenever needed. In our experience, calibration values are fairly static over time but do vary with temperature.
     23
     24=== Using Calibration Values ===
     25
     26User applications should use the stored Tx DCO calibration values on power-up. The code below is an example of how this is done. This function is portable and should compile when integrated with a user application in XPS.
     27
     28{{{
     29#!C
     30
     31//Assumes your hardware platform contains:
     32// radio_controller_v1_08_a
     33// EEPROM_v1_00_a or EEPROM_v1_01_a
     34
     35//Before calling this function, your application must initialize
     36// the radio controller using the WarpRadio_v1_Reset() function
     37
     38//Your code must also include:
     39// #include radio_prototypes.h
     40// #include EEPROM.h
     41
     42void warpmac_CalibrateTxDCO () {
     43        unsigned char i;
     44        unsigned int thisRadio;
     45        int eepromStatus = 0;
     46        short calReadback = 0;
     47        signed short best_I, best_Q;
     48       
     49        //Select which radios should be used
     50        // Include RADION_ADDR to enable a radio, 0 to disable it
     51        // This array must contain 4 elements corresponding to the 4 radios
     52        // Use a value of RADION_ADDR (for N=[1,2,3,4]) to enable a radio
     53        // Use 0 to disable a radio
     54        //  For example, these arrys are valid:
     55        //   {RADIO1_ADDR, RADIO2_ADDR, RADIO3_ADDR, RADIO4_ADDR} //Calibrate all four radios
     56        //   {RADIO1_ADDR, 0, 0, RADIO4_ADDR} //Calibrate radios #1 and #4
     57        //  But these are not:
     58        //   {RADIO2_ADDR, RADIO1_ADDR, 0, 0} //Out of order
     59        //   {RADIO1_ADDR} //Not enough elements
     60
     61        unsigned int selectedRadios[4] = {RADIO1_ADDR, RADIO2_ADDR, 0, 0};
     62
     63        for(i=0; i<4; i++)
     64        {
     65                thisRadio = selectedRadios[i];
     66
     67                //Only read values for enabled radios
     68                if(thisRadio > 0)
     69                {
     70                        //Select the EEPROM on the current radio board
     71                        eepromStatus = WarpEEPROM_EEPROMSelect((unsigned int*)XPAR_EEPROM_0_BASEADDR, i);
     72
     73                        //Initialize the EEPROM controller
     74                        eepromStatus = WarpEEPROM_Initialize((unsigned int*)XPAR_EEPROM_0_BASEADDR);
     75
     76                        //Read the Tx DCO values
     77                        calReadback = WarpEEPROM_ReadRadioCal((unsigned int*)XPAR_EEPROM_0_BASEADDR, 2, 0);
     78       
     79                        //Scale the stored values
     80                        best_I = (signed short)(((signed char)(calReadback & 0xFF))<<1);
     81                        best_Q = (signed short)(((signed char)((calReadback>>8) & 0xFF))<<1);
     82       
     83                        //Optional debug output; useful to check whether the values are valid
     84                        xil_printf("\r\nRadio #%d TxDCO - I: %d Q: %d\r\n", i, best_I, best_Q);
     85       
     86                        //Finally, write the Tx DCO values to the DAC
     87                        WarpRadio_v1_DACOffsetAdj(ICHAN, best_I, thisRadio);
     88                        WarpRadio_v1_DACOffsetAdj(QCHAN, best_Q, thisRadio);
     89                }
     90        }
     91
     92        return;
     93}
     94}}}