KK103c1 Firmware Development

Continuing with the development of an accurate 40MHz clock source for my ADALM Pluto, I recently finished an Arduino library to control the ADF4110 Synthesizer on a KK103c1 VCTXCO module. The KK103c1 module is a daughter board that sits on the back of an Arduino Nano.

I personally use the PlatformIO IDE extension within Visual Studio Code for all of my Arduino based projects. Yes, this even works on a Linux desktop machine. The PlatformIO ecosystem takes away the pain of getting embedded tool chains working, it’s simple and effective. I also don’t have to worry about tool chains that share libraries and break when incompatible versions are installed, and it deals with the library dependency hell problem that plagues the standard Arduino IDE.

Now that I was armed with a library that gave me basic control over the ADF4110 I could concentrate on writing a sketch that would make the KK103c1 do what I wanted it to do.

The code for this project has been published in my GitHub repository, you can find it here. The code has been released under a MIT license.

Firmware Description

The firmware is very simple and provides “just enough” functionality to allow the KK103c1 to externally clock the ADALM Pluto.

When the firmware starts it will load and configure the ADF4110 Synthesizer found on the KK103c1 module and set it to generate a fixed 40MHz unmodulated carrier, that is phase locked to its own 10MHz reference. It also checks that an external 10MHz reference is present using the diode detector on the KK103c1 and will flash the built-in Arduino Nano LED if not found. The MuxOut pin on the ADF4110 is also set to provide a Lock Detect output and a Green LED on the KK103c1 will burn your retina when the Connor Winfield VCO is locked on frequency.

If the external 10MHz reference is not detected or lost during normal operation, the sketch will also place the ADF4110 into power-down allowing the onboard VCO to “free-run”. The Connor Winfield VCO fitted to the KK103c1 is very accurate and stable on its own, so having the VCO free-run will see it hold +/-0.32ppm (+/-13Hz) over temperature, over a 1% voltage range including aging within a 24 hr period. The KK103c1 has a multi-turn pot that can rubber the VCO control voltage and trim the output to exactly 40MHz before the PLL has to do anything, this is a great feature for those that take their equipment out into the field.

The control range or “frequency pull-ability” of the Connor Winfield VCOs is specified as +/-12ppm which translates to +/-480Hz, so it is normal for the ADF4110 to reject the 10MHz reference if it is not within the same accuracy window. I commonly see the lock LED on the KK103c1 begin flashing as my Rubidium 10MHz reference is warming just prior to achieving it’s own atomic lock.

A PC can be connected to the USB serial and debug messages monitored that shows if the ADF4110 is locked or in free-run.

Pluto 40MHz Reference Oscillator - R0V1
---------------------------------------
* Checking Reference Oscillator level.......... Done !
* Starting kk103c1 ADF4110 PLL...
* ref freq = 10000000 Hz (detected)
* vco freq = 40000000 Hz (locked)
* Config complete.

Further debug messages can be enabled in the ADF4110-arduino library, look closely in the library header.

Testing Pluto 40MHz External Clock

So the proof is in the pudding. Below are images of the KK103c1 running my Pluto40MzExternalClock sketch along with plots from the spectrum analyser, as you can see I’m using my 10MHz Rubidium as the reference oscillator.

In the spectrum analyser plot above you can see the 40MHz oscillator “locked” to the 10MHz Rubidium reference holding the output frequency to better than +/-1Hz accuracy. The Spectrum analyser was also being fed from the same reference source, to ensure it wasn’t causing any additional error. This was also checked with my Agilent frequency counter again being fed by the Rubidium 10MHz oscillator.

One thing I have noticed is that the output of the KK103c1 was being loaded by the 50Ω input of my Rigol Spectrum Analyser. The Connor Winfield VCO has an internal series impedance of 200Ω so this behaviour is to be expected. I’ll have to look closely at the ADALM Pluto external clock input and see if I can change component values to suit.

With a working 40MHz clock, phase locked to my 10MHz reference, it’s now time to hook this all together and see if I can improve upon the ADALM Pluto frequency accuracy.

More to come.

ADF4110 Arduino Library

In a recent post I was fortunate to obtain a 40MHz VCTXCO module from David VK5KK that I am using to lock an ADALM Pluto to an external 10MHz reference.

David’s design uses the Analog Devices ADF4110 RF Frequency Synthesizer, which offers low phase noise and operation up to 540MHz, more than enough for this application. It was also conveniently packaged as a daughter board for an Arduino Nano.

However upon entering the keywords “Arduino ADF4110 library” into Google & Duck-Duck-Go I was not greeted with any results. Oh dear, I have to write a library myself how strange ! Time to dust off my Arduino development environment.

I am not intending to describe how a Frequency Synthesizer or Phase Locked Loop (PLL) works, there are many YouTube videos and articles on the internet that can describe this better than I. If you are interested in the KK103c1 40MHz VCTCXO module I’m using, you can find it published in Dubus Q3/2022, there David also goes into some detail of how it works.

For this Arduino library the ADF4110 contains three internal 24-bit latches, where we can program the necessary values into counters and configure the hardware to generate the desired frequency output. This is achieved with a series of bit-shifting and bit-manipulations macros within the code, I have followed the names and bit-naming structures as per the Analog Devices ADF4110 datasheet.

The ADF4110-Arduino library essentially consists of five functions, that are described in the README.md. There is the ubiquitous Arduino “begin” function used to configure the SPI communication between the ADF4110 latches and Arduino Nano, there is an “initialise” function to load & initially configure the hardware of the synthesizer, an “update” function to simply change frequency and two utility functions to “print” the frequency to the serial console and another to “powerdown” the synthesizer when necessary. This was all I needed to get my synthesizer going, it should all hopefully be self-explanatory.

Now that I have the ADF4110-Arduino library essentially working, I can now focus on using this to drive the KK103c1 module but that is for another post.

ADALM Pluto Frequency Accuracy

In a recent post I had my ADLAM Pluto transmitting using SDRangel on 1296.5MHz listening to it using an Icom R10 receiver. One thing that I did immediately notice was I had to tune the R10 down 15-18kHz to get both systems “on” frequency. One or both of them had to be off frequency, so which one was it ? After a few measurements with a spectrum analyser, I found the ADALM Pluto was the culprit, surprisingly the Icom R10 was within a 100Hz of where it was supposed to be.

So… the ADALM Pluto was at least 16.667kHz low using its internal 40MHz crystal reference, that is not going to cut the mustard on these higher bands.

I had always planned on phase locking the Pluto to an external 10MHz Rubidium reference. The only catch is the external reference input on the Pluto expects a 40MHz clock and the AD9361 transceiver within the Pluto, cannot be configured to use a reference clock much below 25MHz. So there was no way I was going to make this work with a 10MHz reference without adding something in between.

After some further research I decided I needed a 40MHz VCO that I could phase lock to the external 10MHz reference to solve my problem with the Pluto external clock input. A chance discussion at a conference in Tasmania at the end of 2024 lead me to laying my hands on a KK103c1 40MHz VCTXCO PCBA designed and built by David VK5KK.

David’s 40MHz VCTCXO design was published in Dubus Q3/2022. It was designed as a daughter board directly connected to an Arduino Nano, that it conveniently sits on top of. The specs for this board were perfect for what I was planning to do with the Pluto external clock input;

Ref In:     10MHz, -4dBm to +14dBm
Output: 40MHz ~1.0Vp-p (into 200R)
VCO: Connor Winfield T604
PLL: Analog Devices ADF4110
Micro: Arduino Nano ATMEGA328p

Both the VCO and PLL are low phase noise varieties and the power supply decoupling is extensive. I was even given a basic Arduino sketch that I could use to test the board, that is provided I had an Arduino Nano. Oh well Nano ordered and should be here soon.

Certainly once I have this board running, I’ll be doing some phase noise measurements and experiments with my Rubidium 10MHz reference. It will be interesting to see what improvement I get in frequency accuracy, along with comparing the phase noise of the internal Pluto clock and seeing if there are any differences. However before this I’ll need to write some Arduino code to tailor this board for my purposes and perhaps a library to drive the ADF4110. That will of course land somewhere in my GitHub repository when ready.

I’ll give a shout out and my personal thanks to David VK5KK for gifting me one these boards and accelerating my ADLAM Pluto project. I certainly can’t wait to get to testing once the postman delivers a Arduino Nano. I know I’ve got some Nano’s somewhere, but for the life me of I can’t find that box.

More to come.

Pipe Cap Filters – Let the good times flow !

Recently I came across a novel way to get the ADALM Pluto to generate a 10GHz signal. Jay Francis presented a minimal ADALM Pluto 10GHz transceiver system that used a commercial LNB and some Mini-Circuits high pass filters, to pick off the 3rd harmonic from the TX output. You can watch his video below.

