The WW2R MINI KEYER

Dave Robinson WW2R G4FRE

Introduction

Since publication of the original WW2R PIC keyer Mk II there have been requests for a smaller version using fewer components that would run directly from a 5 volt supply. A smaller version using the 8 pin OTP 12C508A was designed and published, but recently a need to use a flash programmable version was identified. For this reason a 12F675 design was formulated. The PIC12F675, when using the onboard oscillator has 31 x 12 registers, 6 I/O pins and 512 x 12 program area, all contained in a 8 pin DIL package. The chip has an onboard oscillator fixed at 4MHz removing the need for any external oscillator components.

Three elements of the keyer design have to be considered:-

1. A method of converting the morse to a bit pattern

2. The microprocessor code for the PIC chip to convert this pattern to a morse output

3. The hardware

Element 1 will vary depending on the message to be sent. Element 2 (the "program") is independent of message. The two elements are generated separately, combined together, converted to a HEX format the chip understands then programmed into the chip.

Morse code pattern generation

Whilst others have developed elegant solutions to store CW as binary bits, the method presented here is based on my original design in Radio Communication. One message pattern is stored serially in each chip with an invalid morse character being used to generate the reset to the start of the message (11001100 binary; CC in hexadecimal) to allow continuous looping as required by beacons.

To start the conversion process first write down the text of the message to be sent. Convert each character in the message to binary representation of the morse. A dah equates to "111", a dit to a "1", a character space "0"a letter space "000" and a word space "0000000". If periods of "key down" are required continuous streams of "1"s are inserted. The bits are then converted to hexadecimal, padding out the message length with extra "0"s to complete a Byte as necessary. The end of message byte (CC) is added to complete the code.

For example suppose the message just consists of the callsign WW2R. The binary listing would be as follows:-

10111011 10001011 10111000 10101110 11101110 00101110 100000

this is converted to hexadecimal:- then the reset sequence added;-

BB 8B B8 AE EE 2E 80 BB 8B B8 AE EE 2E 80 CC

Whilst this process is easy to do for short message it is very tedious and prone to errors for long messages. For this reason a QBASIC program was developed to generate the sequence automatically and generate a text file in a compatible format for the PIC assembler. The program is cwpic.bas available in zipped form as cwpic.zip. The program also allows the simulation of the sound of the keyer to be made so you can make sure it sounds correctly before committing it forever in the chip. As an example of the storage capacity of the chip, the following message typical of a beacon message fits easily:-

WW2R EM13QD 902.380MHZ (10 seconds carrier) WW2R (10 seconds carrier) WW2R (10 seconds carrier) WW2R (10 seconds carrier) WW2R (10 seconds carrier)

Microcontroller code

No claims of code compactness are made for this program, ease of comprehension on how the program works being traded for the niftiest code. It was decided to have two independent keyed outputs one the inverted form of the other from pin 7 and Pin 6. The speed of the keying is fixed by the 4MHz clock and the internal delay counters.

The code was written using an integrated developed environment (MPLAB IDE) provided by Microchip (1) where all the processes including the chip programmer (PICSTART-PLUS) are linked in a windows environment. The zip file containing the .asm file is   cw508a.zip

Process overview

 1. Ensure that the file cw.asm does not exist in the directory containing the cw675.asm file

2. Generate the morse code pattern using the QBASIC program. The output file is called cw.asm. Ensure it ends up in the same directory as the cw675.asm file

3. Assemble the file CW675.ASM using the available tools. The cw.asm file will automatically be incorporated into the output file

4. Program the chip with the hex code generated by step 3 using the available programmer.

Hardware

The pinout of the keyer chip is shown in Figure 1.    The maximum supply voltage to the chip is 5.50V. The supply should be decoupled with a 0.1UF capacitor close to pin 8. Output 2 is the inverted version of output 1. The outputs of the PIC can source or sink 25mA each and are at "TTL" levels ( 0 to 5V)

Conclusions

Hopefully this article will remove the obstacle for those building beacons who are unable to identify a small low cost keyer. For those without the programming capabilities, programmed chips and component kits are available from the Author.

Fig 1. PIC 12F675 keyer connections