/*! \page page_usrp_b200 USRP B2x0 Series

\tableofcontents

\section b200_features Comparative features list - B200/B210/B200mini

- Hardware Capabilities:
    -   Integrated RF frontend (70 MHz - 6 GHz)
    -   External PPS reference input
    -   External 10 MHz reference input
    -   Configurable clock rate
    -   Variable analog bandwidth (200 kHz - 56 MHz)
    -   GPIO header
    -   [B200/B210] Internal GPSDO option (see \subpage page_gpsdo_b2x0 for details)
    -   [B210/B200mini] JTAG Connector
    -   [B210] MICTOR Debug Connector
- FPGA Capabilities:
    -   Timed commands in FPGA
    -   Timed sampling in FPGA

\section b200_power Power

In most cases, USB 3.0 bus power will be sufficient to power the device.
If using USB 2.0 or a GPSDO, an external power supply or a cable designed
to pull power from 2 USB ports (USB 3.0 dual A to micro-B or B) must be used.

\section b200_imgs Specifying a Non-standard Image

UHD software will automatically select the USRP B2X0 images from the
installed images package. The image selection can be overridden with the
`fpga` and `fw` device address parameters.

Example device address string representations to specify non-standard
images:

    fpga=usrp_b200_fpga.bin

    -- OR --

    fw=usrp_b200_fw.hex

\section b200_customfpga Custom FPGA images and accessing user settings

The FPGA image is provided in source code and can thus be modified and rebuilt
to serve custom purposes. For example, additional filtering or other DSP
operations can be inserted into the FPGA before or after the DAC or ADC stages,
respectively. Refer to the \ref md_fpga "FPGA Manual" for further information on
how to rebuild the FPGA.

To control user-defined IP, the `USER_SETTINGS` parameter for the `radio_legacy`
block in `b200_core.v` (for B210 and B200) or `b205_core.v` (for the mini
series) need to be set to 1, and radio_legacy.v can then be modified to include
user-defined read and write registers (the file includes examples on how to do
that).
Any customizations will most likely also be applied in radio_legacy.v.

For FPGA images that include user settings registers, UHD provides APIs to
interface with those. To enable access to user settings, apply the
`enable_user_regs` device argument on initialization. Then, use the
uhd::multi_usrp::get_user_settings_iface API call to access an object that
allows modifying the registers. Example:
~~~{.cpp}
auto usrp = multi_usrp::make("type=b200,enable_user_regs");
auto user_regs = usrp->get_user_settings_iface();
user_regs->poke32(addr, data);
~~~

\section b200_mcr Changing the Master Clock Rate

The master clock rate feeds the RF frontends and the DSP chains. Users
may select non-default clock rates to achieve integer decimation rates or
interpolations in the DSP chains. The clock rate can be set to any value
between 5 MHz and 61.44 MHz (or 30.72 MHz for dual-channel mode).
Note that rates above 56 MHz are possible, but not recommended.

The user can set the master clock rate through the usrp API call
uhd::usrp::multi_usrp::set_master_clock_rate(), or the clock rate can be set through the
device arguments, which many applications take:

    uhd_usrp_probe --args="master_clock_rate=52e6"

The property to control the master clock rate is a double value, called `tick_rate`.

\subsection b200_auto_mcr Automatic Clock Rate Setting

The default clock rate setting is to automatically set a clock rate
depending on the requested sampling rate. The automatic clock rate selection
is disabled when either `master_clock_rate` is given in the device initialization
arguments, or when uhd::usrp::multi_usrp::set_master_clock_rate() is called.

Note that the master clock rate must be an integer multiple of the sampling
rate. If a master clock rate is chosen for which this condition does not
hold, a warning will be displayed and a different sampling rate is used internally.

Nevertheless, there are multiple valid values for the master clock rate
for most sampling rates. The auto clock rate selection attempts to use
the largest possible clock rate as to enable as many half-band filters
as possible. Expert users might have cases where a more fine-grained
control over the resampling stages is required, in which case manually
selecting a master clock rate might be more suitable than the automatic
rate.

The property to dis- or enable the auto tick rate is a boolean value,
`auto_tick_rate`.

\section b200_fe RF Frontend Notes

The B200 features an integrated RF frontend.

\subsection b200_fe_tuning Frontend tuning

The RF frontend has individually tunable receive and transmit chains. On
the B200 and B200 mini, there is one transmit and one receive RF frontend. On the
B210, both transmit and receive can be used in a MIMO configuration. For
the MIMO case, both receive frontends share the RX LO, and both transmit
frontends share the TX LO. Each LO is tunable between 50 MHz and 6 GHz.

\subsection b200_fe_gain Frontend gain

All frontends have individual analog gain controls. The receive
frontends have 76 dB of available gain; and the transmit frontends have
89.8 dB of available gain. Gain settings are application specific, but
it is recommended that users consider using at least half of the
available gain to get reasonable dynamic range.

\subsection b200_fe_bw Frontend bandwidth

The analog frontend has a seamlessly adjustable bandwidth of 200 kHz to 56 MHz.

Generally, when requesting any possible master clock rate, UHD will
automatically configure the analog filters to avoid any aliasing (RX) or
out-of-band emissions whilst letting through the cleanest possible signal.

If you, however, happen to have a very strong interferer within half the master
clock rate of your RX LO frequency, you might want to reduce this analog
bandwidth.  You can do so by calling
uhd::usrp::multi_usrp::set_rx_bandwidth(bw).

The property to control the analog RX bandwidth is `bandwidth/value`.

UHD will not allow you to set bandwidths larger than your current master clock
rate.

\subsection b200_fe_power Power API

The B200 series support the UHD power calibration API (see: \ref page_power).
The TX path and the two RX paths have their own calibration data, resulting in
6 sets of calibration data total for the B210, and 3 for all the others.

Devices have to be manually calibrated using a calibrated power meter or
signal generator.

\section b200_hw_ref Hardware Reference

\subsection b200_hw_ref_leds LED Indicators

Below is a table of the B200/B210 LED indicators and their meanings:

<table>
  <tr>
    <th>Component ID</th><th>Description</th><th>Details</th>
  </tr>
  <tr>
    <td>LED600</td> <td>Power Indicator</td> <td>off = no power applied (before rev6, some rev6) / external power applied and not yet initialized (most rev6)<br>
                                                 blue = USB power applied (before rev6) / power supplied (USB) OR power supplied (external) (rev6)<br/>
						 red = external power applied (before rev6) / external power applied and device initialized (rev6)</td>
  </tr>
  <tr>
    <td>LED800</td> <td>Channel 2 RX2 Activity</td> <td>off = no power applied<br>
                                                        green = receiving</td>
  </tr>
  <tr>
    <td>LED801</td> <td>Channel 2 TX/RX Activity</td> <td>off = no activity<br>
                                                          green = receiving<br>
                                                          red = transmitting<br>
                                                          orange = switching between transmitting and receiving</td>
  </tr>
  <tr>
    <td>LED802</td> <td>Channel 1 TX/RX Activity</td> <td>off = no activity<br>
                                                          green = receiving<br>
                                                          red = transmitting<br>
                                                          orange = switching between transmitting and receiving</td>
  </tr>
  <tr>
    <td>LED803</td> <td>Channel 1 RX2 Activity</td> <td>off = no power applied<br>
                                                        green = receiving</td>
  </tr>
  <tr>
    <td>LED100</td> <td>GPS lock indicator</td> <td>off = no lock<br>
                                                    green = lock</td>
  </tr>
</table>

Below is a table of the B200mini LED indicators and their meanings:

<table>
  <tr>
    <th>Component ID</th><th>Description</th><th>Details</th>
  </tr>
  <tr>
    <td>PWR LED</td> <td>Power Indicator</td> <td>off = no power applied<br>
                                                 on = power applied (external or USB)</td>
  </tr>
  <tr>
    <td>TRX LED</td> <td>TX/RX Activity</td> <td>off = no activity<br>
                                                          green = receiving<br>
                                                          red = transmitting<br>
                                                          orange = switching between transmitting and receiving</td>
  </tr>
  <tr>
    <td>RX2 LED</td> <td>RX2 Activity</td> <td>off = no activity<br>
                                                        green = receiving</td>
  </tr>
  <tr>
    <td>S0 LED</td> <td>Reference Lock</td> <td>off = no activity<br>
                                                          green = locked</td>
  </tr>
  <tr>
    <td>S1 LED</td> <td>Reference Present</td> <td>off = reference level low or not present<br>
                                                        green = reference level high</td>
  </tr>
</table>

TX LED indicators are on when transmitting data and off when no samples are
available to transmit.  RX LED indicators are on when sending samples to the
host and off when unable to do so.  This means that TX/RX activity LED
indicators will blink off in a temporary transmit underflow or receive overflow
condition, indicating that the host is not sending or receiving samples fast
enough.  The host will be notified of the condition and output a "U" or "O" as
well.

\subsection b200_hw_ref_ext  External Connections

Below is a table showing the B200/B210 external connections and respective power information:

<table>
<tr>
  <th>Component ID</th> <th>Description</th>            <th> Details</th>
</tr>
<tr>
  <td>J601</td>         <td>External Power</td>         <td>6 V<br>3 A</td>
</tr>
<tr>
  <td>J701</td>         <td>USB Connector</td>          <td>USB 3.0</td>
</tr>
<tr>
  <td>J104</td>         <td>External PPS Input</td>     <td>1.8 V - 5 V</td>
</tr>
<tr>
  <td>J101</td>         <td>GPS Antenna</td>            <td>GPSDO will supply nominal voltage to antenna.</td>
</tr>
<tr>
  <td>J100</td>         <td>External 10 MHz Input</td>  <td>+15 dBm max</td>
</tr>
<tr>
  <td>J800</td>         <td>RF B: TX/RX</td>            <td>TX power +20 dBm max<br>
                                                            RX power -15 dBm max</td>
</tr>
<tr>
  <td>J802</td>         <td>RF B: RX2</td>              <td>RX power -15 dBm max</td>
</tr>
<tr>
  <td>J803</td>         <td>RF A: RX2</td>              <td>RX power -15 dBm max</td>
</tr>
<tr>
  <td>J801</td>         <td>RF A: TX/RX</td>            <td>TX power +20 dBm max<br>
                                                            RX power -15 dBm max</td>
</tr>
</table>

Below is a table showing the B200mini external connections and respective power information:

<table>
<tr>
  <th>Component ID</th> <th>Description</th>            <th> Details</th>
</tr>
<tr>
  <td>USB3</td>         <td>USB Connector</td>          <td>USB 3.0</td>
</tr>
<tr>
  <td>J1</td>           <td>TRX</td>                    <td>TX power +20 dBm max<br>
                                                            RX power -15 dBm max</td>
</tr>
<tr>
  <td>J2</td>           <td>RX2</td>                    <td>RX power -15 dBm max</td>
</tr>
<tr>
  <td>J3</td>           <td>External 10 MHz/PPS Reference</td>  <td>+15 dBm max</td>
</tr>
</table>

\subsection b200_switches On-Board Connectors and Switches

Below is a table showing the B200/B210 on-board connectors and switches:

Component ID            |  Description               | Details
------------------------|----------------------------|---------------------------------------------------
 J502<sup>1</sup>       |  Mictor Connector          | Interface to FPGA for I/O and inspection.
 J503<sup>1</sup>       |  JTAG Header               | Interface to FPGA for programming and debugging.
 J504<sup>2</sup>       |  GPIO Header               | Header connected to the FPGA for GPIO purposes.
 S700                   |  FX3 Hard Reset Switch     | Resets the USB controller / System reset
 U100                   |  GPSDO socket              | Interface to GPS disciplined reference oscillator

<sup>1</sup> Only on the B210

<sup>2</sup> Only since rev. 6 (green board).  GPIO pinout is 1=GPIO_0, 2=GPIO_1, 3=GPIO_2, 4=GPIO_3, 5=GPIO_4, 6=GPIO_5, 7=GPIO_6, 8=GPIO_7, 9=GND, 10=GND

Below is a table showing the B200mini on-board connectors and switches:

Component ID            |  Description               | Details
------------------------|----------------------------|---------------------------------------------------
 J5                     |  JTAG Header               | Interface to FPGA for programming and debugging.
 J6<sup>1</sup>         |  GPIO Header               | Header connected to the FPGA for GPIO purposes.
 SW1                    |  FX3 Hard Reset Switch     | Resets the USB controller / System reset

 <sup>1</sup> GPIO pinout is 1=3.3V, 2=GPIO_0, 3=GPIO_1, 4=GPIO_2, 5=GPIO_3, 6=GND, 7=3.3V, 8=GPIO_4, 9=GPIO_5, 10=GPIO_6, 11=GPIO_7, 12=GND

\section b200_known_issues Known issues

- The B200 and B210 cannot support an external 10 MHz reference if a GPSDO is
  already present on the motherboard. If an external 10 MHz reference is to be
  used, the GPSDO needs to be physically removed from the device beforehand.

- The default streaming settings do not work optimally for all use cases. If
  there are issues with performance or stability, it can help to modify the
  `recv_frame_size` values, e.g., by setting `recv_frame_size=1024` as part of
  the device args.

*/

// vim:ft=doxygen:
