In the previous article, I started the construction of the EasiBuild Mk 2 with the power regulation and supply board. In this article, I detail the digital controller of the transceiver.

[See the full list of articles in this series HERE]

In the original circuit, switching between receive and transmit was done manually with a switch (and was frequently forgotten!). The transceiver was a VFO-based (variable frequency oscillator) single-band design with a front panel scale around the tuning capacitor indicating frequency. RIT (receiver incremental tuning) was a front panel potentiometer, and the sidetone was generated by its own circuit and injected into the audio amplifier.

In this revised version, RX/TX switching is performed automatically when the key is pressed. A paddle is also supported with proper keying signals and timing being generated. Three bands are available, with swappable filter blocks: you can configure which filter is in which socket via the menu. The VFO/buffer is replaced by an AD9850 DDS (direct digital synthesis) module and buffer amplifier. Tuning and band switching is done automatically via a front panel rotary encoder and its pushbutton. Frequency display and other information is via a front panel 16×2 LCD display. The sidetone is generated when the keying signal is sent, as a shaped PWM (pulse width modulation) signal, converted to audio by an RC network, and injected into the audio amplifier. All the above is orchestrated by a microcontroller. Connections to the other modules in the transceiver are via 2.54mm pin headers.

Schematic

The schematic for the control board is shown below (click diagram for a slightly larger version):

Schematic of the EasiBuild Mk 2 Digital Controller

Design

The purpose of this module is to hold the microcontroller (mounted on 2.54mm female headers), and to connect its various pins to groups of 2.54mm male pin headers that lead off to other modules in the system, for neatness. There’s no extra logic, driving, buffering or opto-isolation circuitry in this module, everything connecting in here is TTL, and the audio sidetone output. This makes it easy to test in isolation from the rest of the system.

I chose the Arduino Micro as it had just enough I/O capacity for this project, and I’d used it before in my antenna analyser project. Other members of the Arduino family would give more flexibility.

The Arduino Micro Pinout

Thanks to Bouni for the diagram of the Arduino Micro pinout above (click diagram for a much larger version).

Please note that there are several errors on the diagram, I’ve notified Bouni and will update this post when a corrected diagram is available. The errors affecting this board (there are other errors) are:

  • A0 is D18, not 14.
  • A1 is D19, not 15,
  • A2 is D20, not 16,
  • A3 is D21, not 17,
  • A4 is D22, not 18,
  • A5 is D23, not 19,

The discussion below will refer to the corrected micro’s pins by the coloured names in the diagram.

Digital input pins are mapped to their functions in the transceiver as follows:

  • 12/DAH from paddle or DOWN from straight key
  • 11/DIT from paddle or DOWN from straight key
  • 10/ENCR, the right quadrature signal from the rotary encoder
  • 9/ENCL, the left quadrature signal from the rotary encoder
  • 8/BTN, the pushbutton on the rotary encoder

The Arduino’s internal, software-controllable pull-up resistors are enabled for all these input pins. This group of pins are used for digital inputs, since all their states can be discovered by a read of the PINx locations in an interrupt handler, which I’m doing in the sidetone generator’s timer ISR. I considered using the AVR’s pin change interrupt: one interrupt occurs when any of the pins change state. Pins 8-11 use the “PIN B” interrupt, and pin 12 uses the “PIN D” interrupt. Since the USB RX/TX (specifically, RX) are likely to generate interrupts on USB traffic, and I intend to provide a back-panel USB connector, possibly for diagnostics or even CAT control, I’ve not used the pin change interrupt, so this led me to a simple read of PIN B and D under a regular timer interrupt. Debouncing is done in software.

It remains to be seen whether I skimped a bit on control push buttons – I have pin 13 available that I might make use of.

I’ll go into the software design in a later article, so no more on that now.

Digital outputs are mapped to their functions in the transceiver as follows:

  • 18/DDS_RESET for AD9850 control (14 is erroneous on the diagram)
  • 19/DDS_DATA for AD9850 control (15 is erroneous)
  • 20/DDS_UPDATE for AD9850 control (17 is erroneous)
  • 21/DDS_CLOCK for AD9850 control (16 is erroneous)
  • 22/BAND3 for switching the third bandpass filter in circuit (18 is erroneous)
  • 23/BAND2 second bandpass filter (19 is erroneous)
  • 7/BAND1 first bandpass filter
  • 6/RX/TX for switching between receive and transmit
  • 5/TONE, PWM output for the sidetone, via an RC network
  • 4/KEY for switching the PA on, in transmit mode
  • 3/SCL connection to the LCD via I2C-to-parallel adapter
  • 2/SDA          ”        “

Although the power module provides a 5v supply, which could be used to supply the LCD I2C module, I’ve chosen to power the I2C module with the 5v supply generated by the Arduino.

The RC network on pin 5’s PWM output converts the PWM signal to audio, as described in the MicroChip application note Using PWM to Generate Analog Output.
From the application note, I want an upper frequency for the low pass filter of 1.5kHz, and choosing K=5, and the -3dB point at 1.5kHz:

  • RC= 1/(2 π f)
  • RC= 1/(3000 π)
  • With C as a 0.01μF, R would be about 10kOhm.

Use a polyester capacitor for C, as per Dave Richard’s advice in the hi-per-mite forum.

Construction

Again, I’m using prototype board for this module.

The board layout I used is shown below (click diagram for a larger version):

Schematic of the EasiBuild Mk 2 Control Board

This is the view from the component side; I mirrored the above bitmap horizontally in GIMP and printed it to ensure I got the wiring on the underside right.

I’m using Eagle to design these schematic and board diagrams. Eagle is an excellent CAD system available in a freeware version for non-profit use. However, it is intended to aid design of “proper” printed circuit boards: it has no built-in knowledge/rules for working with prototype board or stripboard. I’ve adopted some conventions for using it with these boards.

Blue lines are wires on the underside. The holes of the prototype board coincide with the intersections of the grid lines. I’m supplying a screen grab of the board layout, as Eagle’s normal export-to-bitmap omits the grid: I can’t lay out prototype board without it!

The board layout is somewhat idealised: Looking at the left-hand side of the board layout, Arduino pin 22/BAND3 (A4 on the Arduino component) is broken out to a connecting wire that isn’t exactly on a grid intersection. In the actual build, it is, but the wire is bent a bit at the end – you’ll see in the photos at the end. Also, the top-right digital inputs on the Arduino look bent at right angles, and also not on grid intersections – they’re actually completely straight on the board. This is so I can fit all the wiring and pin headers on the 18×24 prototype board. Note that all wiring on this board uses insulated 1/0.6 wire – apart from the GND connection on the right hand of the Arduino: there are two junctions there.

Solder all pin headers in place first, then do the wiring. The Arduino sockets are made from four 10-pin female 2.54mm headers, two of which are cut down to 7 pin, and sanded to fit alongside the 10-pin header.

The picture below shows the wiring about half-complete.

Underside of the EasiBuild Mk 2 Control Board, half-way done

I should have taken a picture earlier than this (sorry), as the white (band select) and red (+5v to panel) wires obscure the connections between the power header and Arduino (row 6 and 7 on the right hand side of the Arduino). The ground connections, sidetone RC network, and TX key header are tricky (rows 9 to 12 on the left hand side of the Arduino). They get obscured in the next pictures….

Of course, it’s only after spending a few weeks’ spare time designing the board in Eagle and several hours building it, then looking at these photos that you realise that you could have routed these wires underneath the Arduino, inside its pins rather than outside. Thinking outside the box requires you to realise that there is, actually, a box. Or not, in this case. You also realise after the construction that the RC network’s capacitor should have been polyester, not ceramic, as ceramics tend to introduce microphony into audio circuits. It’s what I had on the bench when building… and it was a 0.1μF I used, not a 0.01μF, as per the schematic. I’ll change it later. As the philosopher Homer exclaimed on more than one occasion: “D’oh!”. Hopefully this won’t be a big problem.

Underside of the EasiBuild Mk 2 Control Board, a bit further

Here you can see the rest of the panel input connections.

Underside of the EasiBuild Mk 2 Control Board, finished

The finished board.

Topside of the EasiBuild Mk 2 Control Board, without Arduino

Without an Arduino you can make out the sets of 10-pin headers.

Topside of the EasiBuild Mk 2 Control Board, finished

Finished!

I haven’t chosen a case in which to mount the modules yet; one point to note is that there will need to be about 3cm clearance at the top of this board to take the USB adapter cable that will be mounted on the back panel.

The components for the front panel (rotary encoder, paddle 3.5mm jack connector, and LCD I2C board) should all be connected to the panel connector.

Parts List

Part Value
C1 0.01μF polystyrene
R1 10k
FROM_PWR 2-pin male 2.54mm header
BAND_SELECT_TO_FILTERS, TO_DDS 5-pin male 2.54mm header
KEY_TO_TX, SIDETONE_TO_AF 2-pin male 2.54mm header
PANEL 9-pin male 2.54mm header
HDR1, HDR2 10-hole female 2.54mm header
HDR3, HDR4 10-hole female 2.54mm header cut down to 7-pin

Testing

Before inserting the Arduino, check all points for continuity and shorts, then add Arduino, attach to power board, and ensure 5v is present on panel connector, and that Arduino boots.

The firmware permits compilation in ‘test harness mode’, by defining one of several preprocessor symbols. See the EasiBuildMk2.ino Arduino file in the code repository. There are several harnesses:

  • Input signals: BTN, DIT, DAH, ENCR, ENCL as a binary / hex number. Touch the controls, see the pins change.
  • Output signals: BAND1, BAND2, BAND3, RX/TX, KEY, DDS_RESET, DDS_DATA, DDS_CLOCK, DDS_UPDATE. Use the rotary encoder to switch to a different signal, or wait and it’ll loop through the set, toggling the pin shown on the LCD once per second. Test with meter, logic probe or scope.
  • Sidetone: use rotary encoder to adjust volume, press button to switch to use rotary encoder to adjust pitch.
  • Events: detection, debouncing of input signals and conversion into ‘events’ that are pushed onto a FIFO, that are decoded and displayed on the serial console.

Conclusion
After some initial teething issues, with incorrect pin numbering on the diagram I was following, the board tests out fine, and is now allowing me to build the UI framework I need to write the firmware. I’ll write a separate post about the firmware, its design, and test-driven development of Arduino code (without an actual Arduino).

Stay tuned….

Acknowledgements
Thanks to Bouni for the Arduino pinout diagram; Jenny List G7CKF and Dr. Lucy Rogers for advice on working with Eagle; Bill W0WCA and Dave Richards AA7EE for advice on use of polyester capacitors in audio circuits (that I completely forgot when I came to build!); Mike N2HTT for his 3-band VFO project, and details of the rotary encoder which I’ve used in this project; Colin M1BUU for showing his DDS signal generator, illustrating connection details, construction techniques, and for advice on driving the LCD; Mark VandeWettering K6HX for info on using PWM for audio.

In the next article, I’ll get into the actual radio hardware design, with the addition of the direct digital synthesis and buffer amplifier.

Updated 10 Mar 2020 with image URLs moved to github.