This got me thinking, could you actually build a 10GHz transceiver from the ADALM Pluto like the 23cm Pluto Charon kit I’ve been working on ?

Now I don’t have any of the Mini-Circuits high pass filters and they were a little expensive to get shipped to Australia, but I did know of a 10GHz Frequency Multiplier kit from Minikits being manufactured locally. The Minikits kit comes with a GAL-39, 10GHz pipe cap filter and a NLB310 post amplifier that can be assembled on a universal microwave board. Whilst designed to double a 4-5GHz signal up on to 10GHz, it can also triple a 3-4GHz signal with a bit of tweaking and fine tuning. This was perfect for what I was planning with the ADALM Pluto, so one was ordered and I had to wait for the postman for it to arrive.

While the Minikits multiplier was on its way I also stumbled across N1BUG’s YouTube channel, where he walks you through how he assembles 10GHz pipe cap filters in his workshop. It was quite clear that some “real” heat is required, so I also purchased a Chinese made hotplate to assist with additional heat when soldering the cap itself. You can find more about that adventure here.. So far I’d spent less than the cost of two Mini-Circuits high pass filters.

I’m now sure that 10GHz pipe cap filters look bigger on the computer screen than they do in real life. I was genuinely surprised just how tiny they were. I was also questioning the purchase of a hotplate.

Following the Minikits multiplier kit instructions, I first drilled and tapped a M4 hole in the pipe cap, prepared the probes, modified the board to accept the pipe-cap and then proceeded to solder it down. Since I was using a hotplate, I decided to solder the pipe-cap down first, then solder the probes in after as suggested by N1BUG. This meant I needed to pay attention to the probe straightness and length, so that they would land in the right place once assembled. I was OK with this as I can see the probes through the M4 nut in the top using my microscope before and after soldering.

Now soldering this pipe-cap was genuinely difficult and the hotplate certainly made the job much easier. The flux that I used was not that great, I must try to find some of the really gooey sticky flux that N1BUG was using. However I persevered with my Hakko 50W iron wound up to +450°C with a K-tip and some 0.7mm solder rings, tacking and working my way around the cap. Once I’d placed sufficient solder, I then broke out the hot-air gun set to +400°C and re-flowed the joint, which gave me a much neater and more uniform appearance.

Below is the board after soldering and once I’d cleaned up the excess flux. The Minikits PCB has quite a few holes in the plane, so I used compressed PCBA flux cleaner blown in through the nut to make sure no residual flux was present after soldering. Likewise a small file and knife were used to clean up the blobs of solder around the nut.

For my first attempt at soldering pipe-cap filters I’m happy with the result. I found the hardest part soldering the nut to the top, mainly due to difficulties applying flux and getting the solder to wick to the nut and cap evenly.

So the next steps are to insert the probes and build the associated amplifiers and then test and tune. More to come.

Hot Plates – Let there be Heat !

Soldering anything with a large thermal mass is tricky business. Often when faced with this situation I crank up the temperature on my Hakko soldering station well into the +450°C region, wet the tip with solder and try to pour enough heat into the joint to get the solder to bond well. The downside is often the heat is drawn away from the joint, which means you’re heating the joint for far too long and materials start to burn. PCB laminate is typically OK to temperatures of 140-170°C for short periods before they turn brown. Likewise any flux does not get a chance to remove oxidisation and results in contaminated joints.

The best solution is to use a hot plate, which will bring what you’re trying to solder to a per-heated stage before you apply the iron. This is effectively a “manual” version of reflow soldering, I’ve tried to draw a typical reflow profile below.

There is a lot of information about the above curve on the internet, needless to say I intend to use the hot plate to give me the preheat and dwell time to activate any flux (first flat part), and then use my soldering iron to melt the solder (peak) and then allow things to cool down.

So the next question is where do you buy one ?

Searching in various places I noticed that online there was a plethora of some cheap Chinese hot plates for what seemed like very little money. I couldn’t build one for the price being offered. Wondering what was inside I found the following tear-down video, which suggests while they work there are some potential issues with their electrical safety.

Curious I ordered one and waited for the postman to deliver. Like the author above I found that the internal wiring of this unit was non-compliant to Australian safety standards, which shouldn’t come as a surprise as the unit had no safety markings at all; making these units technically illegal to import and use.

However I’m fortunate to work within the Electrical Industry, so I have access to the relevant safety standards and could modify my unit to make it compliant and therefore safe. Before anyone asks, no I cannot provide details of what I did to my unit. There are more things to consider than just the earthing, as was done in the above video. It took me quite a number of hours to fix the issues I found with this unit. I would suggest that others look for and buy hot plates that have the necessary RCM/UL/CE markings relevant to your country.

With the safety issues resolved I could set to testing the operation of my unit to see if it indeed worked. I placed a K-Type thermocouple into my trusty multimeter and set too testing various temperature settings with various materials.

With the thermocouple sitting on the middle of the plate, the 7-segment set temperature and temp reading on the multimeter were close enough for government work. In case you were wondering +100°C is hot, so best not to touch the plate or attempt to pick up the items left on the plate for any period of time, ouch it will burn.

I do like the fact the hotplate on this unit is small, with a fiberglass surround. The fiberglass surround allows me to place my hands either side of the hotplate, without fear of being burnt. It also means I can use mechanical weights to hold things down as I solder them to various places. Hence why I could use a ball of blue-tac to hold the thermocouple wire.

On the 7-segment display the right most decimal point will flash as the heater element is switched on and off. Watching the hotplate warm-up and the 7-segment display decimal point, it would appear that some form of pulse integral control loop is being used with its own internal temp sensor. The plate warms reasonably quickly but will slow down as it approaches the set point, there was no signs of overshoot which I was happy with.

Once the main hot plate temperature was stable, I placed an old piece of PCB laminate under the temp sensor and watched the temperature on the thermocouple slowly increase. Needless to say after a couple of minutes the temperatures once again were close enough. I did adjust the set point up to +110°C as there is some noticeable thermal resistance across FR4 laminate. Likewise the copper block took a little longer at 5-6 minutes to warm up to temp, again I had to increase the set point to +120°C as copper is very good at dissipating heat, so this was of little surprise. All in all the thermal performance of this unit was good.

This hot plate should have at face value represented a real bargain, had it not been for the internal wiring and safety issues. I cannot stress how important electrical safety is, mains voltages are lethal; so please consider purchasing another unit that has the relevant safety marks.

ADLAM Pluto SDR and LMDE

So it’s been a while since I’d looked at my ADLAM Pluto SDR project, to complicate matters I’ve also recently switched to Linux. So it was time to see if I could find new SDR software to drive it.

After a few false starts and some trials and tribulations, I finally settled on SDRangel. I’ve used this app before to demodulate a High Altitude Balloon payload that transmitted a quirky DVB-T modulator using a RTL-SDR and Ubuntu Laptop.

So the only problem, SDRangel is written to natively run on Ubuntu, Windows, Mac and the rest of the distros can either use a snap package or compile from source. Sigh. Linux Mint does not like snaps, LMDE uses only flatpak’s.

SDRangel Flatpak

Now I’m not a big fan of flatpak’s either, to me they are in the same boat as snaps and docker images, unnecessarily slow, however after reading how to compile SDRangel from source, a flatpak was certainly the fastest and easiest way to let me try the software and see if I can get this working.

Thankfully I found SDRangel on Flathub. The following was all I had to do from a command line to install the flatpak, installation instructions were found here.

$ sudo flatpak install flathub org.sdrangel.SDRangel

After a short time downloading and installing it was ready.

SDR plugable UDEV Rules

SDRAngel requires udev rules to be added for the most common SDR’s, since I also intend to try RTL-SDR’s at some point, now as as good as any time to install.

The udev rules can be found here on the SDRangel GitHub repo. I simply downloaded them in a zip file to my local downloads directory, unzipped and moved them into /etc/udev/rules.d. There is an installation script (install.sh) in that same directory as the downloaded udev rules you can use or read for inspiration on the linux commands necessary.

If you find that you still can’t access these devices, check your user has the right permissions to use USB or network devices, trap for young players and outside the scope of this post. Google and Duck-Duck-Go has lots to say on this topic.

Flatpak Permissions

Before starting SDRangel I also loaded Flatseal and checked what permissions the SDRangel flatpak was requesting. Always pays to review flatpaks using Flatseal, I’ve found a few packages that had some very odd permissions and didn’t work on LMDE out of the box.

It makes sense to me to grant SDRangel access to the network, PulseAudio sound server, GPU acceleration (if used), All devices (i.e. SDR’s) and the “Run in Background” option. This is the config that worked for me, YMMV.

SDRangel Configuration

Once SDRangel is loaded, we’re greeted with a big blank screen. From here I added the ADLAM Pluto by clicking Preferences > Devices > User Arguments

