| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions | Macros | Variables
DC2430A.ino File Reference

Linear Technology DC2430 Demonstration Board. More...

## Detailed Description

Linear Technology DC2430 Demonstration Board.

    DC590B USB to Serial Controller

    This file contains the routines to emulate the DC590B USB to Serial Converter. All commands
    are supported except Uxxy the Write Port D bus. Added the 'D' delay ms command.
    With this program, the Linduino can be used by the QuikEval program running on a PC
    to communicate with QuikEval compatible demo boards.

    The Kxy bit bang command uses the following pin mappings :
    0-Linduino 2
    1-Linduino 3
    2-Linduino 4
    3-Linduino 5
    4-Linduino 6
    5-Linduino 7

http://www.linear.com/demo/DC2430A

Copyright 2018(c) Analog Devices, Inc.

All rights reserved.

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

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- 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.
- Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- The use of this software may or may not infringe the patent rights of one or more patent holders. This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
- Use of the software either in source or binary form, must be run on or directly connected to an Analog Devices Inc. component.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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.

Definition in file DC2430A.ino.

Go to the source code of this file.

## Functions
char | get_char ()
static void | byte_to_hex (byte value)
byte | read_hex ()
static void | setup ()
| Initialize Linduino. More...
static void | loop ()
| Repeats Linduino loop. More...
static void | DC2430_parallelsync_example ()
| DC2430 PARALLELSYNC EXAMPLE: SOFTWARE SITE SELECTION MODE. More...
static void | Prog_LTC6954_parallelsync_example ()
| This function programs LTC6954-2 SPI registers. More...
static void | Prog_LTC6951_parallelsync_example ()
| Prog_LTC6951_parallelsync_example() This function programs the LTC6951 registers for ParallelSYNC mode. More...
static void | DC2430_testprog ()
| DC2430 TEST SECTION. More...
static void | DC2430_test_supply ()
| Function to check DC2430 voltages generated from the EEVCC and VCCIO Linduion supply voltages. More...
static void | DC2430_test_SYNC ()
| Function to verify that the DC2430 ref to sync circtuiry is functional. More...
static void | DC2430_test_swmode ()
| DC2430_test_swmode() - verified. More...
static void | DC2430_test_manualmode ()
| DC2430_test_manualmode() - verified. More...
static int8_t | discover_demo_board_local (char *demo_name)
| Read the ID string from the EEPROM and determine if the correct board is connected. More...
static void | changeDC2430site (int site_select)
| Function to set DC2430 to a site based on the DC2430_testmode_ctr number. More...

## Macros
#define | READ_TIMEOUT 20
#define | MISO_TIMEOUT 1000
#define | RECORDING_SIZE 50

## Variables
static int | DC2430_testmode_ctr = 0
static int | DC2430_Bin = 1
static int8_t | demo_board_connected = 0
| Demo Board Name stored in QuikEval EEPROM. More...
static int8_t | demo_board_connected_man = 0
| Demo Board Name stored in QuikEval EEPROM. More...
const byte | off = 0
const byte | playback = 1
const byte | spi_mode = 0
const byte | i2c_mode = 1
const byte | i2c_auxiliary_mode = 2
char | hex_digits [16]
const char | spi_divider = SPI_CLOCK_DIV32
byte | serial_mode = spi_mode
byte | recording_mode = off
char | id_string [51] ="USBSPI,PIC,01,01,DC,DC590,----------------------\n\0"
char | hex_to_byte_buffer [5]
char | byte_to_hex_buffer [3]
char | recording_buffer [RECORDING_SIZE]
byte | recording_index = 0
static int | i = 0
unsigned char | pseudo_reset = 0

## Function Documentation

## ◆ byte_to_hex()

static void byte_to_hex | ( | byte | value | ) |
| static

Definition at line 132 of file DC2430A.ino.

## ◆ changeDC2430site()

static void changeDC2430site | ( | int | site_select | ) |
| static

Function to set DC2430 to a site based on the DC2430_testmode_ctr number.

Returns
  void

Definition at line 1020 of file DC2430A.ino.

## ◆ DC2430_parallelsync_example()

static void DC2430_parallelsync_example | ( |  | ) |
| static

DC2430 PARALLELSYNC EXAMPLE: SOFTWARE SITE SELECTION MODE.

- ENABLED BY SELECTING 'B'
- this software example assumes the following
  - DC1954 J12 connected to DC2430 J5
  - DC2248 J12 connected to DC2430 J6
  - DC2248 J12 connected to DC2430 J7
  - all SMA connections described in DC2430 Demo Manual
  - DC2430 JP3 SYNC shorted to DC2430 GPIO7 (default state)
  - All demo boards are powered up (refer to the DC2430 demo manual)
- This function performs the following
  - confirms DC2430 & DC2026 using correct settings
  - selects DC2430 J5 site
  - programs the LTC6954
  - selects DC2430 J6 site
  - programs the LTC6951 #1
  - selects DC2430 J7 site
  - programs the LTC6951 #2
  - Performs ParallelSync, by toggling GPIO7
    Returns
      void

Definition at line 573 of file DC2430A.ino.

## ◆ DC2430_test_manualmode()

static void DC2430_test_manualmode | ( |  | ) |
| static

DC2430_test_manualmode() - verified.

- test site 2 (b010) and site 5 (b101)
- EEPROM and SPI pins on the quick eval connectors work properly
  Returns
    void

Definition at line 945 of file DC2430A.ino.

## ◆ DC2430_test_supply()

static void DC2430_test_supply | ( |  | ) |
| static

Function to check DC2430 voltages generated from the EEVCC and VCCIO Linduion supply voltages.

Returns
  void

Definition at line 748 of file DC2430A.ino.

## ◆ DC2430_test_swmode()

static void DC2430_test_swmode | ( |  | ) |
| static

DC2430_test_swmode() - verified.

- each site can be selected via softward
- EEPROM and SPI pins on the quick eval connectors work properly
  Returns
    void

Definition at line 842 of file DC2430A.ino.

## ◆ DC2430_test_SYNC()

static void DC2430_test_SYNC | ( |  | ) |
| static

Function to verify that the DC2430 ref to sync circtuiry is functional.

Returns
  void

Definition at line 803 of file DC2430A.ino.

## ◆ DC2430_testprog()

static void DC2430_testprog | ( |  | ) |
| static

DC2430 TEST SECTION.

- ENABLED BY SELECTING 'A'
  Returns
    void

Definition at line 720 of file DC2430A.ino.

## ◆ discover_demo_board_local()

static int8_t discover_demo_board_local | ( | char * | demo_name | ) |
| static

Read the ID string from the EEPROM and determine if the correct board is connected.

Returns
  Returns 1 if successful, 0 if not successful

Definition at line 1007 of file DC2430A.ino.

## ◆ get_char()

char get_char | ( | void |  | ) |

Definition at line 151 of file DC2430A.ino.

## ◆ loop()

static void loop | ( | void |  | ) |
| static

Repeats Linduino loop.

Returns
  void

Definition at line 221 of file DC2430A.ino.

## ◆ Prog_LTC6951_parallelsync_example()

static void Prog_LTC6951_parallelsync_example | ( |  | ) |
| static

Prog_LTC6951_parallelsync_example() This function programs the LTC6951 registers for ParallelSYNC mode.

In ParallelSYNC mode: step 1) program all LTC6951 registers step 2) calibrate LTC6951 VCO The LTC6951 frequency plan in this example matches that of the LTC6951 ParallelSYNC datasheet application. Register settings in this function are identical to the LTC6951Wizard's set file, "Datasheet Typical Applications/6951_ParallelSyncw6954.6951set”

Returns
  void

Definition at line 671 of file DC2430A.ino.

