A compact project: The “Micro42” – Another “shirt pocket” SSB transceiver.

The Micro42 - A really pocket sized SSB QRP transceiver for 7MHz

Having deferred the work on the “micro multibander” for some time I finished another small QRP rig (this one for 7MHz) that is suitable for my summer excursions by bike or hiking the local mountains here in the State of Rhineland-Palatinate or the Black Forest that is not that far away on the other side of the Rhine valley.

Besides, this transceiver to be discussed here is some sort of a “remake” of a 20 meter rig I built 3 years before. And this time, the transceiver really fits into a shirt pocket without having to wear “XXXXL”- clothing. ;-):

The Micro42 - A really shirt pocket sized QRP SSB transceiver
The Micro42 – A really shirt pocket sized QRP SSB transceiver (this is my work shirt, so don’t mind the stains! 😉 )

General circuit description (instead of presenting a block diagram)

The rig uses two mixers NE602 plus one filter as central elements. The signal way is reversed when switching from receive to trasmit mode. This is done by 2 relays and is a well known technique for simple QRP rigs. You will find lots of equivalent ideas on the internet (Example 1, Example 2).

But not to ignore the shortcomings of these designs: They are somehow inferior to my requirements, particularly concercing receiver performance. I prefer to have higher signal gain and an AGC circuit. AGC for me is a must. But these designs can be expanded easily, so I added an AGC controlled interfrequency amplifier with dual gate MOSFET BF998 into the receiver’s signal path enhancing performance significantly.

Frequency layout

The frequency generation of the superhet transceiver scheme is simple: Again I use one interfrequency (i. e. 9MHz). The VFO is DDS based on AD9835 operating below the desired radio frequency, which means that it is set to the range of about 2 MHz. Due to this low frequency you could replace the DDS by a VFO if you don’t like the relatively complex work with the software programming and microcontroller stuff). A 2MHz VFO can also be made very stable, so this is an alternative not to be ignoered.

Due to the fact that the schematic is not very difficult to analyze you are kindly requested to refer to it for further talking:

Schematic - The Micro42 - A really shirt pocket sized QRP SSB transceiver
Schematic – The Micro42 – A really shirt pocket sized QRP SSB transceiver. Click for full size picture

Circuit description

In the center of the schematic you can see the main elements of the circuit: One SSB filter (9MHz), correctly terminated by 2 resistors of 1k each (to ensure proper filter response curve) and two relays with a double set of switches. These relays reverse the way the signal travels through the filter. The advantage of this: You can use the integrated oscillator of the NE612 controlled by a crystal and a tuning capacitor to set the carrier frequency correctly for the lower sideband because the mixer is used as SSB generator and as product detector in common.

A word on chosing the proper relays: An intense examination of the relays’ data sheet is essential. I built a prototype of this transceiver on a breadboard prior to soldering the components to a veroboard. I found that some SMD relays have signifikant coupling capacities between the unused relay contacts (in the range of some Picofarads). So stray coupling was a severe problem. Later I used some second-hand Teledyne RF relays that I had purchased via ebay two years ago (price originally 50€!) for 1€ each. These relays are absolutely superb!

The receiver

Before we go: In the circuit scheme above I missed out the antenna switch relay because I think every homebrewer knows what to do in this case. 😉 So the receiver’s signal path starts with a band filter for 7MHz consisting of to tuned LC circuits.  The coupling is relatively loose. As coils I use the well known coil formers in TOKO style with 5.5mm outside measure.

Coil data for the 7MHz band pass filter (BPF) is 39 turns primary and 9 turns secondary of 0.1 mm enameled wire. The respective capacitor is 33pF. This is a high L to C ratio which gives you excellent LC quality factor. This is mandatory especially when working on the 40 meter band, because of the strong broadcasters starting from 7.200 kHz intermodulation might be a problem when the receiver is connected to a high gain antenna and broadcasters’ signals might overload the first mixer (remember that NE612 has a relatively low IM3!). If you still should have problems coping with too strong out-of-band signals you can reduce the coupler from 4.7pF down to 2.7pF.

In practical terms I could not detect any unwanted signal products even when using an antenna with high rf output voltage. One reasons for this is, that there is no rf preamplifier for the receiver. This avoids overloading the first mixer generally.

The NE612 has two mixer inputs and two outputs. This makes it very suitable for this sort of radio. In receive mode pin 2 of the right NE612 is used as signal input. VFO signal is fed into pin 6. The resulting mixer products are taken out from pin 4. Next the 9MHz filter follows from right to left.

The 9MHz IF signal then is fed into an IF amplifier. This one is equipped with a dual gate MOSFET (BF998), gain is about 15dB when full AGC voltage is applied wich leads to about 6V by the 1:1 volatge divider in the applied to gate 2 of the MOSFET.

The left NE612 is the product detector. I use the internal oscillator with a 9MHz crsytal and a tuning capacitor here. This saves building an extra oscillator and simplifies the rig again.

One AF low pass filter made of 1k resistor, 100uF rf choke and a 0.1 uF capacitor eliminates high frequency remainders generated by the mixing process.

The audio stages are also made simple: One preamplifier (using bipolar transistor in grounded emmitter circuit) and a final stage with LM386 transform the signal to a level that is sufficient to be fed into a small 8 ohm loudspeaker or a set of standrd MP3-player headphones. Because the rig is very small and there was definetely no space for a loudspeaker I use headphones instead.

Keep an eye on the power supply switching of the two audio stages. The problem was to eliminate the switching click and pops to a minimum and to avoid acoustic feedback when unsing a loudspeaker. So the audio preamp is only connected to DC on receive. When switching to transmit the charged capacitors avoid instant cut off supplying some Milliseconds DC to the amp until significantly discharged. The main amplfier on the other hand is connected to permanent DC supply. So it won’t pop when switching from tx to rx an vice versa but can cause feedback. To avoid feedback a transistor is used to cut the speaker/earphone from the power amplifier.

AGC

AGC is audio derived. A two stage amplifier provides a DC voltage analog to the audio input sginal strength. First amplifier stage is a common emitter bipolar transistor supplying sufficient audio voltage. This voltage is rectified by a two diode circuit letting only the positive halfways pass. You can use silicon diodes (1N1418) oder Schottky diodes here. An electrolytic capacitor (100uF/6V) provides the time constant respectively DC decay once the signal has disappeared. Output of the DC stage is split. The collector is connected to 12V via a 4.7k resistors causing a voltage drop when the transitor’s conductivity increases. The emitter is fed to the ADC of the microcontroller (pin ADC1) causing a proportional voltage to the voltage of the applied audio signal so that on the OLED an S-meter can be displayed.

The transmitter

An electret microphone picks the operator’s voice. The signal output level of these microphones is high enough to drive the left NE612 (which serves as balanced modulator in this case) directly. Signal input for the mixer should be 200mV RMS according to data sheet. An electret produces about 0.5 to 1 V pp if spoken with a decent voice in the distance of some centimeters. So you have more than enough audio signal power for the modulator.

BTW: Carrier suppression of the modulator is excellent. I achieved 56dB without doing anything else!

The resulting DSB signal then is fed into the SSB filter, the SSB signal subsequently is directly sent into the right NE612. A band pass filter for 7 MHz eliminates the unwanted mixer products. You should have 400 to 500 mV pp of rf signal here when the transmitter input is fully driven. I recommend a two-tone test generator to check out the linearity of this and the remaining amplifier stages!

Next parts of the transmitter are a band pass filter (same coils and capacitors like th rx bandpass filter), a preamplifier and a driver. The later should put out about 150 mW into a 50 ohm load. They are made more linear by emitter degeneration (4.7 and 2.2 ohm resistors for predriver and driver) and negative feedback. This helps to ensure that transmitter performance is fine when IMD3 products are concerned even if the main IMD3 problems usually occur in the final stage.

To transfer the rf power into the final stage proper impedance matching is mandatory. Input impedance of the final stage is fairly low (<10ohms), therefore a broadband (down)transformer is used. Data is: Core T37-43, primary 12 turns, secondary 4 turns of 0.4 mm enamled wire.

Last stage is a single ended linear amplifier in AB mode equipped with a 2SC1969 rf power transistor by eleflow.com.

BIAS circuit: The combination of the 1k resistor, a silicon diode (1N4002 or equ.) and a capacitor sets up the correct bias. Bias is fed into the cold end of the input transformer. Quiescant current should be around 40mA. A good thermal contact between the diode and the transistor is recommended. As the transistor gets warmer the diode will increase its conductivity so reducing bias current. This will prevent thermal runaway effectively!

To avoid bulky output transformers the PI-filter (7MHz LPF) is part of the tank circuit of the final amplifier transistor. For this power level this is an acceptable and practical solution because the output impedance of the stage is nearly equivalent to 50 Ohms. A certain mismatch is not a severe problem. DC to the final transistor is applied via an rf choke, for exact data please refer to the schematic!

T2 helps to suppress unwanted signals that I encountered when taking the transmitter from the dummy load test environment to a real antenna. I observed unwanted parasetic oscillation in the range of about 1MHz. T2 has a low reactance for this frequency range thus eliminating the oscillations in a reilable way by short circuiting them towards ground.

Powered with 12.5V DC the transmitter will put out slightly more than 5 watts PEP.

DDS VFO

AD9835 is a simple but well performing 10-bit DDS chip made by Analog Devices (AD). It is controlled via 3 SPI lines transmitting the frequency data. Maximum output frequency is around 16MHz when the chip is clocked with its maximum clock rate of 50 MHz. Oscillator output voltage is some hundred millivolts peak-to-peak, so you can connect the output directly to pin 6 of the NE612 mixer.

Control signals come from an Arduino Pro Mini board. The microcontroller in this module is, if you are an Arduino user, preinstalled with a bootloader program. I overwrote this small portion of code and use the ATMega168, which is the core of the Arduino, in “native” mode. My software is written in C and transferred via “AVR dude” software using the ISP lines MOSI, MISO, SCK and RESET. These lines are not in the schematic, please refor to ATmega168 data sheet. Alternatively you can use, like shown in the schematic, an ATmega168 controller. So you have to de neccessary wiring on your own.

You will find the source code here. I packed it into an Open Document Text File because of problems I encountered when I tried to store the code into this Blogtext. If you need a compiled HEX-file, please feel free to email me!

Display is a very small OLED with 64 by 32 pixels. The OLED is, to my point of view, a little bit noisy. To suppress any rf traveling on VDD line I use an 82 ohm resistor and a set of bypass capacitors of 100uF and 0.1uF capacity closely connected  to the OLED VDD pin to GND.

A low pass filter by the output of the DDS ensures spectral purity and avoids clock oscillator feed through. Remember that if you need another output frequency other than 2 MHz you should redesign the low pass filter.

Frequency control

Tuning is done by a rotary encoder connected to PD5 and PD6 of the microcontroller. I use the pull up resistors internal to the microcontroller, so you won’t see any other things than the mere encoder.

Tunings steps are selected by pushing the encoder knob or another suitable push button. This button is connected to ADC0 in the ATMega168 via a 3.9k resistor. The resulting ADC voltage might be problem because of a certain variation in the values of the pull up resistors that form the second resistor of the voltage divider.  There is an outcommented section in the code that will show you the exact ADC value that has to be typed into the code so that key recognition works exactly.

The button once pushed will increase the tuning step by a certain amount of Hz. Steps are 10, 50, 100 (standard step), 250, 500, 1000 and 5000 Hz in and endlessly revolving chain.  The step will be reset to 100Hz (standard tuning step) by leaving the tuning knob idle for 2 seconds. That’s all with the controls. Very simple, but sufficient.

Practical aspects

The transceiver is constructed on a double sided veroboard with 6 by 8 centimeters area. Components are through hole and SMD where available. The Arduino is mounted to the front panel (another Veroboard carrying the controls etc.) as well as the OLED is. The veroboard is inserted into an aluminium frame connected to the front panel with 4 lateral M2 screws:

Mounting frame - The Micro42 - A really shirt pocket sized QRP SSB transceiver
Mounting frame – The Micro42 – A really shirt pocket sized QRP SSB transceiver

Design hints:

Wiring can be made by using the colored lines stripped from old parallel printer cables. These cables have a diameter of precisely 1mm an fit through the holes of the veroboard excactly.

If you connect any external components that are not on the same veroboard use standard 2.54 mm (0.1″) male and female board connectors! This will make it much easier to dismantle and reassemble the rig in case troubleshooting is neccessary.

Use M2 srews instaed of M3 when building very small rigs like this one!

The reverse side of the main arrangement:

Reverse side of mounting frame - The Micro42 - A really shirt pocket sized QRP SSB transceiverord-and-front-assembled-in-frame-reverse
Reverse side of mounting frame – The Micro42 – A really shirt pocket sized QRP SSB transceiver

Two brass made bends (from the local hardware store and each cut to a length of 8 centimeters) hold the PCB inside the mounting frame. A winding has been cut into the brass to fix the bends with screws in M2.

Final assembly

Together with 2 halves of a bent aluminium cabinet covered with “DC-fix” (a German manufacturer of self-adhesive PVC coating) the final rig looks like that:

The Micro42 - A really pocket sized SSB QRP transceiver for 7MHz
The Micro42 – A really pocket sized SSB QRP transceiver for 7MHz

So, that’s the end of the story so far. Now it’s time for going outdoor and test the rig in field use. 😉

73 and thanks for watching!

Peter (DK7IH)

Advertisements

Errata: Schematic of 14 MHz handheld transceiver revised

OK, I admit it: Drawing schematics is not among my favourite hobbies. 😉 But it’s a must if you run an amateur radio blog. 😉 Sadly, I sometimes make mistakes. And I appreciate that attentive readers sometimes find the things I’ve lost sight of. Two minor changes thus had to be made in the schematic of my portable handheld rig for 14 MHz: REF pins at the AD9835 are now connected correctly to ground and the ATMega328 is now correctly power supplied. Thanks to Hellmuth, DF7VX, for his annotations!

Revised schematic of QRP SSB handheld transceiver for 14 MHz/20Meter by DK7IH (Peter Rachow)
Revised schematic of QRP SSB handheld transceiver for 14 MHz/20Meter by DK7IH (Peter Rachow)

Update: Software for DDS-controlled QRP SSB handheld transceiver (AD9835, ATmega328P)

Recently I had a lot of new ideas for my QRP SSB handheld radio. When starting to program the first changes to my old software, I found out that the ATmega8 had become too small concerning flash size. The program became too large for 8kb memory size. The only thing I could do was to use another MCU that was PIN-compatible and did not require lots of code changes.

ATMEL has got the ATmega48, ATmega88, ATmega168, ATmega328(P)-series on the market. These are also, like the ATmega8, controllers packed in 28-pin-DIL-package. Above all, they are PIN-compatibel to the ATmega8. I decided to use an ATmega328 to update my radio. This MCU provides 32kB of FLASH memory which is more than enough for my application.

