LTC5566 - 300MHz to 6GHz Dual Programmable Gain Downconverting Mixer

Features

  • 12dB Power Conversion Gain
  • 35dBm Output IP3
  • 15.5dB Range IF DVGA in 0.5dB Steps
  • Programmable RF Input Tuning
  • Reduced Power Mode
  • 3.3V Single Supply
  • Simple SPI for Fast Development
  • –40°C to 105°C Operation (TC)
  • Very Small Solution Size
  • 32-Lead (5mm × 5mm) QFN Package

Typical Application

LTC5566 Typical Application
LTC5566 Typical Application

Description

The LTC®5566 dual programmable gain downconverting mixer is ideal for diversity and MIMO receivers that require precise gain setting. Each channel incorporates an active mixer and a digital IF VGA with 15.5dB gain control range. The IF gain of each channel is programmed in 0.5dB steps through the SPI.

Programmable RF input tuning via the SPI or parallel control lines makes the device attractive for wideband radio applications. Furthermore, a reduced power mode is available, programmed through the SPI.

Integrated RF transformers provide single-ended 50Ω inputs. The differential LO input is designed for single-ended or differential drive. The differential IF output simplifies the interface to differential IF filters and amplifiers. The mixers are optimized for use up to 5GHz but may be used up to 6GHz with degraded performance.

Packaging

For complete and up to date package information and drawings, please refer to our packaging page

Part Number Package Code Temp Package
Drawing
RoHS
LTC5566IUH#PBF 5x5 QFN-32 UH I 05-08-1693 Yes
LTC5566IUH#TRPBF 5x5 QFN-32 UH I 05-08-1693 Yes


LTC5566 Package Drawing

Order Info

  • Part numbers ending in PBF are lead free. Solder plated terminal finish (SnPb) versions are non-standard and special terms and conditions and pricing applies if available. Please contact LTC marketing for information.
  • Part numbers containing TR or TRM are shipped in tape and reel or 500 unit mini tape and reel, respectively
  • Please refer to our general ordering information or the product datasheet for more details

Package Variations and Pricing

Part Number Package Temp Price
(1-99)
Price
(1k)*
RoHS
LTC5566IUH#PBF 5x5 QFN-32 I $13.43 $9.45 Yes
LTC5566IUH#TRPBF 5x5 QFN-32 I $13.48 $9.50 Yes
Buy NowRequest Samples
* The USA list pricing shown is for BUDGETARY USE ONLY, shown in United States dollars (FOB USA per unit for the stated volume), and is subject to change. International prices may differ due to local duties, taxes, fees and exchange rates. For volume-specific price or delivery quotes, please contact your local Linear Technology sales office or authorized distributor.

Demo Boards

Linear Technology offers many demo boards free of charge to qualified customers. Contact your local sales office or distributor to inquire about a demo board. Certain demo boards are also available for sale via credit card on this website. Demo boards are for evaluation purposes only. It remains the customer’s responsibility to verify proper and reliable operation in the actual end application.

Click here to view our complete list of demo boards

Applications

  • 4G and 5G MIMO Receivers
  • Diversity Receivers
  • Distributed Antenna Systems (DAS)
  • Network Test/Monitoring Equipment
  • Software-Defined Radios

Product Notifications

Please login to your MyLinear account for notifications of datasheet updates, new document releases and LTspice model announcements for your favorite products. If you do not have a MyLinear account you may Sign Up Now.

Forgot your password? Click here.
Need help? Email mylinear@linear.com with questions and comments.

Design Tools

Linduino

Linduino is an Arduino compatible platform for developing and distributing firmware libraries and code for SPI and I²C-compatible integrated circuits. The Linduino One board interfaces to more than 300 QuikEval demonstration cards, supporting a variety of product types including analog-to-digital converters (ADCs)digital-to-analog converters (DACs)power monitors, and more. Firmware libraries for individual devices are written in C and designed to be portable to a wide variety of processors and microcontrollers. Each library has a demonstration program that can be uploaded to the Linduino One platform to allow the circuit and software to be quickly and easily verified.

Click here for more information on Linduino

Code

