wiki:HardwareUsersGuides/RadioBoard_v1.4/RadioController

Version 23 (modified by sgupta, 18 years ago) (diff)

--

Radio Controller

The radio contoller is a custom peripheral designed to utilize the many functions of the radio boards. It contains SPI logic to set the registers in the Radio and DAC chips on the boards and logic to keep track of the control pins for both of the chips. Also provided with the radio controller are drivers that enable the use of the radio controller. For the latest copy of the radio controller and its drivers refer to the repository.

This core only has logic in it and does not connect to pins directly. It must be used in conjunction with the radio bridge peripheral which actually provides the connections for each of the four available daughtercard slots. Select radio bridges for the locations where a WARP radio board is plugged in. Up to four radio bridges can be used in a project.

The radio controller is an EDK peripheral that should be available as an option in Base System Builder when using the Board Description File (*.xbd) available in the repository.

Setting up the Radio Controller Peripheral

The latest version of the radio controller peripheral and drivers are located in the repository. Its setup is included in the Board Description File (*.xbd) for the WARP Boards. Please refer to the FAQ for instructions on obtaining the peripherals and XBD file.

  1. Use the Base System Builder to set up a new project in Xilinx Platform Studio (refer to User's Guide to see how to set up a project that tests the basic peripherals on the FPGA board).
  2. Check the box referring to the Radio Controller to include it.
  3. Also you will see four radio bridge peripherals. Each of these refer to a daughtercard slot on the FPGA board. If your radio is in slot 2, check the box for Radio_Bridge_2. If you have mutliple radios you may check more than one bridge.

To use the Radio Controller you must have alteast one Radio Bridge included. Also setting up Radio Bridge without the Radio Controller does not provide any tools to use the radios.

Once the project has been created you will notice a Radio Controller core in the System Assembly View.

Using the Radio Controller Drivers

Note: The documentation below is only for the 1.04 version of the radio controller. Further revisions behave differently.

All the functions provided with the radio controller can be accessed through radio_controller.h. Include this file in your C program by inserting the following line at the top:

 #include "radio_controller.h"

All the radio controller functions are divided into two sets. The first set control the Maxim Radio on the board and begin with WarpRadio_ while the second set controls the Digitial-to-Analog Converter (DAC) for the data and these begin with WarpDac_.

Inputs to Functions

The following two inputs are common to all functions in the library

  1. baseaddr: This is the base address of the radio controller peripheral. The base address information of all the peripherals is located in the xparameters.h file. This file appears only after the hardware has been generated the first time. To access the file open the Software Application Project and expand the Processor: ppc405_0 list. Be sure to include this file at the top of your C program as well by using the following line:
     #include "xparameters.h"
    
    If the project has been created with the Base System Builder, generally the base address of the radio controller is XPAR_RADIO_CONTROLLER_0_BASEADDR. Be sure to check this to be certain.
  2. radios/dacs: This refers to the Radios or the DACs that are to be affected by the function call. Each radio and DAC on the Radio Board can be selected by RADIO1_ADDR or DAC1_ADDR if the Radio Board is in slot 1, RADIO2_ADDR or DAC2_ADDR if in slot 2, etc. To call the function on multiple boards at the same time, OR (|) the values with each other. For example, RADIO1_ADDR|RADIO2_ADDR would affect both the radios in slot 1 and 2.

Any other inputs are explained at the top of that function in radio_controller.h.

Initialization

The core uses just one Serial Peripheral Interface (SPI) to control both the Maxim Radio as well DAC. Hence certain changes need to be made to the SPI core before addressing one or the other. Before calling any WarpRadio_ functions be sure to call WarpRadio_InitializeSPI. This must be done before any call to the radios after just calling a function on the DACs. Similarly WarpDac_InitializeSPI must be called before accessing any of its functions.

A good rule of thumb for intialization at the start of time is to execute the following statements in order:

 WarpDac_InitializeSPI(...)
 WarpDac_Reset(...)
 WarpDac_InitializeDAC(...)
 <any other WarpDac_ functions>

 WarpRadio_InitializeSPI(...)
 WarpRadio_Reset(...)
 WarpRadio_InitializeRadio(...)
 <any other WarpRadio_ functions>

Just to reiterate, notice how the InitializeSPI functions of both the radio and DAC are called before a function call of that type.

Basic Usage of Radio Functions

Selecting Center Frequency: Functions SetCenterFreq2GHz(...) and SetCenterFreq5GHz(...) can be used to set the transceiver center frequency in the 2.4 GHz and 5 GHz ISM bands respectively. Within these the channel number can also be selected. By default the center frequency is in the 2.4 GHz band with channel number 6 which is equivalent to 2.437 GHz. See radio_controller.h for details on the different center frequencies available.

Setting Transmit and Receive Gains: For transmit gains first set SerialTxGain(...) mode to 1. Then using BaseBandTxGain(...) and TxVGAGainControl(...) set the transmit gain. For the receive gains the SerialRxGain(...) mode can be set to 0 or 1. If the mode is set to 1 the RxLNAGainControl(...) and RxVGAGainControl(...) should be used to serially set the receive gains. While when the mode is 0 the receive gains are set by a parallel bus user_BB_gain and user_RF_gain respectively. The parallel busses are inputs to the radio_bridge peripheral for each of the daughtercard slots. The second mode is generally used where there is a separate peripheral that selects the receive gains, for example an Automatic Gain Control algorithm.

Selecting Antenna Configurations: There are four different antenna configurations that can be used to transmit and receive data. See radio_controller.h for details on the different modes.

Transmitting and Receiving Data: Firstly enable transmit mode on the radio by calling TxEnable(...). Then the amplifier should be switched on. If the center frequency is the 2.4 GHz range then select 24AmpEnable(...) while if in the 5 Ghz range use 5AmpEnable(...). The data to be transmitted should be on the radio_bridge ports user_DAC_I and user_DAC_Q. After the transmission is completed the amplifier should be disabled and the transmit should be disabled. For receiving data, use RxEnable(...) and the data would be available on the user_ADC_I and user_ADC_Q ports.