I never intended this to be an ongoing blog, but here we are with update 9.....

My design puts the interface to the RF hardware, and a simple user interface, into an Arduino. This leaves the ARM processor in the Red Pitaya to deal with data transfer, ethernet interfacing etc. In that role it's grossly underutilised, and could easily accommodate the hardware interfacing etc; but it has limited I/O resources available.

Why? Because I wanted to use a hardware interface different from the "Alex" interface. My design allows the settings available through the HPSDR software architecture to be used with different hardware. I wanted to re-use an existing bandpass filter board on receive, for example. Ultimately I could have put all the code including user interface etc into the Red Pitaya, but the code would deviate quite substantially from Pavel Demin's code at that point. This way, there is a "clean" interface between the two.

The Arduino to Red Pitaya interface is I2C. I2C is a simple, bidirectional bus using two wires. Pavel Demin has already used the I2C interface for the Alex interface; I've made my Arduino "look" like 6 registers each taking 16 or 24 bits of data. The Red Pitaya uses 3.3V logic, and the Arduino uses 5V; I've used a level translator IC between the two, which also includes the pullup resistors needed to make I2C work.

The new "registers", all at interface address hex 40 (64 decimal) are as follows:

register 1: RX1 Frequency (16 bits + ID)
register 2: RX2 Frequency (16 bits + ID)
register 3: TX frequency (16 bits + ID)
register 4: Open Collector Outputs, antenna settings (24 bits + ID)
register 5: RX attenuation (24 bits + ID)
register 6: TX attenuation (16 bits + ID)

I've also published the code on GitHub: link.

The I2C interface worked first time. I started with code in the Arduino simply to print characters to its serial terminal and changed the sdr-transceiver-hpsdr.c code to send the appropriate settings to the new registers. I was able to debug the code at that point by checking the messages; then I updated the Arduino code to set the various hardware registers appropriately.

A change that I did need to make was the TX strobe from the Red Pitaya to the Arduino. When all the code was running that worked fine; if the server program on the RP wasn't executing, or the RP was powered off, then the Arduino entered TX mode. I was using the same level converter IC; changing to a simple transistor driver solved the problem.
 
My Arduino provides a simple user interface with a 4x20 character LCD display. on Receive and Transmit it provides a simple front panel display of how the radio is configured. There is a debug mode allowing you to changes all the hardware settings to test the radio hardware. For convenience and safety, that needs a jumper to be removed to prevent inadvertent use of the mode. The display includes simple bargraph display of forward power and VSWR, with a crude "peak hold" for SSB forward power. It's not a "proper" user interface; but it will tell me what the radio is doing. 

I had originally intended to have a "shield" on the Red Pitaya and another on the Arduino. I'm thinking now I'll make a single shield that mounts onto the red Pitaya, and the Arduino plugs into the top: The "Arduino Micro" is designed to be mounted like that. The shield will need connections for:

  • Red Pitaya low speed analogue I/O (eg VSWR monitor)
  • Red Pitaya GPIO (I'm not using these, but you never know)
  • Audio Codec
  • buffered TX strobe from Red Pitaya (eg for transverters)
  • 5V power connection, with jumper to Arduino 5V input
  • Transistor/FET buffer for TX strobe
  • I2C level translator
  • Arduino low speed analogue inputs
  • Arduino SPI serial out to RF hardware
  • Arduino interface to LCD (inc bias potentiometer)
  • Arduino interface to rotary encoder

I'll try to make the connectors match the other end (eg current monitor and TX strobe matching the Munin pinout). This will tidy up the connections internally no end!

Using This Site

Searching

The web site can be searched: type a search term (e.g. "DAC10") into the search box on the right hand side of the header, and hit enter. the search engine will find words matching the search string in the main body of the site, but it won't search attached documents (e.g. the product manuals).

"Read More"

Many articles are displayed one after the other. some are quite short, and say "read more" at the bottom. Click that to read the remainder of the article.