I then added “PlutoSDR” in the HwID field, left seq as 0 and hit the ‘+” button which is the add symbol. I then selected the PlutoSDR entry in the lower pane, added “uri=ip:192.168.2.1” in the Args field, and hit OK. After I’d finished my config screen looked like this. Note my IP is the default PlutoDVB value, you can find what yours is set to in the config.txt file from the Pluto storage device it presents when connected to a PC. Now apparently you need to restart SDRangel for this to have any effect. YMMV.

Adding a RX Device

I then added an RX device by clicking on the menu button just to the right of the purple button with a play symbol in it. If you hover over each button, a pop up appears telling you what the button is. From the drop down box, I then selected the PlutoSDR entry which was right towards the bottom of the list.

Two screens appear, but we’ll concentrate on them one at a time. I configured the Receive window like this, more info here;

Now the thing to note. I’ve twiddled the sampling rate for reasons I’ll explain in another post. You should find the initial settings of 2.5MHz work well enough out of the box. I’ve increased the decimation from 1 to 8 in the S field, likewise I’ve selected “slow” AGC. If you then press the purple button with the white play symbol, you would see the next window start to do something interesting like this.

I didn’t change anything here, the out of the box config just worked for me. Now you might notice you don’t hear anything, that is because you have to add a channel/separate demodulator. On the receive window, just to the left of where “PlutoSDR[0:0]” appears is a button you can click to add a channel.

From the pull down box I’d choose the SSB Demodulator, which will appear on your screen. I configured it like this;

I had to play around with the sound settings, especially the audio settings which were hidden under the green speaker symbol (right click) on the right side of the screen just above the Channel Spectrum display. It is worth spending the time to read the documentation on the SDRangel website, once you realise that each part is a software plugin and how configurable this system is things get more interesting.

By the time we have the receiver configured, the spectrum display happening and a channel defined, audio should be appearing out of your speakers. If not then you’ll need to spend a bit more time debugging what’s happened with PulseAudio, mine just came to life.

I’ll also mention that if you try the Narrow Band FM channel plugin, there is a hidden squelch power threshold setting, that you need to wind down to -100 for it to open the squelch and produce white noise. It’s just to the right of “Sq” and a funny button with a triangle on it, you’ll see what I mean.

Adding a TX Device

I’m not going to reinvent the wheel here. I found a great article on the web and a video on YouTube from SignalsEverywhere that explained how to configure the ADLAM Pluto to transmit. You can find the original article from the RTL-SDR site here and the video embedded below;

Putting it all together

To prove that I could get this all working, I put the receiver on 1296.5MHz with the settings previously shown. I configured the transmitter slightly differently adding further decimation to reduce the effective bandwidth. You can see this below;

I then added a Narrow Band Modulator, by clicking the button just to the left of where “PlutoSDR[0:0]” appears in the menu bar (just like a channel button in a receive window) and selecting NFM Modulator from the drop down box. You then configure like so, based entirely on SignalsEverywhere’s YT video.

If you click on the purple button with the white triangle on the TX window, you should be greeted by CW being sent. Just so there was proof, I made and uploaded my own video.

In the above video the audio is being demodulated by the Icom R10 on 1296.5MHz NBFM just so that there was a “Real Radio (TM)” involved. The ADLAM Pluto is transmitting approximately 0dBm into a dummy load. The ADLAM Pluto receiver is displaying the received signal and waterfall, I didn’t bother with a channel/demodulator to listen to my own transmission, the R10 was doing a good enough job on it’s own.

So now that I’ve got that working, I can start to experiment with the ADLAM Pluto and some microwave multipliers to get me up into the higher bands. I also need to check it will still key the Pluto Charon kit and modify as necessary. More to this story shortly.

Goodbye Microsoft Windows

So recently I upgraded my computer to something more modern. Jumping seven or so I7 generations has brought my personal development machine from the mid-naughties back to relatively recent hardware. This time I’ve gone for a second hand one owner Dell Precision SFF desktop, which sat on my desk at work for the past 4 years, which was duly purchased when the lease expired.

Microsoft however with all their AI shenanigans incentivised me to make the switch to a Linux desktop permanently. So it was goodbye Windows 10 and hello Linux Mint, more specifically LMDE. I’m no stranger to Linux, having built and maintained Linux systems since the 90’s, but as a desktop, well that is all new.

I chose LMDE in preference to standard Linux Mint after a few arguments with the later versions of Ubuntu and their slow evolution towards snaps, which kept robbing my old laptop hardware of resources. I switched to Linux on my laptop more than six years ago and it’s been great.

For quite a few years I’ve been using and given priority to Open Source apps for my Electronics and Radio development and I was really down to one or two Windows only apps when I switched. Nothing a Virtual Machine booting windows couldn’t solve using Oracle VirtualBox, especially on this machine with newer hardware and enough RAM.

So far I’m impressed with LMDE as nearly everything has worked out of the box, including printing. So much easier than Slackware compiling everything from source back in the day. I was however caught out by secure boot and VirtualBox, which lead to learning’s on the DKMS driver signing mechanisms, which ultimately saved me from NVIDIA Driver horrors; which is the subject of another post I must get around to soon.

It’s now been more than three months since I’ve switched and I’ve not needed to switch back, on-wards and up-wards !

Further Pluto PTT issues…

In my last post on the Pluto External PTT I had done some preliminary testing of the external PTT output using a multi-meter before wiring it to the Pluto Charon and confirming it worked. It was at this point things took a jump to the left and then a step to the right…

What I noticed is I would hit the TX button in SDR-Console and there would be a pause, one, two, three, then click would go the transmit receive (TRX) relay. Hmm that’s not going to do, a 3s delay between the PC software PTT and the Pluto Charon external amplifier ain’t going to work on FM/SSB.

However if I hit the TX button in SDR-Console again the TRX relay would click and go off without any delay. Now that was strange and the asymmetric nature of operation required further investigation.

The first step was to rule out the hardware, so with a C.R.O on the Pluto Charon PTT line (connector A1) and another on the ADALM Pluto GPO0 pin (yellow and cyan respectively) we can check that the switching is nice and clean.

Nope nothing to see here, you can see the transistor on the Pluto Charon PTT board pulling the PTT line low and hitting zero volts in no more than 12us. Problem has to be elsewhere.

So now were into firmware and software territory, sigh this is going to be one of those rabbit holes.

I firstly tried the “for the brave” firmware that can be found on the Mini-kits support website, which is an early version of the PlutoDVB firmware. This changed the behavior entirely and there was a delay of 1-1.5s each time the external PTT changed state from ON to OFF. Not what I wanted, but better and perhaps more usable than the 3s ON and instant OFF I was seeing on the PlutoDVB revision 3.0.3 firmware + Rev C/D patch.

Further reading from the analog devices website suggested that the GPO pin connected my external PTT module could be controlled by some ENSM module within the AD9361-phy linux driver, so I tried some experiments with SDR-Console and the Analog Devices stock v0.38 firmware, that didn’t work either. It was clear that SDR-Console was not using this IIO method to switch the Pluto in to TX or RX.

So I revisited the latest PlutoDVB firmware (perseverance 3.0.3 + Rev C/D patch) once again reading and watching more closely this time.

It was while applying the patch I saw something interesting, I’ve highlighted it in red adjacent. I wonder what that script does ?

The whole reason the patch was required in PlutoDVB Perseverance 3.0.3 firmware was to get the PTT working with revision C & D hardware. I wonder if that is where I start ?

So let me log into the Pluto and take a peek at the script.

#!/bin/sh
#https://www.analog.com/media/cn/technical-documentation/user-guides/AD9364_Register_Map_Reference_Manual_UG-672.pdf
source /root/device_sel.sh
ptton()
{
    #PTT on GPIO 0 AND GPIO 2 (GPIO 1 should be not touched)
    echo 0x27 0x50 > /sys/kernel/debug/iio/iio:device$dev/direct_reg_access
    mosquitto_pub -t plutodvb/status/tx -m true
}

pttoff()
{
    echo 0x27 0x00 > /sys/kernel/debug/iio/iio:device$dev/direct_reg_access
    mosquitto_pub -t plutodvb/status/tx -m false
}

echo manual_tx_quad > /sys/bus/iio/devices/iio:device$dev/calib_mode
#Manual GPIO
echo 0x26 0x10 > /sys/kernel/debug/iio/iio:device$dev/direct_reg_access
pttoff

while :
do
inotifywait -e modify /sys/bus/iio/devices/iio\:device$dev/out_voltage0_hardwaregain
gain=$(cat /sys/bus/iio/devices/iio:device$dev/out_voltage0_hardwaregain)
if [ "$gain" = "-40.000000 dB" ] ; then
    echo "SdrConsole PTT OFF"
    pttoff