Linduino is Linear Technology's Arduino compatible system for developing and distributing firmware libraries and example code for Linear Technology’s integrated circuits. The code below can be downloaded or copied and pasted into your project. Please visit the Linduino Home Page for demo board, manual and setup information.

This part is Code Supported: There is example code available for this part. The code below may rely on other drivers available in the full library.

Download LTC5566 - DC2406A.ino

/*!
Linear Technology DC2460A Demonstration Board
LTC5566: Dual Programmable Gain Downconverting Mixer

@verbatim

The LTC5566 dual programmable gain downconverting mixer
is ideal for diversity and MIMO receivers that require precise
gain setting. Each channel incorporates an active mixer and a
digital IF VGA with 15.5dB gain control range. The IF gain of
each channel is programmed in 0.5dB steps through the SPI.

USER INPUT DATA FORMAT:
 decimal : 1024
 hex     : 0x400
 octal   : 02000  (leading 0 "zero")
 binary  : B10000000000
 float   : 1024.0


@endverbatim

http://www.linear.com/product/LTC5566

http://www.linear.com/product/LTC5566#demoboards

REVISION HISTORY
$Revision: 5670 $
$Date: 2016-09-02 10:55:41 -0700 (Fri, 02 Sep 2016) $

Copyright (c) 2013, Linear Technology Corp.(LTC)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of Linear Technology Corp.

The Linear Technology Linduino is not affiliated with the official Arduino team.
However, the Linduino is only possible because of the Arduino team's commitment
to the open-source community.  Please, visit http://www.arduino.cc and
http://store.arduino.cc , and consider a purchase that will help fund their
ongoing work.
*/

/*! @file
    @ingroup LTC5566
*/

#include "LTC5566.h"
#include "LT_SPI.h"
#include "UserInterface.h"
#include "Linduino.h"
#include <SPI.h>

// Function Declarations
void LTC5566_print_title();                 // Print the title block
void LTC5566_print_prompt();                // Print the prompt block

//! Initialize Linduino
void setup()
{
  quikeval_SPI_init();              // Configure the spi port for 4MHz SCK
  Serial.begin(115200);             // Initialize the serial port to the PC
  LTC5566_print_title();            // Displays the title
  LTC5566_print_prompt();           // Displays the initial prompt
}

//! Repeats Linduino loop
void loop()
{
  uint8_t user_command;             // The user input command
  uint16_t output_register;         // The register value read back from the LTC5566
  uint8_t byte_1;                   // Dummy variable for decoding Mixer 1's register value
  uint8_t byte_2;                   // Dummy variable for decoding Mixer 2's register value
  if (Serial.available())           // Check for user input
  {
    user_command = read_int();      // Read the user command
    Serial.println(user_command);   // Print the command to the screen
    switch (user_command)
    {
      case 1:
        output_register = LTC5566_dupl_settings();  // Run the duplicate settings function
        Serial.println(F("\n\n\nLTC5566 settings:\n"));
        LTC5566_decode_output(output_register);     // Decode the resulting value
        break;
      case 2:
        output_register = LTC5566_diff_settings();  // Run the different settings function
        byte_1 = output_register & 0xFF;            // Pick off least significant 8 bits for decoding
        byte_2 = output_register >> 8;              // Pick off most significant 8 bits for decoding
        Serial.println(F("\n\n\nMixer 1 settings:\n"));
        LTC5566_decode_output(byte_1);              // Decode the resulting value
        Serial.println(F("\n\n\nMixer 2 settings:\n"));
        LTC5566_decode_output(byte_2);              // Decode the resulting value
        break;
      default:
        Serial.println(F("\n\nIncorrect Option\n"));
    }
    Serial.println(F("\n*****************************************************************\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"));
    LTC5566_print_prompt();
  }
}

//! Print the title block
void LTC5566_print_title()
{
  Serial.println(F("*****************************************************************"));
  Serial.println(F("* DC2460A Demonstration Program                                 *"));
  Serial.println(F("*                                                               *"));
  Serial.println(F("* This program demonstrates how to send data to the LTC5566.    *"));
  Serial.println(F("*****************************************************************"));
}

//! Prints the main menu
void LTC5566_print_prompt()
{
  Serial.println(F("\n1. Same settings for Channels A and B"));
  Serial.println(F("2. Different settings for Channels A and B\n"));
  Serial.print(F("Enter a command: "));
}