Some slight code alternations also had to be done, because some register names have been changed and the SLEEP-method had to be slightly revised. What I deeply regretted was the fact that I couldn’t use my old YAAP-ISP software anymore because it’s much too old and does not support this controller. But AVRDUDE works fine. These were the main obstacles that I had to deal with. After 2 or 3 hours of programming the software job was done. The ATmega328P does a perfect job in my transceiver. Full code will be presented by the end of this article.

Important: The ATmega328P reaches the customer with the factory setting of an 8MHz rate for its main clock. But there is a fuse that divides this clock rate by the factor of 8. This one is activated by factory also. So, your MCU performs like an old ATmega8 with factory default set if this fuse is not changed. Goto this website and find out the correct fuse settings for you MCU. AVRDUDE needs this command line to achieve the correct settings:

-U lfuse:w:0xe2:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m

If you want to use my software for your own project, I will give you a brief description of how the software works and what features it has got (so far). So, first, here’s the completely revised schematic of the transceiver. You are particulary recommended to have a closer look at the AD9835/ATmega328 VFO unit!

SSB QRP handheld tranceiver for 14MHz/20mtr. Rev. 5 (C) Peter Rachow (DK7IH)
SSB QRP handheld tranceiver for 14MHz/20mtr. Rev. 5 (C) Peter Rachow (DK7IH)

Major modifcations: I now use a debouncing circuit for the 5 switches that the operator uses to control the radio. Some MCU ports have been changed compared with older versions of the radio. Some switches have got multiple functions now depending on which part of the software/menu you are currently using.

Watch this picture:

Controls used for SSB QRP handheld transceiver
Controls used for SSB QRP handheld transceiver

The controls are:

VFO: You can now select from 12 VFOs. Pressing this button switches to the next VFO in rising order. Once you’ve reached the last VFO the run starts with VFOA again.

FUNC: Leads you to a set of submenus where you can

  • store a frequency to the current VFO
  • SCAN the band starting from the current frequency either up or down (tuning step ist the last step that you used when tuning)
  • SCAN the VFOs with possibiliy to skip any VFO during the scan isperformed
  • Put the MCU into SLEEP-mode to reduce noise to a maximum

STEP: Sets the tuning step (1, 5, 10, 50, 100, 500, 1000, 5000 Hz). 10Hz tuning step is restored 1 second after the last tuning is finished.

Tune UP/DOWN lets you alter the frequency according to current tuning step.

Let’s go into the FUNC menu. After pressing this button you are asked if you want to store the current frequency to the current VFO:

Saving a frequency into a VFO storage place

“STOR A?” means that you can save the frequency displayed to VFOA. Just press the “STEP (Y)” button. If you don’t want to to do this, press “FUNC (N)” which is read as “NO”.

Scanning the band

Next question is “SCN QRG?”. “SCN” abbrieviates “SCAN”. If you press now either the UP or DOWN button the scan starts. Tuning step applied is the last step that you’ve set before you entered this function. The reset that is automatically performed to 10Hz tuning shift will not affect the tuning step since it has not been manually set. If you don’t want to scan, just press “FUNC (N)”.

Scanning the VFOs

Afterwards you can go to a scanning procedure thru the VFOs. Answering “SCN VFO?” with “yes” will scan each VFO and leave the receiving frequency set for 4 seconds until the next VFO is switched. If you want a certain VFO to be skipped (e. g. if there is noise or an unwanted station), just press the”VFO”-button while the VFO is active. In the next round this VFO will be ignored.

Working SPLIT-Mode

The software allows you to choose different frequencies for transmit and receive. In other words: You can work split with this radio.

The receiving frequency alway is that of the VFO currently used. The transmit frequency can be selected with this function.

“Split?” must be answered with the “STEP (Y)”-button  if you wish to activate this option. In the next step you must select a VFO that you want to use as transmit frequency. Use UP or DOWN-key to alter the selected VFO. Confirm your choice with the “STEP (Y)”-button. If you wish to abort, press “FUNC (N)”.

If you want to switch off SPLIT-mode enter the FUNC-Menu again. Select “Split” and then, when asked to select the TX VFO, press “FUNC (N)”.

Ultimate noise reduction: Putting the MCU to sleep

Last question is if you want to put the MCU to SLEEPMODE. Even if the MCU does not produce any disturbing noise (at least in my rig) it can be uesful to switch the off completely. Answer the respective question with”STEP (Y)” the MCU is now switched off. Pressing either UP or DOWN tuning button will wake up the MCU again.

So, here’s the latest version of my code. See you soon and thanks for reading. 73 de Peter (DK7IH)

/*****************************************************************/
/*     DDS for QRP SSB Transceiver w. ATMega328 und AD9835       */
/*  ************************************************************ */
/*  MUC:              ATMEL AVR ATmega328, 8 MHz                 */
/*                                                               */
/*  Compiler:         GCC (GNU AVR C-Compiler)                   */
/*  Author:           Peter Rachow (DK7IH)                       */
/*  Last change:      17 AUG 2015                                */
/*****************************************************************/
/* PORT usage */
//
//OUTPUT
//
// LCD
// RS      = PB6
// E       = PB7
// D4...D7 = PD4..PD7
//
// SPI to AD9835
// FSYNC    = PB0
// SDATA:   = PB1
// SCLK:    = PB2
//
//INPUTS
//
//Vcc-Monitor:    PINC0 (analogue input)
//TX-line monitor PINC2 (detects when radio is on air)
//VFO-Select:     PINC3 push button
//FUNC:           PINC4 push button
//TUN STEP:       PINC5 push button
//TUNE UP:        PIND2 push button
//TUNE DOWN:      PIND3 push button
//
//
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <avr/eeprom.h>
#include <util/delay.h>
#define F_CPU 8000000
#define MAXSHIFT 7
#define MAXVFO 12
//AD9835 Modes
#define AD9835INIT 1 //AD9835 will be fully initialized with frequency value
// (sets AD9835 into sleep mode for some ms)
#define AD9835UPDATE 0 //AD9835 frequency will be updated because frequency
//has been changed by user
//Timer 1
unsigned long runsecs = 0;
int main(void);
/*******************/
//       SPI
/*******************/
//Port usage
//FSYNC: PB0 (1)
//SCLK: PB1 (2)
//SDATA: PB2 (4)
void spi_start(void);
void spi_send_bit(int);
void spi_send_byte(unsigned int);
void spi_send_word(unsigned int);
void spi_stop(void);
void set_frequency(unsigned long, unsigned long, int);
char *freq_shift_str[MAXSHIFT + 1] = {"  1", "  5", " 10", " 50", "100", "500", " 1k", " 5k"};
/***************/
/* LCD-Display */
/***************/
//Data: PD4..PD7
//E: PC0
//RS: PC1
#define LCD_INST 0x00
#define LCD_DATA 0x01
void lcd_write(char, unsigned char);
void set_rs(char);
void set_e(char);
void lcd_init(void);
void lcd_cls(void);
void lcd_putchar(int, int, unsigned char);
void lcd_putstring(int, int, char*);
int lcd_putnumber(int, int, long, int, int, char, char);
void lcd_display_test(void);
void show_freq(long);
void show_step(int);
void show_vfo(int);
//****************
//      ADC
//****************
#define ADWAITSTATE 3
int get_adc(int);
//EEPROM
void savefreq(int, unsigned long);
unsigned long loadfreq(int vfo_num);
//SLEEPMODE
unsigned long idlesecs = 0;
void save_cur_vfo(int);
int load_cur_vfo(void);
void save_cur_vfo(int vfo_num)
{
    while(!eeprom_is_ready());
    eeprom_write_byte((uint8_t*)511, vfo_num);
}
int load_cur_vfo(void)
{
    int lvfo = eeprom_read_byte((uint8_t*)511);
    if(lvfo < 0 || lvfo > MAXVFO)
    {
        return 0;
    }
    else
    {
        return lvfo;
    }
}
void savefreq(int vfo_num, unsigned long num)
{
    unsigned int hiword, loword;
    unsigned char hmsb, lmsb, hlsb, llsb;
    int start_adr = vfo_num * 4;
    cli();
    hiword = num / 65536;
    loword = num - hiword * 65536;
    hmsb = hiword / 256;
    hlsb = hiword - hmsb * 256;
    lmsb = loword / 256;
    llsb = loword - lmsb * 256;
    while(!eeprom_is_ready());
    eeprom_write_byte((uint8_t*)start_adr, hmsb);
    while(!eeprom_is_ready());
    eeprom_write_byte((uint8_t*)start_adr + 1, hlsb);
    while(!eeprom_is_ready());
    eeprom_write_byte((uint8_t*)start_adr + 2, lmsb);
    while(!eeprom_is_ready());
    eeprom_write_byte((uint8_t*)start_adr + 3, llsb);
    sei();
}
unsigned long loadfreq(int vfo_num)
{
    unsigned long num2;
    unsigned char hmsb, lmsb, hlsb, llsb;
    int start_adr = vfo_num * 4;
    cli();
    hmsb = eeprom_read_byte((uint8_t*)start_adr);
    hlsb = eeprom_read_byte((uint8_t*)start_adr + 1);
    lmsb = eeprom_read_byte((uint8_t*)start_adr + 2);
    llsb = eeprom_read_byte((uint8_t*)start_adr + 3);
    num2 = (unsigned long) 16777216 * hmsb + 65536 * hlsb + (unsigned int) 256 * lmsb + llsb;
    if(num2 >= 13900000 && num2 <= 14380000)
    {
        return num2;
    }
    else
    {
        return 1415000;
    }
    sei();
}
//************
//    SPI
//************
void spi_start(void)
{
    //FSYNC lo
    PORTB &= ~(1); // Bit PB0 = 0
}
void spi_stop(void)
{
    //FSYNC hi
    PORTB |= 1; // Bit PB0 = 1
}
void spi_send_bit(int sbit)
{
    //Bit set or erase
    if(sbit)
    {
        PORTB |= 2;  //SDATA Bit PB1 set
    }
    else
    {
        PORTB &= ~(2);  //SDATA Bit PB1 erase
    }
    //SCLK hi
    PORTB |= 4;  //Bit PB2 set
    //SCLK lo
    PORTB &= ~(4);  //Bit PB2 erase
}
void spi_send_byte(unsigned int sbyte)
{
    int t1, x = 128;
    for(t1 = 0; t1 < 8; t1++)
    {
        spi_send_bit(sbyte & x);
        x = x >> 1;
    }
    PORTB |= 2;  //PB1 SDATA hi
}
void spi_send_word(unsigned int sbyte)
{
    unsigned int t1, x = 32768;
    for(t1 = 0; t1 < 16; t1++)
    {
        spi_send_bit(sbyte & x);
        x = x >> 1;
    }
    PORTB |= 2; //PB1 SDATA hi
}
/**************************************/
/* LCD routines                       */
/**************************************/
//Port usage at MUC:
//LCD-Data: PD0..PD4
//E: PC0
//RS: PC1
/* Send one byte to LCD */
void lcd_write(char lcdmode, unsigned char value)
{
    int x = 16, t1;
    set_rs(lcdmode);    // RS=0 => command, RS=1 => character
    _delay_ms(3);
    set_e(1);
    /* Hi nibble */
    for(t1 = 0; t1 < 4; t1++)
    {
        if(value & x)
        {
            PORTD |= x;              // Set Bit
        }
        else
        {
            PORTD &= ~(x);          // Erase Bit
        }
        x *= 2;
    }
    set_e(0);
    x = 16;
    set_e(1);
    /* Lo nibble */
    for(t1 = 0; t1 < 4; t1++)
    {
        if((value & 0x0F) * 16 & x)
        {
            PORTD |= x;              // Set bit
        }
        else
        {
            PORTD &= ~(x);          // erase bit
        }
        x *= 2;
    }
    set_e(0);
}
/* RS set */
void set_rs(char status) /* PORT PB6  */
{
    if(status)
    {
        PORTB |= 64;
    }
    else
    {
        PORTB &= ~(64);
    }
}
/* E set */
void set_e(char status)  /* PORT PB7*/
{
    if(status)
    {
        PORTB |= 128;
    }
    else
    {
        PORTB &= ~(128);
    }
}
//Send 1 char to LCD
void lcd_putchar(int row, int col, unsigned char ch)
{
    lcd_write(LCD_INST, col + 128 + row * 0x40);
    lcd_write(LCD_DATA, ch);
}
//Send string to LCD
void lcd_putstring(int row, int col, char *s)
{
    unsigned char t1;
    for(t1 = col; *(s); t1++)
    {
        lcd_putchar(row, t1, *(s++));
    }
}
//Clear LCD
void lcd_cls(void)
{
    lcd_write(LCD_INST, 1);
}
/* LCD-Display init */
void lcd_init(void)
{
    // Basic settings: 2 lines, 5x7 matrix, 4 bit data bus
    lcd_write(LCD_INST, 40);
    // Display on, Cursor off, Blink off
    lcd_write(LCD_INST, 12);
    // Entrymode !cursoincrease + !displayshifted
    lcd_write(LCD_INST, 4);
    lcd_cls();
}
//Write number with given amount on digits to LCD
//set decimal where needed (-1 if not needed)
int lcd_putnumber(int row, int col, long num, int digits, int dec, char orientation, char showplussign)
{
    char cl = col, minusflag = 0;
    unsigned char cdigit[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, digitcnt = 0;
    long t1, t2, n = num, r, x = 1;
    if(num < 0)
    {
        minusflag = 1;
        n *= -1;
    }
    if(digits == -1)
    {
        for(t1 = 1; t1 < 10 && (n / x); t1++)
        {
            x *= 10;
        }
        digits = t1 - 1;
    }
    if(!digits)
    {
        digits = 1;
    }
    for(t1 = digits - 1; t1 >= 0; t1--)
    {
        x = 1;
        for(t2 = 0; t2 < t1; t2++)
        {
            x *= 10;
        }
        r = n / x;
        cdigit[digitcnt++] = r + 48;
        if(t1 == dec)
        {
            cdigit[digitcnt++] = 46;
        }
        n -= r * x;
    }
    digitcnt--;
    t1 = 0;
    /* Output of number to be displayed on LCD */
    switch(orientation)
    {
        case 'l':  //orientiation left
        cl = col;
        if(minusflag)
        {
            lcd_putchar(row, cl++, '-');
            digitcnt++;
        }
        else
        {
            if(showplussign)
            {
                lcd_putchar(row, cl++, '+');
                digitcnt++;
            }
        }
        while(cl <= col + digitcnt)
        lcd_putchar(row, cl++, cdigit[t1++]);
        break;
        case 'r':  //orientiation right
        t1 = digitcnt;
        for(cl = col; t1 >= 0; cl--)
        {
            lcd_putchar(row, cl, cdigit[t1--]);
        }
        if(minusflag)
        {
            lcd_putchar(row, --cl, '-');
        }
    }
    if(dec == -1)
    {
        return digits;
    }
    else
    {
        return digits + 1;
    }
}
//Display frequency line 0 left
void show_freq(long fr)
{
    lcd_putnumber(0, 0, fr / 10, -1, 5, 'l', 0);
}
//Display tuning step line 1 right
void show_step(int st)
{
    lcd_putstring(1, 5, freq_shift_str[st]);
}
//Display VFO info, line 1 left
void show_vfo(int vfo_num)
{
    lcd_putstring(1, 0, "VFO");
    lcd_putchar(1, 3, vfo_num + 65);
}
//Set AD9835 to desired frequency
//2 Modes:
//Full initialization
//or
//simple readadjustment of freq (to be preferred beause of avoiding
//
//Full init sets the AD9835 to short sleep thus generating a short interruption
//in receiving/transmitting
void set_frequency(unsigned long freq, unsigned long ifrequency, int ad9835fullinit)
{
    unsigned long fxtal = 50000450;  //fCrystal in MHz
    double fword0;
    unsigned long fword1;
    unsigned long hiword, loword;
    unsigned char hmsb, lmsb, hlsb, llsb;
    fword0 = (double) (freq - ifrequency) / fxtal;
    fword1 = (unsigned long) (fword0 * 0xFFFFFFFF);
    //Split 32 Bit in 2 * 16 Bit
    hiword = (unsigned long) fword1 / 65536;
    loword = (unsigned long) fword1 - hiword * 65536;
    //Slipt 1st 16 Bit to 2 * 8 Bit
    hmsb = hiword / 256;
    lmsb = hiword - hmsb * 256;
    //Split 2nd 16 Bit to 2 * 8 Bit
    hlsb = loword / 256;
    llsb = loword - hlsb * 256;
    if(ad9835fullinit)
    {
        //init, set AD9835 to sleepmode
        spi_start();
        spi_send_word(0xF800);
        spi_stop();
    }
    //Send frequency (double) word to DDS
    spi_start();
    spi_send_word(0x33 * 0x100 + hmsb);
    spi_stop();
    spi_start();
    spi_send_word(0x22 * 0x100 + lmsb);
    spi_stop();
    spi_start();
    spi_send_word(0x31 * 0x100 + hlsb);
    spi_stop();
    spi_start();
    spi_send_word(0x20 * 0x100 + llsb);
    spi_stop();
    //End of sequence
    spi_start();
    if(ad9835fullinit)
    {
        //AD9835 wake up from sleep
        spi_send_word(0xC000);
    }
    else
    {
        //AD9835 freq data update, no full init
        spi_send_word(0x8000);
    }
    spi_stop();
    //Display frequency
    show_freq(freq);
}
//Interrupt routines
ISR(TIMER1_OVF_vect)          // Timer1 overflow
{
    runsecs++;
    TCNT1 = 57724;
}
ISR(INT0_vect) //INT0 for ATmega being woke up from sleep, can be left
{               //empty but must exist!
}
ISR(INT1_vect)
{
}
//***************************************************
//                      ADC
//***************************************************
//Read a value from ADC
int get_adc(int adcmode)
{
    int adc_val = 0;
    ADMUX = (ADMUX &~(0x1F)) | (adcmode & 0x1F);     // Activate channel "adcmode"
    _delay_ms(ADWAITSTATE);
    ADCSRA |= (1<<ADSC);
    _delay_ms(ADWAITSTATE);
    adc_val = ADCL;
    adc_val += ADCH * 256;
    while(ADCSRA & (1<<ADSC));
    return adc_val;
}
int main()
{
    unsigned long freq1, freq2;  //Frequency in Hz to be generated
    unsigned long vfo[MAXVFO + 1] = {}; //12 VFO-frequencies
    char skip_vfo[MAXVFO + 1];
    unsigned int  cur_freq_shift = 2; //Tuning step in Hz
    unsigned int freq_shift[MAXSHIFT + 1] = {1, 5, 10, 50, 100, 500, 1000, 5000}; //Possible tuning steps for UP/DOWN-keys
    int scan_mode = 0;
    int vfo_cnt = 0;
    unsigned long interfreq = 9832000; //Interfrequency in Hz (depends on filter used)
    unsigned int adc_val;
    unsigned long runsecsold1 = 0;
    unsigned long runsecsold2 = 0;  //Timer control for switching display between VFO and VOLTAGE
    unsigned long runsecsold3 = 0;  //Timer control for resseting tuning step to 10 secs after idel time
    char displayed = 0;
    unsigned long voltage2;
    int t1;
    //Variables for FUNC-Menu
    int exit_func = 0;
    int exit_loop = 0;
    //Tuning step for frequency scan
    int scan_step = 2;
    //Variables for SPLIT-MODE
    int vfo_tx = 0;
    int split_mode = 0;
    int tx_freq_set = 0;
    /* Set ports */
    /* OUTPUT */
    DDRB = 0xC7; //SPI (PB0..PB2) LCD RS and E on PB6 and PB7
    DDRD = 0xF0; //LCD (Data) on PD4...PD7
    /*Input*/
    PORTD = 0x0F; //Pull-Up resistors on
    //PD2 = Tune up
    //PD3 = Tune down
    PORTC = 0x3E; ////Pull-Up resistors on for inputs
    //TX INDICATOR:   PINC2
    //VFO-Select:     PINC3
    //FUNC:           PINC4
    //TUN STEP:       PINC5
    //TUNE UP:        PIND2
    //TUNE DOWN:      PIND3
    //Start LCD
    lcd_init();
    _delay_ms(50);
    //Watchdog off
    WDTCSR = 0;
    WDTCSR = 0;
    //ADC init
    ADMUX = (1<<REFS0);     // Reference = AVCC
    ADCSRA = (1<<ADPS2) | (1<<ADPS1) | (1<<ADEN); //Prescaler 64 and ADC activated
    ADCSRA |= (1<<ADSC);
    while (ADCSRA & (1<<ADSC));
    adc_val = ADCL; //Read one sample vaue and discard
    adc_val += ADCH * 256;
    adc_val = 0;
    //Timer 1
    TCCR1A = 0;                         // normal mode, no PWM
    TCCR1B = (1<<CS12) + (1<<CS10) ;   // start Timer with system clock Prescaler = /1024
    //Trigger des Overflow each sec.
    TIMSK1 = (1<<TOIE1);               // overflow activated.
    TCNT1 = 57724;                     //init value for measuering one second
    //Load VFO frequencies from EEPROM if available
    freq2 = 14180000;
    for(t1 = 0; t1 <= MAXVFO; t1++)
    {
        freq1 = loadfreq(t1);
        if(freq1 > 13000000)
        {
            vfo[t1] = freq1;
        }
        else
        {
            vfo[t1] = freq2;
            freq2 += 10000;
        }
    }
    //Get last VFO used
    vfo_cnt = load_cur_vfo();
    freq1 = vfo[vfo_cnt];
    set_frequency(freq1, interfreq, AD9835INIT);
    lcd_putstring(0, 0, "QRP SSB");
    lcd_putstring(1, 0, "TRX V2.2");
    _delay_ms(600);
    lcd_cls();
    show_freq(freq1);
    show_step(cur_freq_shift);
    show_vfo(vfo_cnt);
    runsecsold2 = runsecs;
    idlesecs = runsecs;
    sei();
    for(;;)
    {
        //KEYS:
        //TX INDICATOR:   PINC2
        //VFO-Select:     PINC3
        //FUNC:           PINC4
        //TUN STEP:       PINC5
        //TUNE UP:        PIND2
        //TUNE DOWN:      PIND3
        //VFO-Select
        if(!(PINC & (1<<PINC3)))
        {
            if(vfo_cnt < MAXVFO)
            {
                vfo_cnt++;
            }
            else
            {
                vfo_cnt = 0;
            }
            //set frequency
            set_frequency(vfo[vfo_cnt], interfreq, AD9835UPDATE);
            lcd_cls();
            freq1 = vfo[vfo_cnt];
            save_cur_vfo(vfo_cnt);
            set_frequency(freq1, interfreq, AD9835UPDATE);
            show_vfo(vfo_cnt);
            //show stepanzeigen
            lcd_putstring(1, 5, "  ");
            show_step(cur_freq_shift);
            idlesecs = runsecs;
            //wait for key release
            while(!(PINC & (1<<PINC3)));
        }
        if(!(PIND & (1<<PIND2))) //TUNE UP
        {
            freq1 += freq_shift[cur_freq_shift];
            set_frequency(freq1, interfreq, AD9835UPDATE);
            runsecsold3 = runsecs;
            idlesecs = runsecs;
            if(scan_mode)
            {
                scan_mode = 0;
                show_step(cur_freq_shift);
            }
        }
        if(!(PIND & (1<<PIND3))) //TUNE DOWN
        {
            freq1 -= freq_shift[cur_freq_shift];
            set_frequency(freq1, interfreq, AD9835UPDATE);
            runsecsold3 = runsecs;
            idlesecs = runsecs;
            if(scan_mode)
            {
                scan_mode = 0;
                show_step(cur_freq_shift);
            }
        }
        //FUNC
        if(!(PINC & (1<<PINC4)))
        {
            scan_mode = 0;
            exit_func = 0;
            while(!(PINC & (1<<PINC4)));
            //STORE FREQ TO VFO
            lcd_cls();
            lcd_putstring(1, 0, "STOR");
            lcd_putchar(1, 5, vfo_cnt + 65);
            lcd_putchar(1, 6, '?');
            show_freq(freq1);
            while((PINC & (1<<PINC5)) && (PINC & (1<<PINC4)));
            if(!(PINC & (1<<PINC5)))
            {
                while(!(PINC & (1<<PINC5)));
                lcd_cls();
                vfo[vfo_cnt] = freq1;
                show_freq(freq1);
                lcd_putstring(1, 0, "Saved");
                lcd_putchar(1, 6, vfo_cnt + 65);
                lcd_putchar(1, 7, '.');
                savefreq(vfo_cnt, freq1);
                _delay_ms(1000);
                lcd_putstring(1, 5, "  ");
                exit_func = 1;
            }
            else
            {
                while(!(PINC & (1<<PINC4)));
            }
            //Scan frequency, trigger with UP/DOWN key, cancel with FUNC-Key
            if(!exit_func)
            {
                lcd_cls();
                lcd_putstring(0, 0, "SCN QRG?");
                lcd_putstring(1, 0, "DOWN UP");
                //Wait for key
                //UP, DOWN, FUNC
                while((PIND & (1<<PIND2)) && (PIND & (1<<PIND3)) && (PINC & (1<<PINC4)));
                //UP
                if(!(PIND & (1<<PIND2)))
                {
                    scan_mode = 1;
                    exit_func = 1;
                    while(!(PIND & (1<<PIND2)));
                }
                //DOWN
                if(!(PIND & (1<<PIND3)))
                {
                    while(!(PIND & (1<<PIND3)));
                    scan_mode = 2;
                    exit_func = 1;
                }
                //Cancel
                if(!(PINC & (1<<PINC4)))
                {
                    while(!(PINC & (1<<PINC4)));
                    lcd_cls();
                    show_freq(freq1);
                    show_step(cur_freq_shift);
                }
            }
            if(!exit_func)
            {
                lcd_cls();
                lcd_putstring(0, 0, "SCN VFO?");
                lcd_putstring(1, 0, "  NO YES");
                //Wait for key press Y/N
                //
                while((PINC & (1<<PINC5)) && (PINC & (1<<PINC4)));
                //Scan VFOs
                if(!(PINC & (1<<PINC5)))
                {
                    while(!(PINC & (1<<PINC5)));
                    //Set all skip flags to 0
                    for(t1 = 0; t1 <= MAXVFO; t1++)
                    {
                        skip_vfo[t1] = 0;
                    }
                    lcd_cls();
                    lcd_putstring(0, 0, "SCANNING");
                    for(t1 = 0; t1 < 8; t1++)
                    {
                        lcd_putchar(1, t1, '.');
                        _delay_ms(100);
                    }
                    exit_loop = 0;
                    while(!exit_loop)
                    {
                        lcd_cls();
                        for(t1 = 0; t1 <= MAXVFO && !exit_loop; t1++)
                        {
                            if(!skip_vfo[t1]) //Scan only if VFO not in skip list
                            {
                                runsecsold1 = runsecs;
                                lcd_cls();
                                set_frequency(vfo[t1], interfreq, AD9835UPDATE);
                                show_vfo(t1);
                                //Wait 4 seconds
                                while((PINC & (1<<PINC5)) && (PINC & (1<<PINC4)) && runsecs < runsecsold1 + 4)
                                {
                                    lcd_putchar(1, 4 + runsecs - runsecsold1, '.');
                                    if(!(PINC & (1<<PINC3))) //Skip current VFO
                                    {
                                        while(!PINC & (1<<PINC3));
                                        skip_vfo[t1] = 1;
                                        lcd_putstring(1, 0, "SKIPPED!");
                                        _delay_ms(500);
                                        runsecsold1 -= 4;
                                    }
                                }
                                if(!(PINC & (1<<PINC5))) //Select VFO
                                {
                                    while(!(PINC & (1<<PINC5)));
                                    exit_loop = 1;
                                    vfo_cnt = t1;
                                    freq1 = vfo[vfo_cnt];
                                    set_frequency(freq1, interfreq, AD9835UPDATE);
                                }
                                if(!(PINC & (1<<PINC4))) //Cancel
                                {
                                    while(!(PINC & (1<<PINC4)));
                                    exit_loop = 1;
                                }
                            }
                        }
                    }
                    exit_func = 1;
                }
            }
            if(!exit_func)
            {
                while(!(PINC & (1<<PINC4)));
                if(split_mode)
                {
                    split_mode = 0;
                }
                lcd_cls();
                lcd_putstring(0, 0, "Split?");
                lcd_putstring(1, 0, "  NO YES");
                //Wait for key press Y/N
                //
                while((PINC & (1<<PINC5)) && (PINC & (1<<PINC4)));
                //Select VFO for transmit (VFO for receive will be the one currently in use)
                if(!(PINC & (1<<PINC5)))
                {
                    while(!(PINC & (1<<PINC5)));
                    lcd_cls();
                    lcd_putstring(0, 0, "SEL TX");
                    lcd_putstring(1, 0, "VFO");
                    vfo_tx = 0;
                    while((PINC & (1<<PINC5)) && (PINC & (1<<PINC4)))
                    {
                        if(!(PIND & (1<<PIND2))) //++
                        {
                            while(!(PIND & (1<<PIND2)));
                            if(vfo_tx >= MAXVFO)
                            {
                                vfo_tx = 0;
                            }
                            else
                            {
                                vfo_tx++;
                            }
                        }
                        if(!(PIND & (1<<PIND3))) //--
                        {
                            while(!(PIND & (1<<PIND3)));
                            if(vfo_tx <= 0)
                            {
                                vfo_tx = MAXVFO;
                            }
                            else
                            {
                                vfo_tx--;
                            }
                        }
                        show_vfo(vfo_tx);
                    }
                    if(!(PINC & (1<<PINC4))) //CANCEL
                    {
                        while(!(PINC & (1<<PINC4)));
                    }
                    if(!(PINC & (1<<PINC5))) //OK
                    {
                        while(!(PINC & (1<<PINC5)));
                        split_mode = 1;
                        lcd_cls();
                        lcd_putstring(0, 0, "TX VFO=");
                        show_vfo(vfo_tx);
                        _delay_ms(1000);
                        lcd_cls();
                        exit_func = 1;
                    }
                }
            }
            if(!exit_func)
            {
                lcd_cls();
                lcd_putstring(0, 1, "SLEEP?");
                //Wait for key release
                while(!(PINC & (1<<PINC4)));
                //Wait for key
                //FUNC=NO, STEP=YES
                while((PINC & (1<<PINC4)) && (PINC & (1<<PINC5)));
                //FUNC = Cancel
                if(!(PINC & (1<<PINC4)))
                {
                    while(!(PINC & (1<<PINC4)));
                    lcd_cls();
                }
                //Set MUC to SLEEPMODE
                if(!(PINC & (1<<PINC5)))
                {
                    //Tuning step = 10Hz
                    cur_freq_shift = 2;
                    //Show tuning step
                    lcd_putstring(1, 5, "  ");
                    lcd_putstring(1, 5, freq_shift_str[cur_freq_shift]);
                    show_freq(freq1);
                    lcd_putstring(1, 0, "*SLEEP* ");
                    EICRA = 0;
                    EICRA |= (1<<ISC11) | (1<<ISC01);  //Interrupt to wake up device triggered on
                    //falling edge on PD2 and PD3
                    EIMSK |= (1<<INT0) | (1<<INT1);    //Enable external interrupt for INT0 and INT1
                    set_sleep_mode(SLEEP_MODE_PWR_DOWN);
                    sleep_mode();
                    //Wake up, returning from ISR
                    lcd_putstring(1, 0, "        ");
                    show_step(cur_freq_shift);
                    EIMSK &= ~(1<<INT0); //Disable external interrupt for INT0 and INT1
                    EIMSK &= ~(1<<INT1);
                    exit_func = 1;
                }
            }
            lcd_cls();
            show_freq(freq1);
            show_step(cur_freq_shift);
        }
        if(scan_mode)
        {
            show_step(scan_step);
            switch(scan_mode)
            {
                case 1: freq1 += freq_shift[scan_step];
                set_frequency(freq1, interfreq, AD9835UPDATE);
                break;
                case 2: freq1 -= freq_shift[scan_step];
                set_frequency(freq1, interfreq, AD9835UPDATE);
                break;
            }
        }
        //Set Frequency-Shift for tuning
        if(!(PINC & (1<<PINC5))) //Frequency-Shift when tuning
        {
            //runsecsold1 = runsecs;
            runsecsold3 = runsecs;
            if(cur_freq_shift < MAXSHIFT)
            {
                cur_freq_shift++;
            }
            else
            {
                cur_freq_shift = 0;
            }
            while(!(PINC & (1<<PINC5)));
            scan_step = cur_freq_shift;
            lcd_putstring(1, 5, "  ");
            show_step(cur_freq_shift);
            idlesecs = runsecs;
        }
        //Reset shift to 10Hz after idle time (1 sec.)
        if(runsecsold3 + 1 < runsecs && cur_freq_shift != 2)
        {
            cur_freq_shift = 2;
            //Show tuning step
            lcd_putstring(1, 5, "   ");
            show_step(cur_freq_shift);
            runsecsold3 = runsecs;
        }
        //Show current VFO
        if(runsecs > runsecsold2 + 1)
        {
            if(displayed != 2)
            {
                lcd_putstring(1, 0, "     ");
                show_vfo(vfo_cnt);
                displayed = 2;
                runsecsold2 = runsecs;
            }
        }
        //Show battery voltage
        if(runsecs > runsecsold2 + 3 && displayed != 1)
        {
            //Check battery voltage with ADC
            adc_val = get_adc(0);
            voltage2 = (unsigned long) adc_val * 5 * 32 / 1024;
            lcd_putstring(1, 0, "     ");
            lcd_putnumber(1, 0, voltage2, -1, 1, 'l', 0);
            lcd_putstring(1, 4, "V");
            runsecsold2 = runsecs;
            displayed = 1;
        }
        if(split_mode) //SPLIT-MODE
        {
            if(!(PINC & (1<<PINC2))) //TX indicator hi
            {
                if(!tx_freq_set)
                {
                    set_frequency(vfo[vfo_tx], interfreq, AD9835UPDATE);
                    tx_freq_set = 1;
                }
            }
            else
            {
                if(tx_freq_set)
                {
                    set_frequency(vfo[vfo_cnt], interfreq, AD9835UPDATE);
                    tx_freq_set = 0;
                }
            }
        }
    }
    return 0;
}

A compact handheld QRP SSB transceiver for 14 MHz

by Peter Rachow (DK7IH)    => Zur deutschen Version dieses Artikels


Notice: Read about the software for this DDS-controlled transceiver here:

https://radiotransmitter.wordpress.com/2015/08/15/update-software-for-dds-controlled-qrp-ssb-handheld-transceiver-ad9835-atmega328p/


I have really been satisfied with my last QRP SSB rig. It performs very fine. But I wanted a transceiver still a little bit smaller. And it should be easier to set up the rig if you are outside to make quick QSOs. This and the fact that I came across a larger bunch of 9.832 MHz crystals which I thought could be an ideal basis for a ladder filter made me plan an even more compact rig for 20 m compared to the last one. Particularly for portable operation on holiday or when I am outdoor with my bicycle or hiking, I wanted a self-containing transceiver with on-board battery. So here it is…

A compact handheld SSB QRP transceiver for 14 MHz (20 meter band) by Peter Rachow (DK7IH)
A compact handheld SSB QRP transceiver for 14 MHz (20 meter band) by Peter Rachow (DK7IH)

Features:

  • Monoband SSB-Transceiver for 20 Meters/14 MHz.
  • Output: 4 to 5 Watts PEP
  • Frequency generation: DDS with AD9835 and ATMega8, LCD 2×8 Characters.
  • Transmitter: SSB Modulator for USB or LSB: NE602/SA612, 4-Pole-Ladder-Filter, TX-Mixer, NE602/SA612, Power amplifer: 3 stages, push-pull-final with 2 x 2SC2078.
  • Receiver: Singe conversion superhet, RF preamp with Dual-Gate MOSFET, RX-Mixer with NE602/SA612, 4-Pole-Ladder-Filter, Passive product detector, AF preamp, AF final amp with LM386. (See improved AGC circuit here!)
  • Built-in battery pack, also connectable to external power supply, 10-LED-bargraph-display for S and RF strength readout.

The size is about that of those older CB handhelds from the late 70s. It is abt. 18 cm long, 7 cm wide and 4.5 cm high. But don’ ask me for weight. 😉

The transceiver has, as mentioned before, a power output of 4 to 5 watts rf pep which I found sufficient for making contacts worldwide. Transmit power mainly depends  on the respective power supply you use. The radio can be run either on an integrated 12 V dc rechargeable battery (1Ah, composed of 10 AAA cells) or by connecting an external dc power supply of up to 14 volts. A three-position switch allows the user to select either internal or external power supply or completely switch the rig off.

Thus the little radio is very versatile for all kinds of portable operation. The antenna is connected via a standard bnc connector. I also designed a rod antenna that you can use if there is no possibility to erect a larger aerial. I have to admit that having a qso with the small handheld antenna ist a pretty ambitious. 😉 But in recent “The King of Spain”-Contest I could work with the rod antenna from a high place over a dozen stations.

With my delta loop the rig is absolutely amazing. During the recent weeks I worked (among others) the following prefixes:

SM, EA, F, 9A, 4X, LZ, I, SV9, J79, J49, JW9, S56, CY0, P40, G, YO, OH, W1, UA9, TA, PA, S57, GU, EK3, OX

And this all was done, except from the contact to P40FN, with 4 to 5 watts pep. Only for the QSO to Aruba I had to use the 60 watt linear amplifier. The pile-up was too hard. 😉

Basic design ideas:

To make the rig not too bulky I used a “sandwich construction” in an aluminium frame. The radio mainly consists of three layers:

  • The RF and AF unit (mainboard)
  • The battery-, AGC/Meter- and switching unit
  • The display and push-button unit

The RF unit:

RF unit of a compact handheld SSB QRP transceiver for 14 MHz (20 meter band) by Peter Rachow (DK7IH)
RF unit of a compact handheld SSB QRP transceiver for 14 MHz (20 meter band) by Peter Rachow (DK7IH)

On board here you can find the DDS-VFO, the whole receiver and transmitter circuits (including power amp), SSB modulator and demodulator.

The battery and AGC/Meter and switching unit:

AGC/Meter/Battery unit of a handheld compact SSB QRP transceiver for 14 MHz (20 meter band) by Peter Rachow (DK7IH)
AGC/Meter/Battery unit of a handheld compact SSB QRP transceiver for 14 MHz (20 meter band) by Peter Rachow (DK7IH)

This board is equipped with a set of 10 rechargeable batteries (1.2 volts each), the relay for transmit/receive switching and the LED-S/RF-meter circuit (LM3915) plus the AGC device. Above this section there is another layer which keeps the 2×8 line LCD, the up/down control switches for tuning (there is no rotator tuning knob), a button for setting the tuning frequency step, selecting the VFO (4 VFOs and 2 split VFOs are software defined) etc. It is  integrated in an extra housing mounted on top of the cabinet an connected via some cables. The controls are simple push-buttons. With one of these the microcontroller can be set into sleepmode to reduce the radio’s noise down to a minimum. The 1 inch loudspeaker is also mounted in here.

The circuitry itself is standard QRP design with the “usual suspects”. See the schematic to learn more:

Revised schematic of QRP SSB handheld transceiver for 14 MHz/20Meter by DK7IH (Peter Rachow)
Revised schematic of QRP SSB handheld transceiver for 14 MHz/20Meter by DK7IH (Peter Rachow)

The front panel looks like this:

Front panel of small handheld SSB QRP transceiver for 14 MHZ by Peter Rachow (DK7IH)
Front panel of small handheld SSB QRP transceiver for 14 MHZ by Peter Rachow (DK7IH)

Details are to be discussed in my next posting on this blog. Thanks for watching! 73 de Peter (DK7IH)

(C) 2015 Peter Rachow

QRP Transceiver for the 20-Meter-Band (SSB) by DK7IH Peter Rachow

This is a very compact SSB transceiver for the 20-Meter Band. This band is still my favorite band for QRP operation. The objective of the design were to be compact in size, 5 watts PEP output, a single conversion superhet, DDS-VFO and SSB (phone) operation only.

The circuit is based on the common “2-Mixers-1-Filter” design which I adapted for 20 meters. The receiver has been given a pre-amp stage using a dual-gate MOSFET to improve the signal-to-noise ratio and to increase the overall gain. The rest is more or less a QRPer’s classical “business-as-usual”. Well, maybe except from the frequency control. This is done by the well-known DDS-chip AD9835 which I now often use driven by an AT mega 8 microcontroller.

Here’s the rig in a homemade cabinet made of aluminum and copper plated pc board. Notice the AA-sized battery to the left for size comparison.

 

Schematic of a very compact SSB QRP Transceiver (20 m, 14 M, Peter Rachow, DK7IH)
Schematic of a very compact SSB QRP Transceiver (20 m, 14 M, Peter Rachow, DK7IH)

The circuit, as mentioned before, doesn’t have loads of features, but the transceiver performs very well in spite of the simple circuitry.

Compact QRP transceiver for phone operation on the 20-meter-band (DK7IH, Peter Rachow)
Compact QRP transceiver for phone operation on the 20-meter-band (DK7IH, Peter Rachow)

Some technical annotations should now follow:

Frequency generation and tuning:

As mentioned before: Frequency generation is done by a AD9835 DDS chip that Is controlled with an ATmega8 microcontroller. There is no rotary vfo knob on the rig. Instead I use an UP-DOWN-switch with one neutral and two switching positiones. One for “up”, one for “down”. In addition the tuning step can be manually set so that you can easily tune the band using various speeds. The minimum step is 10 Hz.  Next steps are 20, 50, 100, 250, 1k, 2.5k and 5k. After you have tuned with higher rate than 10 Hz the step is reset after 4 seconds of idle time automatically to 10 Hz.

Receiver sensitivity:

AGC is controlled by an operational amplifier (LM358). The input signal is derived from the audio after the audio preamp. The output of the LM358 goes to an NPN  transistor regulator that is in the positive voltage line from the manual gain control accessible to the operator. The LM358 also drives the S-Meter.

PTT:

I use a one-line-ptt. The base of a PNP-transistor is lead thru the microphone to ground in case the ptt is pushed. This swithes the transceiver from receive to transmit mode. The microphone jack is a 3 pin standard stereo earphone jack with 3.5 mms diameter. The remaining line switches the loudspeaker. This is done because the capacitors of the LM386 audio amp discharge too slowly and this causes some feedback of about a quarter of a second when the ptt is pushed.

Sideband generation and switching:

Some internet sites state the NE621 should not be a good choice for generating an ssb signal in a transmitter using the filter method. Builders particularly say that suppression of the carrier and unwanted sideband is inferior to other common mixer circuits like the MC1496. I defenitely cannot confirm this. After having built a dozen ssb rigs in the recent years with all the technologies and parts available to the amateur (diode mixers, MC1496, CA3028A, dual-gate-MOSFET etc.) I have never had a rig that allowed a carrier suppresion of >50db like in my mini QRP transceiver that is described here. The NE 612 is a faboulus sideband generator. Give it a try!

But where there is light you can also see the shade: One problem with this rig was sideband switching. After having used 2 different crystals for the USB and LSB I found that under certain conditions the LO did not go to the desired frequency. After long hours of experimenting I discovered that sometimes the 2 crystals were resonating simultanously. The NE 612 integrated oscillator starts to oscillate very early and can produce signals even if the crystal is verly loosely coupled. A few picofarads are enough! The capacities inherent in each circuit are sufficient to make the NE 612’s LO oscillate like a crystal. So in my setting the crystal for the sideband that was not switched by a time also was running by to produce the LO signal. But it did this unwantedly. And to my desperation.

Therefore instaed using a 9.0015 and a 8.9995 MHz crystal, I removed the two crystals and used one for 9.0000 MHz. This one is pulled switchable with either a capacitor or a coil (20 turns or so) to get to the desired frequency. Look to the schematic to find out the details. Now this works absolutely fine!

Performance of the SSB-Transceiver:

The rig is big fun! With 4 to 5 watts I worked all over Europe within a few days. My antenna is also very simple. A dipole with its apex 10 meters or so above the ground. Not really “big guns” as you can imagine! My signal reports say indicate that the transmit audio is very clear.

The receiver is sensitive and has a good noise figure. You can pick up even ZLs and VKs even if you can’t work them. Think I have to make some antenna improvements to get my first VK with this rig!😉

See u soon!

73 de DK7IH (Peter Rachow, Woerth, Germany)

(Thanks to Craig, KD2CXK, for reading the text and improving the English language!)