Meteor M-N2 Images

Friday 18 May 2018

Homebrew SDR HF Transceiver - decision time

The video below shows my Homebrew SDR rx working with the GUI on the STM32F746-Discovery board.


However, what you might notice is the presence of image products in the waterfall. The processing of the signal suppresses all but the very strongest of these so they don't appear as audio but it is mighty confusing when they are on the waterfall but actually not there (if you see what I mean)!

I am in the process of building a QSD or Tayloe Detector, which should provide better rejection of images. I have breadboarded one of these, it works but not very well. I think that this might be due to the length of leads I have on the breadboard so I am trying to use Eagle CAD to design a circuit board to overcome these problems.


Monday 26 February 2018

Homebrew SDR HF Transceiver - DSP Concepts Audio Weaver

It's been a little while since my last post but I have been wrestling with software.

To summarise, my software stack is:

  • FreeRTOS - a real time operating system for microcontrollers that enables an easy way to prioritise tasks without having to resort to 'bare metal' handling of interrupts. FreeRTOS is free with no licence issues.
  • uGFX - initially I was planning to use STemWin as a graphics manager but, although free to use it is closed source. As I couldn't get it to work with FreeRTOS I decided to use an open source graphics manager and found uGFX. This decision has not been without its problems but after I found the bug in the uGFX code I was able to work around it.
  • DSP Concepts Audio Weaver - this software is closed source but licenced by ST for use on their microcontrollers. However, as it is fantastic it is worthwhile persevering with. You do have to register to download it but no payment is required.
So, to cut a very long story short I now have FreeRTOS, uGFX and Audio Weaver running together. I have taken NT7S's Si5351 library code that G7UVW had ported to the mbed platform and in turn I have ported it to C to work with the ST hardware abstraction layer.

I can now tune the Si5351 from the STM32F746-Discovery board using the touch screen while the DSP processing provided by the Audio Weaver library is also running. The one niggle that I have yet to resolve is that when I disconnect & reconnect power from the microcontroller the audio processing doesn't work on reboot although the rest of the program (graphics etc.) does.

For now though I'll focus on the design of the signal processing in Audio Weaver.

Audio Weaver Designer runs on Windows (I've tried it on Linux with Wine but with no success) and is used to design and build the audio processing by joining blocks together. Even better is that it is possible to deploy the process you have designed onto the microcontroller and run it while allowing you to change settings in Windows. This approach leads to a quick development time and tuning is easy. When the design is completed it is a simple operation to create the files required to incorporate them in the microcontroller code.

There is an argument that this approach is the easy one but I liken it to the discussion around using an LM386 or NE602 when discrete components could be used. It's a tool and it works so I'll use it.

The image below shows Audio Weaver Designer:

The available modules are selected from the folders on the left and dragged into the process and the connectors are then joined together and any parameters added/changed.

The images below shows annotations against each major functional block of my DSP processing:


This method of SSB demodulation is not the Weaver (or third) method as I have read elsewhere but a bit of a hybrid. I will be trying other configuration to assess which is best for my application. A good description of the different methods of SSB demodulation is here.

While testing this process through Audio Weaver Designer I am controlling the Si5351 tuning via an Arduino Uno using the sketch I put in a previous post. The Audio Weaver file in the pictures is available for download here if you want to try it yourself.

A video of reception using this process flow while it is running on the Windows machine connected to the microcontroller is below.

Next post: Bringing it all together on the STM32F746-Discovery board.

Thursday 28 December 2017

Homebrew SDR HF Transceiver - Listening to the receiver in SDR#

I recorded this video of the I/Q outputs fed into my computer with the demodulation being performed by sdr# (now with audio)



The large central spike is, I think, bleed through from the local oscillator signal.

My next task is to measure the loss in the receiver and also look at whether there is a ground loop problem.

Next post: Introduction to the microcontroller processing.

Homebrew SDR HF Transceiver - Quadrature Divider

We are now at the point where we need to take the signal from the Si5351, divide it by 4 and produce two outputs, one of which is 90 degrees out of phase from the other.

A good tutorial on this process is here although we will divide by 4 rather than 2. The datasheet for the 74HC74 is here. The 74AC74 and 74HC74 are more or less interchangeable, the difference being that one can handle higher frequencies than the other.

There are many circuits on the Internet for quadrature dividers but I used one that is used in the SoftRock Ensemble receiver, here. The only difference being that the outputs to QSD CLK0 & CLK1 are not used, however, note that pin 9 does need to be connected to pin 2 (it took me a while to figure that was the reason I couldn't get it to work). Pin 14 is fed with 5V from the 7805 regulator and pin 3 is fed from CLK0 output on the Si5351. The outputs from pin 5 and 8 are individually fed to the LO ports on ADE-1 #1 and ADE-1 #2.

Below is my version, it looks a bit messy but it works.




The screenshot from my oscilloscope shows the two out of phase outputs from the quadrature divider in yellow and blue. The purple line shows the that these two outputs have been divided by 4 and are at a frequency of 7.100 MHz.





We are now ready to see what this thing can receive by taking the I & Q outputs from the audio LPF's to a stereo jack plug (I to left channel, Q to right channel or vice versa plus ground) and plugging it into our computer to listen to the signals using SDR# but finally a picture of the completed RF splitter, mixer, AF low pass filter, regulator, quadrature divider board.



I was going to mount the Si5351 breakout board onto the two posts top right but I think the board uses imperial screw size holes as my M3 screws will not quite fit.

Next post: Connecting to SDR#

Homebrew SDR HF Transceiver - the Si5351

The Si5351 is "...an I2C configurable clock generator that is ideally suited for replacing crystals, crystal oscillators, VCXOs..." That is to say that it can generate frequencies from 2.5 kHz up to 200 MHz. Adafruit Industries produce a breakout board with the Si5351 chip and other required components installed for under $8, this allows us to interface with a microcontroller, e.g. Arduino, and control the frequencies produced very easily. The breakout board allows us to generate three frequencies but for this project we will only be using one of the outputs. We will produce a frequency that is four times the LO frequency we require, when the signal goes through the quadrature divider (74AC74 flip-flop) it will be divided by four to produce the LO frequency.

Adafruit Si5351 breakout board on the left, Arduino Uno on the right.




The connections are simple: +5V and GND from the 7805 regulator, pin A4 from the Arduino Uno connected to pin SDA on the breakout board and pin A5 connected to pin SCL. 

I have hacked the example program below, it sets the Si5351 to a default frequency of 28.4 MHz, i.e. 7.1 MHz after the divide by 4, and by using the serial monitor window in the Arduino IDE you can change frequency in 1 kHz steps up (1) or down (2), or 100 Hz steps up (+) or down (-). This frequency is output on CLK0 - the next step is to connect CLK0 to the 74AC74 flip flop.

You will need to install the Si5351 library by following the instructions here.


/*
 * si5351example.ino - Simple example of using Si5351Arduino library
 *
 * Copyright (C) 2015 Jason Milldrum <milldrum@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "si5351.h"
#include "Wire.h"
Si5351 si5351;
char incoming_char;
long serial_input_number, serial_input_number1;
void setup()
{
  // Start serial and initialize the Si5351
  Serial.begin(57600);
  si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0);
  // Set CLK0 to output 7.1 MHz with a fixed PLL frequency
  si5351.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
  si5351.set_freq(2840000000ULL, SI5351_PLL_FIXED, SI5351_CLK0);
  serial_input_number1 = 7100000;
}
void loop()
{
 if(Serial.available()>0){
    incoming_char = Serial.read();
    switch(incoming_char){
    case '1': //up by 1kHz
      serial_input_number1 = serial_input_number1 + 1000;
      serial_input_number = serial_input_number1 * 4;
      si5351.set_freq((serial_input_number) * 100ULL, SI5351_PLL_FIXED, SI5351_CLK0);
      Serial.println(serial_input_number1);
      break;
    case '2': //down by 1kHz
      serial_input_number1 = serial_input_number1 - 1000;
      serial_input_number = serial_input_number1 * 4;
      si5351.set_freq((serial_input_number) * 100ULL, SI5351_PLL_FIXED, SI5351_CLK0);
      Serial.println(serial_input_number1);
      break;
     case '+': //up by 100Hz
      serial_input_number1 = serial_input_number1 + 100;
      serial_input_number = serial_input_number1 * 4;
      si5351.set_freq((serial_input_number) * 100ULL, SI5351_PLL_FIXED, SI5351_CLK0);
      Serial.println(serial_input_number1);
      break;
     case '-': //down by 100Hz
      serial_input_number1 = serial_input_number1 - 100;
      serial_input_number = serial_input_number1 * 4;
      si5351.set_freq((serial_input_number) * 100ULL, SI5351_PLL_FIXED, SI5351_CLK0);
      Serial.println(serial_input_number1);
      break;
    }
    Serial.flush();   
  }
}
A 7805 regulator circuit used to convert ~12V to 5V is here.

When you run the Arduino sketch you should be able to hear the output from the Si5351 on an HF receiver at 28.4 MHz

Next post: Quadrature Divider

Wednesday 27 December 2017

Homebrew SDR HF Transceiver - Adding the ADE-1 Mixers

The ADE-1 is a passive device with an RF and LO input and an IF output. Two ADE-1's are used with the RF port on each being fed with output from port 1 and 2 of the RF splitter respectively (Note: I changed the design of the RF splitter from that which I first published, here is a link to the updated page). The LO ports will be fed from one of the two outputs of the 74AC74 flip-flop respectively. The output of the IF ports goes to an audio frequency LPF (one LPF per port).

The theory behind how the I & Q signals are produced are described in this excellent YouTube video by Craig, devttyS0. In short the LO outputs are produced by dividing the signal from the Si5351 by 4, there are two outputs from the 74AC74 at the LO frequency and one is 90 degrees out of phase from the other. When each one of these is mixed with the RF in the ADE-1 we end up with two outputs at baseband audio frequency, I & Q, one being 90 degrees out of phase from the other as shown below:



The audio LPF that follows each RF output I copied from EA4NZ

Source: EA4NZ
Below you can see a picture of the RF splitter, ADE-1's and audio LPF's. The 7805 and assorted capacitors in the top right is the 5V supply for the 74AC74.



I note from devttyS0's video that the FST3253 device removes the need for the two ADE-1's by implementing a Tayloe Detector - something to be tried.

Next post: The Si5351

Friday 15 December 2017

Homebrew SDR HF Transceiver - RF Splitter

The RF splitter is used to split the incoming RF into two equal parts. These individual signals are then used as input to the ADE-1 mixers that produce the I & Q signals (90 degrees out of phase). Obviously you don't want to lose too much power in the splitter circuit and you want to ensure that the two output signals are of equal magnitude.

Update: 27 Dec 2017. The splitter design I originally used did not produce zero phase difference. Hence I have updated this page with another design.

I built this splitter based on a design from EMRFD (Experimental Methods in RF Design, Hayward, Campbell & Larkin), specifically the one from the 18 MHz transceiver shown in Fig. 11.14.

The schematic is below:




I used an FT50-43 toroid with 6 bifilar turns.

My built version can be seen in the picture below.


The picture below shows the outputs from ports 1 and 2. They are equal in amplitude and in phase which is perfect.



Next post: Adding the ADE-1 mixers