Download LTC5566 Linduino Header File

/*!
LTC5566: Dual Programmable Gain Downconverting Mixer

@verbatim

The LTC5566 dual programmable gain downconverting mixer
is ideal for diversity and MIMO receivers that require precise
gain setting. Each channel incorporates an active mixer and a
digital IF VGA with 15.5dB gain control range. The IF gain of
each channel is programmed in 0.5dB steps through the SPI.

SPI DATA FORMAT (MSB First):

            Byte #1                                                  Byte #2
Data In  :  RP2 RT2[1] RT2[0] IF2[4] IF2[3] IF2[2] IF2[1] IF2[0]     RP1 RT1[1] RT1[0] IF1[4] IF1[3] IF1[2] IF1[1] IF1[0]
            |---- ATT, TUNE, POWER CONTROL WORD FOR MIXER 2 ---|     |---- ATT, TUNE, POWER CONTROL WORD FOR MIXER 1 ---|

RPx : Reduced Power Mode Bit
RTx : RF Input Tune Control Bits
IFx : IF Attenuation Control Bits

@endverbatim

http://www.linear.com/product/LTC5566

http://www.linear.com/product/LTC5566#demoboards

REVISION HISTORY
$Revision: 5670 $
$Date: 2016-09-02 10:55:41 -0700 (Fri, 02 Sep 2016) $

Copyright (c) 2013, Linear Technology Corp.(LTC)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of Linear Technology Corp.

The Linear Technology Linduino is not affiliated with the official Arduino team.
However, the Linduino is only possible because of the Arduino team's commitment
to the open-source community.  Please, visit http://www.arduino.cc and
http://store.arduino.cc , and consider a purchase that will help fund their
ongoing work.
*/

/*! @file
    @ingroup LTC5566
    Header for LTC5566: Dual Programmable Gain Downconverting Mixer
*/

#ifndef LTC5566_H
#define LTC5566_H

#include <SPI.h>

//! Define the SPI CS pin
#ifndef LTC5566_CS
#define LTC5566_CS QUIKEVAL_CS
#endif

//! @name LTC5566 reduced power mode configuration bit.
//! @{
// reduced power mode configuration bit.
#define LTC5566_FULL_POWER      0x00
#define LTC5566_REDUCED_POWER   0x80
//! @}

//! @name LTC5566 shutdown/powerup and GPO configuration bits.
//! @{
// shutdown/powerup and GPO configuration bits.
#define LTC5566_RF_TUNE_00      0x00
#define LTC5566_RF_TUNE_01      0x20
#define LTC5566_RF_TUNE_10      0x40
#define LTC5566_RF_TUNE_11      0x60
//! @}

//! @name LTC5566 gain configuration bits.
//! @{
// gain configuration bits.
#define LTC5566_ATT_0_0dB      0x00
#define LTC5566_ATT_0_5dB      0x01
#define LTC5566_ATT_1_0dB      0x02
#define LTC5566_ATT_1_5dB      0x03
#define LTC5566_ATT_2_0dB      0x04
#define LTC5566_ATT_2_5dB      0x05
#define LTC5566_ATT_3_0dB      0x06
#define LTC5566_ATT_3_5dB      0x07
#define LTC5566_ATT_4_0dB      0x08
#define LTC5566_ATT_4_5dB      0x09
#define LTC5566_ATT_5_0dB      0x0A
#define LTC5566_ATT_5_5dB      0x0B
#define LTC5566_ATT_6_0dB      0x0C
#define LTC5566_ATT_6_5dB      0x0D
#define LTC5566_ATT_7_0dB      0x0E
#define LTC5566_ATT_7_5dB      0x0F
#define LTC5566_ATT_8_0dB      0x10
#define LTC5566_ATT_8_5dB      0x11
#define LTC5566_ATT_9_0dB      0x12
#define LTC5566_ATT_9_5dB      0x13
#define LTC5566_ATT_10_0dB     0x14
#define LTC5566_ATT_10_5dB     0x15
#define LTC5566_ATT_11_0dB     0x16
#define LTC5566_ATT_11_5dB     0x17
#define LTC5566_ATT_12_0dB     0x18
#define LTC5566_ATT_12_5dB     0x19
#define LTC5566_ATT_13_0dB     0x1A
#define LTC5566_ATT_13_5dB     0x1B
#define LTC5566_ATT_14_0dB     0x1C
#define LTC5566_ATT_14_5dB     0x1D
#define LTC5566_ATT_15_0dB     0x1E
#define LTC5566_ATT_15_5dB     0x1F
//! @}

