/*! \page page_usrp_b200 USRP B2x0 Series

\tableofcontents

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

- 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
    -   JTAG Connector (except B200)
    -   [B200/B210] Internal GPSDO option (see \subpage page_gpsdo_b2x0 for details)
    -   [B210] MICTOR Debug Connector
- FPGA Capabilities:
    -   Timed commands in FPGA
    -   Timed sampling in FPGA

\section b200_getting_started Getting Started

This will run you through the first steps relevant to getting your USRP B2xx
device up and running.

\subsection kit_contents Kit Contents

- USRP B200/B210/B200mini/B205mini/B206mini
- USB 3.0 Cable
- Universal power supply (B210 only)

\subsection verify_contents Verify the Contents of Your Kit
Make sure that your kit contains all the items listed above. If any items are
missing, please contact your sales agent or Ettus Research Technical support
immediately.

You will need a host computer with a USB2.0 or USB 3.0 port to use the USRP
B2xx.

\subsection care_and_handling Proper Care and Handling
All Ettus Research products are individually tested before shipment. The USRP™
is guaranteed to be functional at the time it is received by the customer.
Improper use or handling of the USRP™ can easily cause the device to become
non-functional. Listed below are some examples of actions which can prevent
damage to the unit:

- Never allow metal objects to touch the circuit board while powered.
- Always properly terminate the transmit port with an antenna or 50 Ohms load.
- Always handle the board with proper anti-static methods.
- Never allow the board to directly or indirectly come into contact with any
voltage spikes.
- Never allow any water, or condensing moisture, to come into contact with the boards.
- Always use caution with FPGA, firmware, or software modifications.

Some warnings to prevent damage to the device:
- Never apply more than -15 dBm of power into any RF input.
- Always use at least 30 dB attenuation if operating in loopback configuration.

\subsection getting_started_tutorials Getting Started with B206mini Tutorials
To learn how to set up the USRP Hardware Driver (UHD), and use UHD to acquire 
an RF spectrum using the B206 follow the [Getting Started with USRP Products](https://ni.com/usrp-getting-started) tutorials.

\subsection install_software_tools Install and Setup the Software Tools on Your Host Computer
In order to use your Universal Software Radio Peripheral (USRP™), you must have
the software tools correctly installed and configured on your host computer.
Download and install UHD on your host computer following \ref page_install_binary or
\ref page_build_guide. The following minimum UHD versions are required:

- The USRP B2xx other than B206mini require UHD version 3.8.4 or above.
- The USRP B206mini requires UHD version 4.9 or above.

It is generally recommended to use the latest UHD version.

\subsection connect_device Connect the USRP to the Host Computer
The included USB 3.0 cable provides power and data connectivity for the
USRP Bus Series. The shipping kits include appropriate USB 3 cables to connect
the B200/B210, B200mini, or B205mini to an available USB 3.0 (or 2.0) Type-A 
port on the host computer. The B206mini shipping kit includes a USB 3.2 Gen 1 
Type-C cable, designed for connection to USB 3 Type-C ports on the host 
computer. It also features a USB Type-C connector with a locking screw, 
which when used with the optional enclosure and matching threaded insert, 
provides added strain relief for secure and stable operation.

Note: If a GPSDO module is installed (B200/210 only) or when using USB 2.0, an
external DC power supply or a cable designed to pull power from 2 USB ports
(USB 2.0 dual A to micro-B or B) must be used.

Note: The cables for the B200-Series USRP have different device-side USB
connectors. Before attempting to use custom 3rd party USB 3 cables ensure they
have the required device side USB connector:
- B200/B210: USB Type B connector
- B200mini/B205mini:	USB Micro B Superspeed connector
- B206mini:	USB Type C connector

\subsection verify_device_operation Test and Verify the Operation of the USRP
Once the software tools are installed on the host computer, verify the
correct operation of the USRP by running the utility programs on the host
computer. More information is available at the
[Verifying the Operation of the USRP Using UHD and GNU Radio](https://kb.ettus.com/Verifying_the_Operation_of_the_USRP_Using_UHD_and_GNU_Radio)
Application Note.

\subsection technical_support Technical Support and Community Knowledge Base
Please contact [Technical Support](https://kb.ettus.com/Technical_Support), for
any questions or issues with your USRP.

\section b200_imgs Specifying a Non-standard Image

UHD software will automatically select the USRP B2XX 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 page_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`.
Example:

~~~{.py}
import uhd
my_usrp = uhd.usrp.MultiUSRP("type=b200")
# The following two lines are synonymous:
my_usrp.set_master_clock_rate(16e6)
my_usrp.get_tree().access_double('/mboards/0/tick_rate').set(16e6)
# Note that if MCR changed, then all time-synchronization is lost!
~~~

Note that changing the master clock rate will reconfigure the entire clocking
chain, thereby losing previous synchronization configurations.

\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. Manual selection of master clock rate may also be required to synchronize
multiple B200 units in time.

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

~~~{.py}
>>> import uhd
>>> my_usrp = uhd.usrp.MultiUSRP("type=b200")
>>> my_usrp.get_tree().access_bool('/mboards/0/auto_tick_rate').get()
True
>>> my_usrp.set_master_clock_rate(16e6) # This will lock the MCR
>>> my_usrp.get_tree().access_bool('/mboards/0/auto_tick_rate').get()
False
>>> U.set_rx_rate(7e6) # Not possible! We locked the MCR.
>>> U.get_rx_rate() # The actual rate is coerced:
8000000.0
>>> my_usrp.get_tree().access_bool('/mboards/0/auto_tick_rate').set(True)
>>> my_usrp.set_rx_rate(7e6) # This requires a new MCR...
>>> my_usrp.get_master_clock_rate() # ...which is chosen automatically.
56000000.0
~~~

\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, B200mini, B205mini and B206mini, 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 B200/205/206mini 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 B200/205/206mini 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>1,2</sup>     |  GPIO Header               | Header connected to the FPGA for GPIO purposes.
 J400<sup>3</sup>       |  GPIO/UART Header          | Header connected to the FPGA for GPIO purposes, or as a serial interface to the FX3 (requires custom FPGA bitfile)
 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). Default voltage is 3.3V. 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

<sup>3</sup> Only since rev. 6 (green board). Default voltage is 1.8V. GPIO pinout is 1=GPIO_8, 2=GND, 3=GPIO_9. When compiling a bitfile to support a UART on this header, pinout is 1=TX, 2=GND, 3=RX.

Below is a table showing the B200/205/206mini 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_resources Additional Documentation

\subsection b200_certifications Product Certifications
- https://www.ni.com/en/support/documentation/product-certifications.html

\subsection b200_specs Specifications
- [B200/B210 Specifications](https://kb.ettus.com/B200/B210/B200mini/B205mini#RF_Specifications)
- [B200mini/205mini Specifications](https://kb.ettus.com/B200/B210/B200mini/B205mini#RF_Specifications)
- [B206mini Specifications](https://www.ni.com/docs/en-US/bundle/usrp-b206mini-i-specs)

\subsection b200_seri Safety, Environmental, and Regulatory Information
- B200/210 - Printout included in hardware shipping kit
- B200mini/205mini - Printout included in hardware shipping kit
- [USRP B206mini-i Safety, Environmental, and Regulatory Information](https://www.ni.com/docs/en-US/bundle/usrp-b206mini-i-seri/resource/usrp-b206mini-i-seri.pdf)

\subsection b200_letter_of_volatility Certificate of Volatility
- [B200/B210 Letter of Volatility](https://www.ni.com/pdf/manuals/377354a.pdf)
- [B200mini/205mini Letter of Volatility](https://www.ni.com/pdf/manuals/377354a.pdf)
- [B206mini Letter of Volatility](https://www.ni.com/docs/en-US/bundle/usrp-b206mini-i-lov/resource/usrp-b206mini-i-lov.pdf)

\subsection b200_enclosure_assembly_instructions Enclosure Assembly Instructions
- B200/210 - Printout included in 'Enclosure Kit for USRP B200/B210'
- B200mini - Printout included in 'Enclosure kit for USRP B205mini-i (I-Grade)' or 'Enclosure kit for USRP B200mini-i (C-Grade)'
- B205mini - Printout included in 'Enclosure kit for USRP B205mini-i (I-Grade)'
- [B206mini-i Enclosure Assembly Instructions](https://ni.com/docs/en-US/bundle/usrp-b206mini-i-getting-started/page/assembling.html)

\subsection b200_hardware Hardware Resources
- [B200/B210/B200mini/B205mini/206mini Motherboard Resources](https://kb.ettus.com/B200/B210/B200mini/B205mini/B206mini)

\section b200_known_issues Known issues

- When synchronizing multiple USRPs in time, it is strongly recommended to
  specify a master clock rate instead of relying on \ref b200_auto_mcr.

- 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:
