Meteor M-N2 Images

Showing posts with label stm32f7. Show all posts
Showing posts with label stm32f7. Show all posts

Wednesday, 13 December 2017

Homebrew SDR HF Transceiver - Introduction

In 2016 I spent some time working on a VLF/LF receiver by I2PHD that was fully software defined, see here. The challenge of this approach is the speed of the ADC and subsequent processing that is required within a microcontroller. There just were not enough clock cycles to implement a waterfall display for example.

Recently I have been looking at the YouTube channel of Charlie Morris, ZL2CTM, who has built a software defined radio (SDR) using a Teensy microcontroller. Charlie doesn't give a whole lot of details about how to build this radio but I decided I wanted to try it out. Edit: I have also been looking at VE3MKC's blog, I thought VE3MKC and ZL2CTM were the same person but it appears that they have been doing the same thing independently. My thanks to them both for the inspiration and for the information they have published.

Given my experience with the VLF/LF receiver and the ST Microelectronics boards I used as well as the fact that I have three of these boards here I decided to build my version ZL2CTM's HF SDR receiver and transmitter that will be standalone, i.e. it will not require a PC to operate.

The block diagram below shows the main components of the transceiver although as most components are shared between transmitter and receiver I haven't bothered to put the transmit components in the diagram. When I come onto that area I will add them. I have included a description of the function of each block.


Originally I had not planned to blog about this build but a post on Hackaday bought forth some comments on Twitter:




Consequently, I couldn't really not blog about this project.

I could say that all the individual parts of this project are simple enough but I frequently come across projects or circuits that leave out descriptions of a 'simple' part of the circuit because the experienced builder just cannot believe that not everybody knows what they know. Consequently, I will try to explain each section as I go along or provide a link to a resource on the Internet that does a much better job of describing it than I ever could. All components except the ADE-1 are through hole components and I will build Manhattan style. The ADE-1 can (just) be mounted in this way. After I complete this project I would like to try to build the same circuits using only SMD parts as a follow up.

My choice of the STM32F746-Discovery board is mainly because I have one here. It costs about $55 and, although there does seem to be a bit of a lead time in the UK at the moment (December 2017), it is still in production and is fantastic value for money. It contains an ARM Cortex-M7 microprocessor, ADC's (analogue-digital controller), DAC's (digital-analogue controller), ethernet, micro-SD card interface, audio line-in/out and a 4.3" colour LCD-TFT screen with capacitive touch input among other features. You'd be hard pressed to find a 4.3" capacitive touch LCD alone for the same price on e-bay.

If I hadn't found that ST have recently licenced DSP Concepts Audio Weaver software for use royalty-free on ST devices this project wouldn't be going ahead but the Audio Weaver software is fantastic. It will enable me to design the software audio processing parts of the solution on a PC (sadly it doesn't work on Linux, even under Wine) and tune these in real time while they are deployed to the STM32F746 device. When the tuning is completed the code can be deployed standalone to the microcontroller. In fact, at the moment I think that the hardest part of this whole project is going to be building the graphical user interface, for which I will use STemWin, another piece of software that ST licence for their customers to use royalty-free.

What will you need if you plan to join in with me in this project? I am going to make the assumption that you have built some electronic circuits or kits before, firstly I'll build the RF components that produce the I/Q outputs that will be fed into the STM32F746:

Soldering iron and other tools you use to build circuits
Several pieces of single sided copper clad board like this
MeSquares to enable Manhatten style construction
RG174 or similar thin co-axial cable to link the RF stages
Si5351 breakout board, available from Adafruit and other resellers
74HC74 D-type flip flop
2 x ADE-1-24 frequency mixers or the non-SMD but more expensive equivalent (SBL-1)
A handful of 2N3904 transistors
There will also be some resistors, capacitors and ferrite cores required that I will detail as I go along.
The STM32F746-Discovery board from your favourite electronics reseller, Farnell & RS stock them in the UK amongst others or direct from ST

If you already have an oscilloscope with FFT function then I suggest you build a wideband RF noise generator which will be useful to test the RF amp and bandpass filter. I built one like this because it uses the ubiquitous 2N3904 transistors but many designs are available on the web.

Finally, a warning. This will be a learn as you go along project and if you follow along you need to be prepared to trouble shoot and fault find. As it stands at the moment I believe that it will be possible to build a transceiver as described above. What I do know is that we will all learn something and prove that not all of us are "Radio Amateuring like it's 1975"!

Next post: The RF amp.


Sunday, 15 January 2017

VLF/LF Receiver implemented in microprocessor - Introduction (Part 1 of n)



Alberto, I2PHD, developed a VLF to MF receiver entirely in a microprocessor utilising the STM32F4 Discovery board. I was intrigued by this so I purchased a STM32F746 Discovery board. The F7 board uses the faster ARM Cortex M7 processor rather than the M4 processor used in the STM32F4 range of boards.

However, I soon found that the STM32F7 Disco board does not make the same GPIO pins available to use. Specifically only the third analogue-digital converter (ADC3) of three is available to use. Alberto's design uses ADC's 1 & 2 in double buffered mode and this approach is fundamental, consequently I realised that I would not be able to use this board for the receiver. By the time I had worked this out ST had released the STM32F746-Nucleo board, this board is similar to the Discovery board except it makes all the GPIO pins available to use but it does not have a built in LCD display.

I was not able to compile the source code written for the F4 board for the F7 board. Whether this was through my lack of experience or for some other reason I do not know as the code is meant to be compatible between the two devices. Subsequently, I proceeded to rewrite the code to use the Hardware Abstraction Layer (HAL) provided by ST. Due to the fragmented and incomplete nature of documentation for the HAL a great deal of experimentation and trial & error was involved. However, this did mean that my understanding of C programming for embedded microprocessors and associated debugging using gdb increased quickly.

Currently the status of this project is as follows:
  • Code for STM32F4 ported to work with the STM32F7 devices using HAL firmware library version 1.3.0*
  • To overcome the lack of an LCD on the Nucleo board an inexpensive LCD was purchased on ebay which uses the ILI9341 LCD controller and this was integrated into the code.
  • To overcome zero documentation on how to use the touch screen capabilities of the LCD I bought I implemented control using a rotary encoder.
  • I have added a spectogram function which shows a display of the signals being received - this is a work in progress.
* I have looked at using the newer 1.5.1 HAL firmware but there have been significant changes made to the operation of some of the functions and I don't intend to rewrite the code to handle these at the moment.

The picture at the top of this post shows the receiver receiving the MSF time signal on 60kHz.

I plan a series of blog posts to document this project. My plan is for posts covering the following topics:
  • Setting up the development environment - using Eclipse IDE, GCC compiler, OpenSTM32, gdb.
  • My implementation and the hardware connections, particularly covering the LCD and rotary encoder.
  • Specifics around the rotary encoder control and the LCD.
  • The spectogram function.
  • Wrap-up, including some problems I have yet to overcome.
The code is available on github link