//! Writes to the LTC5566 twice and reads back the last two bytes to make sure
//! the LTC5566 was loaded properly
//! @return void
void LTC5566_write(uint8_t cs,                  //! Chip Select pin
                   uint16_t tx,                 //! Word to be transmitted
                   uint16_t *rx                 //! Output pointer
                  );

//! Function to duplicate settings for both LTC5566 channels
//! @return @tbd
uint8_t LTC5566_dupl_settings();

//! Function to apply unique settings for each LTC5566 channel
//! @return @tbd
uint16_t LTC5566_diff_settings();

//! Function to get data from user for power mode
//! @return @tbd
uint8_t LTC5566_get_power_mode(char *prompt   //! @tbd
                              );

//! Function to get data from user for RF input tune mode
//! @return @tbd
uint8_t LTC5566_get_tune_mode(char *prompt    //! @tbd
                             );

//! Function to get data from user for IF attenuation
//! @return @tbd
uint8_t LTC5566_get_att(char *prompt      //! @tbd
                       );

//! Decode the register value read from the LTC5555
//! @return void
void LTC5566_decode_output(uint8_t output   //! @tbd
                          );

#endif  // LTC5566_H

Download LTC5566 Linduino.CPP File

/*!
LTC5566: Dual Programmable Gain Downconverting Mixer

@verbatim

The LTC5566 dual programmable gain downconverting mixer
is ideal for diversity and MIMO receivers that require precise
gain setting. Each channel incorporates an active mixer and a
digital IF VGA with 15.5dB gain control range. The IF gain of
each channel is programmed in 0.5dB steps through the SPI.

@endverbatim

http://www.linear.com/product/LTC5566

http://www.linear.com/product/LTC5566#demoboards

REVISION HISTORY
$Revision: 5670 $
$Date: 2016-09-02 10:55:41 -0700 (Fri, 02 Sep 2016) $

Copyright (c) 2013, Linear Technology Corp.(LTC)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of Linear Technology Corp.

The Linear Technology Linduino is not affiliated with the official Arduino team.
However, the Linduino is only possible because of the Arduino team's commitment
to the open-source community.  Please, visit http://www.arduino.cc and
http://store.arduino.cc , and consider a purchase that will help fund their
ongoing work.
*/

//! @defgroup LTC5566 LTC5566: Dual Programmable Gain Downconverting Mixer

/*! @file
    @ingroup LTC5566
    Library for LTC5566: Dual Programmable Gain Downconverting Mixer
*/

#include "LTC5566.h"
#include "LT_SPI.h"
#include "UserInterface.h"
#include "Linduino.h"
#include <SPI.h>

// Global Variables
uint8_t mixer_1_value;                                                  // 8 control bits for mixer 1 (1/2 of the register)
uint8_t mixer_2_value;                                                  // 8 control bits for mixer 2 (1/2 of the register)
uint16_t whole_register;                                                // 16 bit register for writing to the part
uint16_t output;                                                        // 16 bit output from the part
uint8_t mixer_1_output;                                                 // 8 bits read from the LTC5566's internal register
uint8_t mixer_2_output;                                                 // 8 bits read from the LTC5566's internal register

// Writes to the LTC5566 twice and reads back the last two bytes to make sure the LTC5566 was loaded properly
void LTC5566_write(uint8_t cs,  uint16_t tx, uint16_t *rx)
{
  spi_transfer_word(cs, tx, rx);                                        // Transfer 2 bytes
  spi_transfer_word(cs, tx, rx);                                        // Transfer 2 bytes
}