else
    if [ "$gain" = "0.000000 dB" ] ; then
        sleep 2
        gain=$(cat /sys/bus/iio/devices/iio:device$dev/out_voltage0_hardwaregain)
        if [ "$gain" = "0.000000 dB" ] ; then
            echo "SdrConsole Power Max PTT ON"
            ptton
        fi
        else
            echo "SdrConsole PTT ON"
            ptton
        fi
    fi
done

So reading my way through this script by the time I hit line 24 I had confirmed

  • SDR-Console does not use the ENSM module within the Pluto ad9361-phy driver
  • Instead the script uses the sysfs subsystem to read different values from the IIO driver
  • SDR-Console varies the TX gain within the IIO driver between two limits that the script interprets and drives the relevant GPO pin
  • In an attempt to prevent a race condition, line 31 introduces a 2s sleep function between successive reads of the gain value

Guess where the 3s delay I’ve been searching for comes from !?!

So a quick bit of hacking on this script, changing line 31 to read “sleep 0.1” or 100ms, then restarting the “watchconsoletx.sh” process increased the speed of the external PTT to the point where the delay between SDR-Console and the TRX relay on the Pluto Charon activating is nearly imperceptible. I’m not sure if using a fraction of one second is valid in this shell, it may have been ignoring it, but it proved my point.

However what I’ve done to this script and the way in which SDR-Console works I’m not convinced will work 100% of the time. The other problem is any changes that are made to these script files are not permanent they are only kept in RAM, so as soon as you reboot they revert to those stored in volatile memory (flash).

So it looks like I may have to reverse engineer the “pluto.frm” file and see if I can hack together a better script to make this work how I want. At least I now know where the 3s delay has come from and that there are possibilities to fix it.

That however will have to wait until the next post.

Pluto PTT and PlutoDVB Firmware

The next step in the process of using the ADALM Pluto is sorting out a press-to-talk output to drive the Pluto Charon. In this instance I’ve followed the tried and trodden path of adding a small transistor output to one of the GPIO pins and updating the firmware. There are some interesting articles on the ADI website that discuss how to do this via the FPGA, but I decided to learn to walk before I ran.

When I ordered my Pluto Charon kit I also purchased the separate PTT module which you can see here (click). This is very easy to install, just make sure you observe good ESD practices when you remove the Pluto from it’s case and handle it on the bench.

Here’s the photo’s of how I installed mine.

I decided to use a small two pin right angle KK 0.254″ molex connector for the PTT output, as I’d like the capability of unplugging Pluto and Charon boards for service/changes/updates etc.

Now for the hairy scary part of the process. On the Mini-kits website is a URL to some custom firmware written by Evariste F5OEO that can enable a PTT function on a GPIO pin. I was at first a little alarmed by the comment “for the brave”, but it turns out this firmware is part of the PlutoDVB project. You can find later software from 2022 on Christian F5UII’s website (click) and you’ll see some comments about fixing the PTT on the Pluto Rev D boards to work with the latest versions of SDR-Console. I have a Pluto Rev C, which is the same as the Pluto Rev D, so I had no choice but to use this newer firmware and work out what to download.

So after reading most of Christians Website I discovered I had to do two things. Firstly I had to swap from the official ADI Pluto v0.38 firmware to the custom PlutoDVB 3.0.3 firmware. Secondly patch the 3.0.3 firmware to account for the Rev D hardware. This wasn’t obvious where to start.

Below is a summary of the steps I used to swap the firmware.

  • Connected the Pluto to my PC, checked it had presented a removable drive
  • Download the firmware from Christian F5UII”s website, I used the PlutoDVB perseverance firmware 0303 (26.6M)
  • Extracted the pluto.frm from the downloaded zip and stored it on the Pluto removable drive created on my PC (don’t get confused or alarmed by the file name “patch.zip” as this is indeed the entire firmware)
  • Ejected the Pluto and waited for it to finish doing the upgrade and reboot, once done it reconnected to the PC
  • Used a web-browser to point to http://192.168.2.1/index.html, confirmed it presented the “Lets go to PlutoDVB” welcome screen, not the ADI reference material.
  • Then clicked on the “Lets go to PlutoDVB (USB connection)” button which launched into the system setup.php page
  • From the menu across the top, selected “System ” then “Maintenance” where I found the patching and upgrading firmware mechanism.
  • For my hardware (Rev C/D) I needed to download and apply the “Patch for PlutoSDR Rev. D hardware”
  • Applied the patch, saw that within the “Delete Patch” window the updated files were displayed once done
  • Success !

