CQ CW with PIC


Introduction

It seems these days that if you want to be on the cutting edge of HAM homebrewing, if you want to front run the pack, if you want to be well regarded by yours peers, then you need to have designed, built and published your own PIC construction project. Actually, that's not what I set out to do. I needed a simple project to teach myself about the PIC, how to design the hardware, write the software etc with the view of building other radio PIC projects that I have in mind

Objective

Often when I'm in my shack, I'm doing several things at once. I have the computer/Internet on, along with the soldering iron ready for my latest homebrew adventure. I also have several radios on monitoring useful frequencies to me. Often, this includes various QRP CW frequencies (for example 14.060 MHz). I've often thought it would be nice to have a little box connected to my FT-817 that caused it to send "CQ DE VK2KEP K" in CW whilst I did my soldering or typing. When someone returned the call, it would be just a matter of grabbing the paddle.

This project meets that need. This project is my first experimentation with the PIC. Consequently, it isn't as elegant as other similar designs, nor has it all the features of other projects. But it is a useful springboard to other CW + PIC projects. It should provide others the encouragement to have a go with these wonder chips.




Theory

The "Box" to be built needs to sit between the paddle and the FT-817 (or other radio). Inside the box, the paddle and radio should be "straight-through" connected, with the "device" connected in parallel (or "Y-Connected"). In this way, any action on the paddle causes the FT-817 to transmit as usual. And, as required, the "device" can switch the dash and dot lines to earth, similarly causing the FT-817 to transmit

"CQ CQ CQ DE VK2KEP VK2KEP VK2KEP K"

The "device" in this instance is a PIC 16F84 micro-controller from Microchip®. A PIC is microprocessor similar to what you might find in a computer (well an older one anyway). Unlike a microprocessor though, it also has some RAM and EPROM as part of the chip, and specific IO capabilities to make it very easy to interface to other devices.

The 16F84 chip has the following features:

  • 1 kB of on chip Flash memory
  • 68 bytes of RAM
  • 64 Bytes of data EEPROM
  • 5 "CPU" instructions
  • 13 IO lines, each line capable of input or output
  • costs less than $10.00 at the usual electronic retail outlets
  • commonly available

With respect to the radio, I use either an FT-817 or an FT-847. On the CW key input, the dot/dash lines are "pulled up" to +5V dc. To cause the radio to transmit, it is a simple matter of grounding the dot or dash line.

With respect to the box, as a minimum, we need one input line to tell the PIC to send the CW message. On the output side, we need two lines - one for the DASH line and the other as the DOT line. On the input line, a +5V signal to trigger the device to send via S1, else it is held at logic low. On the output line, we need to short circuit the appropriate line to earth to cause the radio to transmit. The easiest way of doing this is using the PIC output lines to drive two small signal switching transistors. The output lines from the PIC are capable of 0 or 5 Vdc, with about 25mA of current source or sink.

This allows us to design the circuit.

CLICK HERE FOR CIRCUIT DIAGRAM

Construction

The construction is very easy. This is a characteristic of PIC projects in general.

The Bill of Materials is as follows:

Type

Part

Qty

Semiconductors

Microchip 16F84 - programmed

1

 

7805 – 5 volt regulator

1

 

BC547 or 2N2222

2

Resistors

3.9k Ohm

2

 

10k Ohm

1

Capacitors

15 pF

2

Crystal

4.0 MHz

1

Switch

S1 – push

1

 

S2 - Toggle

1

Connectors

3.5 mm Stereo

2

 

9 Vdc Battery snap

1

Misc

Enclosure

1

 

Veroboard

1

 

18 Pin IC Socket PCB Mount

1

 

PCB Pins for Test points

 
 

Hookup wire

 
 

PIC Source code / hex file

 
 

Machined PIN IC socket Strips

 
 

9 Volt battery

 
 

3.5mm Stereo straight-through cable

 

The layout is non-critical.

  1. Centrally mount the 18 PIN IC socket and carefully solder; ensure that no inadvertent solder bridges are formed. Don't insert the PIC until last.
  2. I tend to use machined PIN IC socket strips to hold the transistors and crystals in my projects. In this way, I can pull the parts out and replace them without having to resolder the board. See Photo.
  3. Solder the 7805 into position.
  4. I also tend to use PCB pins at strategic locations. This allows me to access useful test points (eg earth, +Vdc, various signal points) with a Digital Multimeter or CRO as required. In this project, I have put pins on the RA0 input of the PIC, as well as the collector of the transistors. These are also useful points to attach external cabling.
  5. Install the capacitors and resistors in appropriate locations.
  6. Now join the dots - that is, use hookup wire underneath the board to connector the various devices together.
    Some advice at this point:
    (a) choose colours for the various signal paths, and be consistent. For example, Black for ground, Red for Vdc, Blue for the crystal connections, Green for input, Orange for output. Just be consistent. It makes it easier later if you want to troubleshoot or change the circuit.
    (b) Keep the leads short, but not too short. Be careful to avoid a wiring birdsnest in busy areas - that is, where there is a high density of connections I have found that it helps to run the leads horizontal and vertically away from dense locations, but diagonally only rarely. Think about neatness at this point. Solder one end of the wire before cutting the length - that way you can route the lead in a neat way and then cut it to the correct length.
    Fortunately in this project, there isn't a lot of wiring, but just the same…
  7. Connect the battery snap and then the battery. Check that the voltage regulator gives 5 Vdc to the correct points on the board.
  8. Carefully plan where to drill holes on your enclosure for the connectors and switches. Drill the holes, attach the connectors and switches.
  9. To complete the cabling, follow Drew Diamond's lead, take some lengths of hookup wire (remember the colour code scheme) and place one end in a cordless drill, the other in a vice. The drill needs to be set in the low speed mode. Carefully twist the wires together and knot the ends.
  10. Complete the wiring of the switches and connectors to the board.
  11. Put the programmed PIC into the board.
  12. All things being well, the construction should be complete.

If you want to program the PIC yourself, there are two files of interest to you:

  • CQ_CW.asm - the source code for the PIC. Using MPLAB assembler, you can compile this to the file below.
  • CW_CW.hex - the file to download to the PIC

Alignment, Test and Adjust

Cable up the radio, box and paddle.

First, test the paddle. Make sure that the paddle operates the rig correctly.

Now, turn on the box. Press the button. All things being well, the radio should start calling CQ in Morse.

Sit back, relax, while the box does the heavy work for you!

Conclusions

From my point of view, the main objective of getting into PIC design was achieved with this little project. Whilst the circuit is a bit of a novelty, there are some possible real applications:
  • CW Ident for a repeater or beacon, or even a complete controller for a repeater with a bit more software and IO management,
  • Without too much effort, a CW keyer and side tone oscillator could be easily added to the software making the circuit more useful to a wider base of people,
  • More strings that are often used could be added very easily. For example "name is shane shane QTH is sydney sydney" - could be helpful in contesting where you want to be on the air and running the log software at the same time.

I'll leave it up to you.


Shane Magrath
VK2KEP

Return to the Main Page...