// Take inputs and apply same settings to both mixer channels
uint8_t LTC5566_dupl_settings()
{
  uint8_t power_bit;                                                    // Bit for controlling the LTC5566's power mode
  char *power_prompt = "Enter a command: ";                             // Prompt for getting power mode
  uint8_t tune_bits;                                                    // Bit for controlling the LTC5566's RF input tune mode
  char *tune_prompt = "\nDesired RF Input Tune setting: ";              // Prompt for getting tune mode
  uint8_t att_bits;                                                     // Bit for controlling the LTC5566's IF attenuation
  char *att_prompt = "\nDesired IF Attenuation (dB): ";                 // Prompt for getting att level
  uint8_t output_register;

  power_bit = LTC5566_get_power_mode(power_prompt);                     // Get power mode bit
  tune_bits = LTC5566_get_tune_mode(tune_prompt);                       // Get RF input tune mode
  att_bits = LTC5566_get_att(att_prompt);                               // Get IF attenuation level

  mixer_1_value = ((power_bit | tune_bits) | att_bits);                 // Build mixer command byte
  whole_register = mixer_1_value;                                       // Load the register command with the first command byte
  whole_register  = whole_register << 8;                                // Shift the first command byte up to the most significant byte
  whole_register = whole_register | mixer_1_value;                      // Load the least significant byte with the mixer command byte

  LTC5566_write(LTC5566_CS, whole_register, &output);                   // Send the data to the LTC5566 and read back the previously loaded value

  output_register = output & 0xFF;                                      // Truncate to 8 bits since the registers received the same settings
  return output_register;                                               // Return the register's value to the main program
}

// Take inputs and apply different settings to each Mixer Channel
uint16_t LTC5566_diff_settings()
{
  uint8_t power_1_bit;                                                  // Bit for controlling the LTC5566's power mode (Channel 1)
  char *power_1_prompt = "Enter a command for Channel 1: ";             // Prompt for getting power mode (Channel 1)
  uint8_t power_2_bit;                                                  // Bit for controlling the LTC5566's power mode (Channel 2)
  char *power_2_prompt = "Enter a command for Channel 2: ";             // Prompt for getting power mode (Channel 2)
  uint8_t tune_1_bits;                                                  // Bit for controlling the LTC5566's RF input tune mode (Channel 1)
  char *tune_1_prompt = "\nDesired Channel 1 RF Input Tune setting: ";  // Prompt for getting tune mode (Channel 1)
  uint8_t tune_2_bits;                                                  // Bit for controlling the LTC5566's RF input tune mode (Channel 2)
  char *tune_2_prompt = "\nDesired Channel 2 RF Input Tune setting: ";  // Prompt for getting tune mode (Channel 2)
  uint8_t att_1_bits;                                                   // Bit for controlling the LTC5566's IF attenuation (Channel 1)
  char *att_1_prompt = "\nDesired Channel 1 IF Attenuation (dB): ";     // Prompt for getting att level (Channel 1)
  uint8_t att_2_bits;                                                   // Bit for controlling the LTC5566's IF attenuation (Channel 2)
  char *att_2_prompt = "\nDesired Channel 2 IF Attenuation (dB): ";     // Prompt for getting att level (Channel 2)

  power_1_bit = LTC5566_get_power_mode(power_1_prompt);                 // Get channel 1 power mode bit
  power_2_bit = LTC5566_get_power_mode(power_2_prompt);                 // Get channel 2 power mode bit
  tune_1_bits = LTC5566_get_tune_mode(tune_1_prompt);                   // Get RF1 input tune mode
  tune_2_bits = LTC5566_get_tune_mode(tune_2_prompt);                   // Get RF2 input tune mode
  att_1_bits = LTC5566_get_att(att_1_prompt);                           // Get IF1 attenuation level
  att_2_bits = LTC5566_get_att(att_2_prompt);                           // Get IF2 attenuation level

  mixer_1_value = ((power_1_bit | tune_1_bits) | att_1_bits);           // Build mixer 1 command byte
  mixer_2_value = ((power_2_bit | tune_2_bits) | att_2_bits);           // Build mixer 2 command byte
  whole_register = mixer_2_value;                                       // Load the register command with channel 2's command byte
  whole_register  = whole_register << 8;                                // Shift channel 2's command byte up to the most significant byte
  whole_register = whole_register | mixer_1_value;                      // Load the least significant byte with channel 1's command byte

  LTC5566_write(LTC5566_CS, whole_register, &output);                   // Send the data to the LTC5566 and read back the previously loaded value
  return output;                                                        // Return the register's value to the main program
}

