wiki:HardwareUsersGuides/RadioBoard_v1.4/RadioController

Version 30 (modified by sgupta, 17 years ago) (diff)

--

Radio Controller

Error: Failed to load processor NewsFlash
No macro or processor named 'NewsFlash' found

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 and Radio Bridge are EDK peripherals that should be available as options 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

The Radio Controller functions are divided up into four libraries: radio_controller_basic.h, radio_controller_ext.h, radio_controller_adv.h and radio_controller_5ghz.h. To use each of the libraries in your C program, include the following line in the beginning of your code:

 #include "radio_controller_basic.h"
 #include "radio_controller_ext.h"
 ...

These are the functions that are available in each of the files:

radio_controller_basic.h

This library must always be included as it has the initialization functions as well as basic functions such as transmit enable and receive enable. It also has control to change the center frequency of transmission in the 2.4GHz band.

radio_controller_ext.h

This builds on the most basic functions available by allowing the user to change the transmit and receive gains, having finer control of the amplifiers and the transmit enable state machine and controlling the various transmit and recieve filters provided by the radio.

radio_controller_adv.h

This has all the advanced functions for the user. The user can select whether the shutdown, transmit enable and receive enable pins are controlled by software or by hardware ports, power down chips on the board and adjust gains for the digital-to-analog converter.

radio_controller_5ghz.h

Has all the functions related to using the 5GHz ISM band that is covered by the radio.

Inputs to Functions

The inputs to all functions have their descriptions at the beginning of the function calls in the header of the library. One argument to all functions is common:

radios: This refers to the Radio boards that are to be affected by the function call. Each radio board can be selected by RADIO1_ADDR for the board in slot 1, RADIO2_ADDR for slot 2, etc. To call the function on multiple boards at the same time, OR (|) the values with each other. For example, RADIO1_ADDR|RADIO3_ADDR would affect both the radios in slot 1 and 3.

Initialization

Initialization of the Radio boards requires one function call at the beginning of time. WarpRadio_v1_Reset(...), located in radio_controller_basic.h, must be called at the beginning of your main() function so that the radio and DAC can be reset into their default states. The input argument to the the Reset function is the base address of the radio controller peripheral core. 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. None of the other function calls require the base address as the drivers will remember it from the Reset function so make sure that before any other WarpRadio_v1_ functions are used, WarpRadio_v1_Reset(...) has been called.

An example of this would be:

 #include "xparameters.h"
 #include "radio_controller_basic.h"
 .
 . 
 .
 int main() {
    xil_printf("---Entering Main---\r\n");
    WarpRadio_v1_Reset((unsigned int*)XPAR_RADIO_CONTROLLER_0_BASEADDR);
    .
    .
    .
 }

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.