Red Pitaya Notes
Source Issues

SDR transceiver compatible with HPSDR

Introduction

The High Performance Software Defined Radio (HPSDR) project is an open source hardware and software project that develops a modular Software Defined Radio (SDR) for use by radio amateurs and short wave listeners.

This version of the SDR transceiver makes it usable with the software developed by the HPSDR project and other SDR programs that support the HPSDR/Metis communication protocol.

This SDR transceiver emulates a HPSDR transceiver similar to Hermes with a network interface, two receivers and one transmitter.

The HPSDR/Metis communication protocol is described in the following documents:

Hardware

This SDR transceiver consists of five digital down-converters (DDC) and one digital up-converter (DUC). The first three digital down-converters are connected to the ADC channels. Two additional digital down-converters are required for the amplifier linearization system. One of them is connected to one of the ADC channels and the other is connected to the output of the digital up-converter.

The tunable frequency range covers from 0 Hz to 61.44 MHz.

The I/Q data rate is configurable and four settings are available: 48, 96, 192, 384 kSPS.

The basic blocks of the digital down-converters are shown in the following diagram:

DDC

The digital up-converter consists of similar blocks but arranged in an opposite order:

DUC

The projects/sdr_transceiver_hpsdr_122_88 directory contains three Tcl files: block_design.tcl, rx.tcl, tx.tcl. The code in these files instantiates, configures and interconnects all the needed IP cores.

The projects/sdr_transceiver_hpsdr_122_88/filters directory contains the source code of the R scripts used to calculate the coefficients of the FIR filters.

The projects/sdr_transceiver_hpsdr_122_88/server directory contains the source code of the UDP server (sdr-transceiver-hpsdr.c) that receives control commands and transmits/receives the I/Q data streams to/from the SDR programs.

RF, GPIO and XADC connections

GPIO connections

I2S connections

The I2S interface is sharing pins with the ALEX interface. So, the two can't be used simultaneously. The supported I2S audio codecs are TLV320AIC23B and WM8731. The I2S audio codecs should be clocked with a 12.288 MHz oscillator crystal.

The I2S interface should be connected to the extension connector E1 as shown in the above diagram. The I2C interface should be connected to the I2C pins of the extension connector E2.

ALEX connections

The ALEX module can be connected to the pins DIO4_N (Serial Data), DIO5_N (Clock), DIO6_N (RX Strobe) and DIO7_N (TX Strobe) of the extension connector E1. The board and the protocol are described in the ALEX manual.

The HPSDR signals sent to the TPIC6B595 chips are shown in the following diagram:

ALEX connections

I2C connections

This interface is designed by Peter DC2PD. The sdr-transceiver-hpsdr.c server communicates with one or two PCA9555 chips connected to the I2C pins of the extension connector E2.

HPSDR signals sent to the PCA9555 chip at address 0 (0x20):

PCA9555 pinsHPSDR signals
P00 - P06Open Collector Outputs on Penelope or Hermes
P07 - P10Attenuator (00 = 0dB, 01 = 10dB, 10 = 20dB, 11 = 30dB)
P11 - P12Rx Antenna (00 = none, 01 = Rx1, 10 = Rx2, 11 = XV)
P13 - P14Tx Relay (00 = Tx1, 01= Tx2, 10 = Tx3)

HPSDR signals sent to the PCA9555 chip at address 1 (0x21):

PCA9555 pinsHPSDR signals
P00select 13MHz HPF (0 = disable, 1 = enable)
P01select 20MHz HPF (0 = disable, 1 = enable)
P02select 9.5MHz HPF (0 = disable, 1 = enable)
P03select 6.5MHz HPF (0 = disable, 1 = enable)
P04select 1.5MHz HPF (0 = disable, 1 = enable)
P05bypass all HPFs (0 = disable, 1 = enable)
P066M low noise amplifier (0 = disable, 1 = enable)
P07disable T/R relay (0 = enable, 1 = disable)
P10select 30/20m LPF (0 = disable, 1 = enable)
P11select 60/40m LPF (0 = disable, 1 = enable)
P12select 80m LPF (0 = disable, 1 = enable)
P13select 160m LPF (0 = disable, 1 = enable)
P14select 6m LPF (0 = disable, 1 = enable)
P15select 12/10m LPF (0 = disable, 1 = enable)
P16select 17/15m LPF (0 = disable, 1 = enable)

Signals sent to the PCA9555 chip at address 3 (0x23):

PCA9555 pinssignals
P00 - P03BCD code for Rx1 band
P04 - P07BCD code for Rx2 band
P10Tx frequency (0 if Tx freq. = Rx1 freq., 1 if Tx freq. = Rx2 freq.)
P11 - P12ATT1
P13 - P14ATT2
P15disable T/R relay (0 = enable, 1 = disable)
P16bypass all HPFs (0 = disable, 1 = enable)

More information about the I2C interface can be found at this link.

Software

This SDR transceiver should work with most of the programs that support the HPSDR/Metis communication protocol:

Getting started

Configuring inputs and outputs

The sdr-transceiver-hpsdr program running on the STEMlab SDR board expects six command line arguments:

sdr-transceiver-hpsdr 1 2 2 2 1 2

The first four arguments are for the receivers (RX1, RX2, RX3, RX4), where 1 corresponds to IN1 and 2 corresponds to IN2.

The last two arguments are for the outputs (OUT1, OUT2), where 1 corresponds to the TX signal and 2 corresponds to the envelope signal.

For example, to send the TX signal to OUT2, the corresponding line in start.sh should be edited and the last argument should be set to 1:

sdr-transceiver-hpsdr 1 2 2 2 1 1

Amplifier linearization

PowerSDR mRX PS includes an amplifier linearization system called [PureSignal](https://github.com/TAPR/OpenHPSDR-PowerSDR/raw/master/Documentation/Pure Signal/PureSignal.pdf). The following screenshots show what settings should be adjusted when using it with STEMlab SDR. To access the "Calibration Information" panel press Ctrl+Alt+i. The attenuated feedback signal from the amplifier should be connected to IN2.

PowerSDR Hardware Config

PowerSDR Linearity

The following spectra illustrate how the amplifier linearization works with the STEMlab SDR output (OUT1) connected to the STEMlab SDR input (IN2) with a 50 Ohm termination.

PureSignal off PureSignal on

CW functionality

The CW keyer can be used with a straight or iambic key connected to the pins DIO1_N and DIO2_N of the extension connector E1. The CW signal is generated when one of the CW modes is selected in PowerSDR mRX PS and the pins DIO1_N and DIO2_N are connected to GND.

The ramp generator is programmable. The default ramp's shape is the step response of the 4-term Blackman-Harris window. It's inspired by the "CW Shaping in DSP Software" article appeared in the May/June, 2006 issue of QEX.

The measured delay between the key press and the start of the RF signal is about 2 ms. The 10%-90% rise time of the signal is about 3.5 ms.

CW signal

The following figure shows the spectrum of the CW signal keyed at 50 WPM.

CW spectrum

Building from source

The installation of the development machine is described at this link.

The structure of the source code and of the development chain is described at this link.

Setting up the Vitis and Vivado environment:

source /opt/Xilinx/Vitis/2023.1/settings64.sh

Cloning the source code repository:

git clone https://github.com/pavel-demin/red-pitaya-notes
cd red-pitaya-notes

Building sdr_transceiver_hpsdr_122_88.bit:

make NAME=sdr_transceiver_hpsdr_122_88 PART=xc7z020clg400-1 bit

Building SD card image zip file:

source helpers/build-all.sh