// Get power mode value from user
uint8_t LTC5566_get_power_mode(char *prompt)
{
  int keep_looping = 0;                                                 // Variable to break out of while loop
  int8_t power_command;                                                 // The user command for power mode
  uint8_t power_bit = LTC5566_FULL_POWER;                               // Bits for controlling the LTC5566's power mode
  while (1)
  {
    keep_looping = 0;
    Serial.println(F("\n\n1. Full Power Mode"));
    Serial.println(F("2. Low Power Mode\n"));
    Serial.print(prompt);
    power_command = read_int();                                         // Take input from the user
    Serial.println(power_command);                                      // Prints the user command to com port
    switch (power_command)
      // Act on user input
    {
      case 1:
        power_bit = LTC5566_FULL_POWER;                                 // Set the power bit to full power
        break;
      case 2:
        power_bit = LTC5566_REDUCED_POWER;                              // Set the power bit to reduced power
        break;
      default:
        Serial.println(F("\n\nIncorrect Option\n"));                    // User input was wrong, ask again
        keep_looping = 1;
    }
    if (keep_looping == 0)
    {
      return power_bit;                                                 // Return power bit value to the main program
    }
  }
}

// Get RF input tune mode value from user
uint8_t LTC5566_get_tune_mode(char *prompt)
{
  int keep_looping = 0;                                                 // Variable to break out of while loop
  int8_t tune_command;                                                  // The user command for RF input tune mode
  uint8_t tune_bits = LTC5566_RF_TUNE_11;                               // Bits for controlling the LTC5566's RF input tune mode
  while (1)
  {
    keep_looping = 0;
    Serial.println(F("\n1. RF Tune 00 (3.1GHz - 5.1GHz)"));
    Serial.println(F("2. RF Tune 01 (1.8GHz - 4.4GHz)"));
    Serial.println(F("3. RF Tune 10 (1.3GHz - 3.9GHz)"));
    Serial.println(F("4. RF Tune 11 (Less than 1.3GHz)"));
    Serial.print(prompt);
    tune_command = read_int();                                          // Take input from the user
    Serial.println(tune_command);                                       // Prints the user command to com port
    switch (tune_command)
      // Act on user input
    {
      case 1:
        tune_bits = LTC5566_RF_TUNE_00;                                 // Set the RF input tune bits to 00
        break;
      case 2:
        tune_bits = LTC5566_RF_TUNE_01;                                 // Set the RF input tune bits to 01
        break;
      case 3:
        tune_bits = LTC5566_RF_TUNE_10;                                 // Set the RF input tune bits to 10
        break;
      case 4:
        tune_bits = LTC5566_RF_TUNE_11;                                 // Set the RF input tune bits to 11
        break;
      default:
        Serial.println(F("\n\nIncorrect Option\n"));                    // User input was wrong, ask again
        keep_looping = 1;
    }
    if (keep_looping == 0)
    {
      return tune_bits;                                                 // Return tune bits value to the main program
    }
  }
}