## ◆ Prog_LTC6954_parallelsync_example()

static void Prog_LTC6954_parallelsync_example | ( |  | ) |
| static

This function programs LTC6954-2 SPI registers.

such that all 3 channels of the LTC6954-2 are set to /1. The LTC6954-2 frequency plan in this example matches that of the LTC6951 ParallelSYNC datasheet application.

Returns
  void

Definition at line 635 of file DC2430A.ino.

## ◆ read_hex()

byte read_hex | ( | void |  | ) |

Definition at line 140 of file DC2430A.ino.

## ◆ setup()

static void setup | ( | void |  | ) |
| static

Initialize Linduino.

Returns
  void

Definition at line 189 of file DC2430A.ino.

## Macro Definition Documentation

## ◆ MISO_TIMEOUT

#define MISO_TIMEOUT 1000

Definition at line 85 of file DC2430A.ino.

## ◆ READ_TIMEOUT

#define READ_TIMEOUT 20

Definition at line 84 of file DC2430A.ino.

## ◆ RECORDING_SIZE

#define RECORDING_SIZE 50

Definition at line 94 of file DC2430A.ino.

## Variable Documentation

## ◆ byte_to_hex_buffer

char byte_to_hex_buffer[3]

Initial value:
=
{
'\0','\0','\0'
}

Definition at line 120 of file DC2430A.ino.

## ◆ DC2430_Bin

int DC2430_Bin = 1
| static

Definition at line 89 of file DC2430A.ino.

## ◆ DC2430_testmode_ctr

int DC2430_testmode_ctr = 0
| static

Definition at line 88 of file DC2430A.ino.

## ◆ demo_board_connected

int8_t demo_board_connected = 0
| static

Demo Board Name stored in QuikEval EEPROM.

Definition at line 90 of file DC2430A.ino.

## ◆ demo_board_connected_man

int8_t demo_board_connected_man = 0
| static

Demo Board Name stored in QuikEval EEPROM.

Definition at line 91 of file DC2430A.ino.

## ◆ hex_digits

char hex_digits[16]

Initial value:
=
{
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
}

Definition at line 104 of file DC2430A.ino.

## ◆ hex_to_byte_buffer

char hex_to_byte_buffer[5]

Initial value:
=
{
'0', 'x', '0', '0', '\0'
}

Definition at line 116 of file DC2430A.ino.

## ◆ i

int i = 0
| static

Definition at line 184 of file DC2430A.ino.

## ◆ i2c_auxiliary_mode

const byte i2c_auxiliary_mode = 2

Definition at line 101 of file DC2430A.ino.

## ◆ i2c_mode

const byte i2c_mode = 1

Definition at line 100 of file DC2430A.ino.

## ◆ id_string

char id_string[51] ="USBSPI,PIC,01,01,DC,DC590,----------------------\n\0"

Definition at line 115 of file DC2430A.ino.

## ◆ off

const byte off = 0

Definition at line 95 of file DC2430A.ino.

## ◆ playback

const byte playback = 1

Definition at line 96 of file DC2430A.ino.

## ◆ pseudo_reset

unsigned char pseudo_reset = 0

Definition at line 185 of file DC2430A.ino.

## ◆ recording_buffer

char recording_buffer[RECORDING_SIZE]

Initial value:
=
{
'\0'
}

Definition at line 124 of file DC2430A.ino.

## ◆ recording_index

byte recording_index = 0

Definition at line 128 of file DC2430A.ino.

## ◆ recording_mode

byte recording_mode = off

Definition at line 114 of file DC2430A.ino.

## ◆ serial_mode

byte serial_mode = spi_mode

Definition at line 113 of file DC2430A.ino.

## ◆ spi_divider

const char spi_divider = SPI_CLOCK_DIV32

Definition at line 110 of file DC2430A.ino.

## ◆ spi_mode

const byte spi_mode = 0

Definition at line 99 of file DC2430A.ino.