Now I could configure the PlutoDVB firmware to do what I wanted, which in my case was to use SDR-Console. So from the “system” menu at the top I clicked on the “Pass-through” option and hit apply. That should be all I needed to complete.

There is an error message displayed across the top of the screen about a datv text file not being present. If you enter your call-sign in the respective field on the setup page and your name in the DVB provider field, hit “apply settings” and this will create the right file and the error message disappears.

Once all of this was done, I was able to setup and configure SDR-Console and test that the PTT worked with a multi-meter. Below you can see SDR-Console listening on 23cm ready for me to hit the TX button. The Pluto is sitting right up against the PC, so I’m not surprised there are some birdies in the shack, I’ll only panic once the Pluto and Charon and boxed up together.

For my next trick I intend to hook this up to my CRO and see how long before or after the PTT line is asserted does RF appear at the transmit port. However that will have to wait for the next post.

Boxing a Pluto Charon – the Heatsink

For the past couple of weeks I’ve been giving some thought as to how I’d box up the Mini-kits Pluto Charon. As with any problem the first step it to work out how I want to use it.

I’d like to be able to use the Pluto Charon both in the field and in the ham shack. The ADLAM Pluto connects to a PC via a micro USB and presents itself as a USB Ethernet device.

Further reading suggests that the ADLAM Pluto USB OTG port can host an external USB-Ethernet adapter or USB-WiFi adapter, making it possible to un-tether the Pluto from a PC or use standard IT infrastructure. In my situation an external Ethernet port is of interest, since I could easily build all of the Mini-Kits Pluto boards into their own enclosure and simply network them together and into the same PC without having to count on multiple USB ports. This again fits with my field and shack mode of operation.

The output power of the Mini-kits Pluto Charon, Pluto Styx and proposed Pluto Nix kit is in the region of one to two watts. This is more than enough transmit power to jump from hilltop to hilltop over quite a path with some antenna gain and short cables. If however you want to lift the antennas up to the top of mast, external in-line amplifiers up behind the antennas would be required to keep losses under control. If the external amplifiers also included a separate mast head amplifier, then losses of up to 6-8dB at any of these microwave frequencies could be accommodated without significantly impacting performance. I’ll be exploring this further once the first Pluto Charon kit is completed.

So, the first step of course is to get the Pluto Charon kit operational, to do that I needed to test it. The kit came with a small 40x40mm heatsink that I could attach to dissipate the heat from the final amplifier IC1. I mulled this over for a while before deciding I’d prefer to put a much larger heatsink on the top of a die cast box and mount the Pluto Charon to that. A good example of what I’m thinking is how I built my Rubidium reference (here). My main reasoning is I’d like to stabilise the heat within the die cast box so the Pluto does not need to work so hard on keeping the frequency stable. Did I mention the Rubidium reference, one would say this started these shenanigans.

To get the heat out of the Pluto Charon final amplifier the layout dictated a small copper block to be made. There are components on the top and bottom of this board, so one needs to pay attention to clearances etc. So it was off to see a good friend with a lathe ;thanks Peter it was a fun afternoon and some good machining Zen !

It is no coincidence that the copper block is 10mm thick, this is perfect for three 10mm hexagonal spacers to be placed under the remaining three sides of the PCB for support.

The hole in the middle of the copper block is what transfers the heat from IC1, so this was tapped to accept a M3 hole. The PCB had a plated 2.5mm hole and was reamed out slightly to accept the larger M3 screw. The M3 screw used was tin plated copper, not tin plated steel/stainless which is a poor conductor of heat.

The remaining four holes in the PCB that hold the heatsink were left M2.5 and the holes through the copper block drilled 3mm for clearance. When this is attached to the heatsink, four M2.5 x16mm screws through these holes in the heatsink, washers and split washers will be used to sandwich the assembly and keep everything held tight.

So I don’t forget and for anyone following along at home I’ve included the drill pattern. This was the only information conspicuously absent from the assembly instructions. This drawing is drawn from the top of the PCB looking down. The hole in the middle of the heatsink is referenced from the center of the copper block. For some reason I can’t get LibreCAD to show a mark for the origin yet. I hate having to measure PCB’s to get hole locations, a combination of transfer punches, vernier calipers and gauge pins were used to establish and check that these locations were close enough.

Now it’s time to carry on with the Testing and Alignment of the Pluto Charon !