// Get attenuation value from user
uint8_t LTC5566_get_att(char *prompt)
{
  int keep_looping = 0;                                                 // Variable to break out of while loop
  float att_command;                                                    // The user command for IF attenuation level
  uint8_t att_bits;                                                     // Bit for controlling the LTC5566's IF attenuation
  while (1)
  {
    keep_looping = 0;
    Serial.print(prompt);
    att_command = read_float();
    Serial.println(att_command, 1);                                     // Prints the user command to com port
    att_command = round(att_command * 2);                               // Converts the attenuation input to an integer from 1-32 so a switch-case statement can be used
    switch ((uint8_t)att_command)
    {
      case 0:
        att_bits = LTC5566_ATT_0_0dB;                                   // Set the IF attenuation to 0.0dB
        break;
      case 1:
        att_bits = LTC5566_ATT_0_5dB;                                   // Set the IF attenuation to 0.5dB
        break;
      case 2:
        att_bits = LTC5566_ATT_1_0dB;                                   // Set the IF attenuation to 1.0dB
        break;
      case 3:
        att_bits = LTC5566_ATT_1_5dB;                                   // Set the IF attenuation to 1.5dB
        break;
      case 4:
        att_bits = LTC5566_ATT_2_0dB;                                   // Set the IF attenuation to 2.0dB
        break;
      case 5:
        att_bits = LTC5566_ATT_2_5dB;                                   // Set the IF attenuation to 2.5dB
        break;
      case 6:
        att_bits = LTC5566_ATT_3_0dB;                                   // Set the IF attenuation to 3.0dB
        break;
      case 7:
        att_bits = LTC5566_ATT_3_5dB;                                   // Set the IF attenuation to 3.5dB
        break;
      case 8:
        att_bits = LTC5566_ATT_4_0dB;                                   // Set the IF attenuation to 4.0dB
        break;
      case 9:
        att_bits = LTC5566_ATT_4_5dB;                                   // Set the IF attenuation to 4.5dB
        break;
      case 10:
        att_bits = LTC5566_ATT_5_0dB;                                   // Set the IF attenuation to 5.0dB
        break;
      case 11:
        att_bits = LTC5566_ATT_5_5dB;                                   // Set the IF attenuation to 5.5dB
        break;
      case 12:
        att_bits = LTC5566_ATT_6_0dB;                                   // Set the IF attenuation to 6.0dB
        break;
      case 13:
        att_bits = LTC5566_ATT_6_5dB;                                   // Set the IF attenuation to 6.5dB
        break;
      case 14:
        att_bits = LTC5566_ATT_7_0dB;                                   // Set the IF attenuation to 7.0dB
        break;
      case 15:
        att_bits = LTC5566_ATT_7_5dB;                                   // Set the IF attenuation to 7.5dB
        break;
      case 16:
        att_bits = LTC5566_ATT_8_0dB;                                   // Set the IF attenuation to 8.0dB
        break;
      case 17:
        att_bits = LTC5566_ATT_8_5dB;                                   // Set the IF attenuation to 8.5dB
        break;
      case 18:
        att_bits = LTC5566_ATT_9_0dB;                                   // Set the IF attenuation to 9.0dB
        break;
      case 19:
        att_bits = LTC5566_ATT_9_5dB;                                   // Set the IF attenuation to 9.5dB
        break;
      case 20:
        att_bits = LTC5566_ATT_10_0dB;                                  // Set the IF attenuation to 10.0dB
        break;
      case 21:
        att_bits = LTC5566_ATT_10_5dB;                                  // Set the IF attenuation to 10.5dB
        break;
      case 22:
        att_bits = LTC5566_ATT_11_0dB;                                  // Set the IF attenuation to 11.0dB
        break;
      case 23:
        att_bits = LTC5566_ATT_11_5dB;                                  // Set the IF attenuation to 11.5dB
        break;
      case 24:
        att_bits = LTC5566_ATT_12_0dB;                                  // Set the IF attenuation to 12.0dB
        break;
      case 25:
        att_bits = LTC5566_ATT_12_5dB;                                  // Set the IF attenuation to 12.5dB
        break;
      case 26:
        att_bits = LTC5566_ATT_13_0dB;                                  // Set the IF attenuation to 13.0dB
        break;
      case 27:
        att_bits = LTC5566_ATT_13_5dB;                                  // Set the IF attenuation to 13.5dB
        break;
      case 28:
        att_bits = LTC5566_ATT_14_0dB;                                  // Set the IF attenuation to 14.0dB
        break;
      case 29:
        att_bits = LTC5566_ATT_14_5dB;                                  // Set the IF attenuation to 14.5dB
        break;
      case 30:
        att_bits = LTC5566_ATT_15_0dB;                                  // Set the IF attenuation to 15.0dB
        break;
      case 31:
        att_bits = LTC5566_ATT_15_5dB;                                  // Set the IF attenuation to 15.5dB
        break;
      default:                                                          // User input was wrong, ask again
        Serial.println(F("\n\nIncorrect Option - Choose a number between 0 and 15.5dB in 0.5dB increments\n"));
        keep_looping = 1;
    }
    if (keep_looping == 0)
    {
      return att_bits;                                                  // Return att bits value to the main program
    }
  }
}

// Decode the register value read from the LTC5566
void LTC5566_decode_output(uint8_t output_register)
{
  uint8_t power_bit_read;                                               // Power bit read back from the LTC5566
  String power_setting_read;                                            // Power setting read back from the LTC5566
  uint8_t tune_bits_read;                                               // Tune bits read back from the LTC5566
  String tune_setting_read;                                             // RF Tune setting read back from the LTC5566
  uint8_t att_bits_read;                                                // Att bits read back from the LTC5566
  String att_setting_read;                                              // Attenuation setting read back from the LTC5566

  power_bit_read = (output_register & 0x90) >> 7;                       // Read bit 7 to get power bit back
  switch (power_bit_read)
  {
    case 0:
      power_setting_read = "Full Power";                                // The LTC5566 was in Full Power mode
      break;
    case 1:
      power_setting_read = "Low Power";                                 // The LTC5566 was in Low Power mode
      break;
  }
  Serial.println("Power Setting: " + power_setting_read);               // Print the Power setting to the serial monitor

  tune_bits_read = (output_register & 0x60) >> 5;                       // Read bits 5 and 6 to get RF tune bits back
  switch (tune_bits_read)
  {
    case 0:
      tune_setting_read = "RF Tune 00 (3.1GHz - 5.1GHz)";
      break;
    case 1:
      tune_setting_read = "RF Tune 01 (1.8GHz - 4.4GHz)";
      break;
    case 2:
      tune_setting_read = "RF Tune 10 (1.3GHz - 3.9GHz)";
      break;
    case 3:
      tune_setting_read = "RF Tune 11 (Less than 1.3GHz)";
      break;
  }
  Serial.println("RF Input Setting: " + tune_setting_read);             // Print the RF Tune setting to the serial monitor

  att_bits_read = output_register & 0x1F;                               // Read bits 0-4 to get attenuation bits back
  switch (att_bits_read)
  {
    case 0:
      att_setting_read = "0dB";
      break;
    case 1:
      att_setting_read = "0.5dB";
      break;
    case 2:
      att_setting_read = "1dB";
      break;
    case 3:
      att_setting_read = "1.5dB";
      break;
    case 4:
      att_setting_read = "2dB";
      break;
    case 5:
      att_setting_read = "2.5dB";
      break;
    case 6:
      att_setting_read = "3dB";
      break;
    case 7:
      att_setting_read = "3.5dB";
      break;
    case 8:
      att_setting_read = "4dB";
      break;
    case 9:
      att_setting_read = "4.5dB";
      break;
    case 10:
      att_setting_read = "5dB";
      break;
    case 11:
      att_setting_read = "5.5dB";
      break;
    case 12:
      att_setting_read = "6dB";
      break;
    case 13:
      att_setting_read = "6.5dB";
      break;
    case 14:
      att_setting_read = "7dB";
      break;
    case 15:
      att_setting_read = "7.5dB";
      break;
    case 16:
      att_setting_read = "8dB";
      break;
    case 17:
      att_setting_read = "8.5dB";
      break;
    case 18:
      att_setting_read = "9dB";
      break;
    case 19:
      att_setting_read = "9.5dB";
      break;
    case 20:
      att_setting_read = "10dB";
      break;
    case 21:
      att_setting_read = "10.5dB";
      break;
    case 22:
      att_setting_read = "11dB";
      break;
    case 23:
      att_setting_read = "11.5dB";
      break;
    case 24:
      att_setting_read = "12dB";
      break;
    case 25:
      att_setting_read = "12.5dB";
      break;
    case 26:
      att_setting_read = "13dB";
      break;
    case 27:
      att_setting_read = "13.5dB";
      break;
    case 28:
      att_setting_read = "14dB";
      break;
    case 29:
      att_setting_read = "14.5dB";
      break;
    case 30:
      att_setting_read = "15dB";
      break;
    case 31:
      att_setting_read = "15.5dB";
      break;
  }
  Serial.println("Attenuation Setting: " + att_setting_read);           // Print the Attenuation setting to the serial monitor
}

Technical Support