Home
 Station
 100 Years of W7QC
 Log Search
 NaP3/KX3 Demo
 N1MM & Salmon Run
 PIC Keyer Version 2
 Biography
 Print a QSL

PIC Keyer Version 2

This is the second version of a PIC keyer project that started out as a project to help me learn PIC programming. This version has all of the features of the original PIC keyer plus an improvement that allows the PIC microprocessor to "sleep" when not in use. This dramatically reduces the power consumed so that a small battery will last for years. The circuit presented here does not even include an on/off switch.

The PIC Keyer is a full-featured Morse code keyer which has been programmed into a PIC 16F88 Microcontroller. The 16F88 is an 18-pin dip package that contains nearly all of the capability needed by a Morse code keyer. It has flash memory to hold the program, 11-bit A/D converter to read the speed control, internal oscillator, EEProm to hold the configuration and messages, and pull-up resistors to maintain input pins at a high level until paddles or buttons are closed by the user. Very few additional parts go into making up the PIC Keyer. (See diagram at the bottom of this page)

The keyer will send Morse code in response to paddle closures at varying speeds from 5 to 40 words per minute. It optionally generates a sidetone so you can hear what is being sent. Speed and volume are controlled by potentiometers. The speed input uses an on-chip analog-to-digital converter to read the setting of the speed control.

The PIC Keyer allows you to program (via paddle input) up to three canned messages. These messages can be played back by pressing message buttons 1, 2 or 3. A menu system which uses the Menu Button coupled with user input via the paddles allows granular control over the keyer settings.

Version 2 of the keyer now includes a negative keying feature that was present in Version 1. If you don't require negative keying for older radios, removing the negative keying parts reduces the parts count.

Version 2 of the PIC Keyer draws very little current and is powered by an internal battery pack consisting of three AA cells. The original keyer included a charger which was used to charge an internal battery pack. Version 2 includes a sleep feature so that the charger was considered superflous. If you quit sending for approximately 2 seconds the keyer will enter the sleep mode. Pressing a paddle or a button will wake up the keyer and it will resume operation normally.

Approximate current consumption is:

  • Keyer in use -- 2 milliamps
  • Keyer idle -- 10 microamps (entered after 2 seconds)
A small battery pack should last years.

Features

  • Adjustable dot and dash weighting
  • Adjustable dot/dash ratio
  • Adjustable sidetone frequency and volume
  • Speed adjustable in two ranges from 5-50 wpm
  • Speed value read with an A/D converter
  • Three user-programmable canned messages
  • Messages are up to 82 characters each
  • Messages entered from paddle
  • Message-repeat feature
  • Adjustable message repeat time
  • Supports user-selectable Iambic-A and Iambic-B modes
  • Selectable autospace mode
  • Paddles are reversable through the menu
  • Semi-automatic (bug) mode
  • Hand key mode
  • Long dash for use as a beacon keyer (see Message Entry Mode below)
  • Speed value (wpm) readout using Morse code
  • Configuration and messages stored in non-volatile EEPROM
  • Uses a single 18-pin PIC microprocessor (16F88)
  • Runs from internal battery
  • Very low current draw -- 2 milliamperes normal, 10 microamperes sleep mode
The following paragraphs describe the PIC Keyer menu system.

Menu Button

The PIC Keyer Menu Button allows user control over the keyer configuration. There are two “Immediate” menu items that allow you to toggle the sidetone and to put the transmitter into tune mode. These Immediate menu items are described below:

IMMEDIATE MENU ITEMS

S – Sidetone Toggle

When you push the Menu Button you will hear the letter “S” indicating Sidetone. If you release the Menu Button immediately after hearing the letter “S”, the sidetone will be toggled – if it is ON, it will be set to OFF and if it is OFF, it will be set to ON.

T – Tune Mode

If you continue to hold the Menu Button in after hearing the letter “S”, you will hear the letter “T”. This indicates Tune mode and if you release the Menu Button after hearing the letter “T” and your keyer is connected to your transmitter, your transmitter will be keyed. You can un-key the transmitter by pressing the Menu Button again or by closing either dot or dash paddles.

USER INPUT MENU ITEMS

? – User Input

If you continue to hold the Menu Button after hearing the letter “T”, you will hear a question mark (“?”) indicating that the keyer is waiting for user input. This means that you can enter any one of a several characters via the paddles. These characters will allow you to change the keyer configuration, enter messages and query the current keyer configuration. If you enter a character that is not a supported menu item (e.g., “E”), the keyer will respond with a series of short dashes (raspberry) and then exit the User Input Mode.

? – W – Keying Weight

If after hearing the ?, you enter the letter W, you will put the keyer into the Weight Adjustment Mode. While in this mode you can increase or decrease the weighting. Increasing the weighting will make the dots and dashes longer relative to the dot/dash spacing. Decreasing the weight will make the dots and dashes shorter relative to the dot/dash spacing.

When you first enter the Weight Adjustment mode, the keyer will respond by sending the current weight value. While in the Weight Adjustment Mode, pressing the dash paddle will cause the weighting to be decreased and pressing the dot paddle will cause the weighting to be increased. While decreasing the weighting you will hear the letter “D” (for down) and while increasing the weighting you will hear the letter “U” (for up). If you go down to zero weighting, you will no longer hear the letter “D”. You can exit the Weight Adjustment Mode by pressing the Menu Button. When you exit the Weight Adjustment Mode the keyer will send the letter “W” followed by the new weight value. The minimum weight value is zero and the maximum weight value is 15.

? – R – Keying Ratio

Changing the keyer ratio is very similar to changing the weighting. If after hearing the ?, you enter the letter “R”, you will put the keyer into the Ratio Adjustment Mode. While in this mode you can increase or decrease the dash to dot ratio. Increasing the ratio will make the dashes longer relative to the dots. Decreasing the ratio will make the dashes shorter relative to the dots.

When you first enter the Ratio Adjustment mode, the keyer will respond by sending the current ratio value. While in the Ratio Adjustment Mode, pressing the dash paddle will cause the ratio to be decreased and pressing the dot paddle will cause the ratio to be increased. While decreasing the ratio you will hear the letter “D” (for down) and while increasing the ratio you will hear the letter “U” (for up). If you go down to zero ratio, you will no longer hear the letter “D”. When you exit the Ratio Adjustment Mode the keyer will send the letter “R” followed by the new ratio value. The minimum ratio value is zero and the maximum ratio value is 15.

? – D – Message Repeat Delay Time (seconds)

If after hearing the ?, you enter the letter “D”, you will put the keyer into the Message Repeat Time Adjustment Mode. While in this mode you can increase or decrease the delay time between message repeats. Increasing the delay time will put a longer delay between repeated messages. Decreasing the delay will put a shorter delay between repeated messages.

When you first enter the Message Repeat Time Adjustment Mode, the keyer will respond by sending the current delay time value. While in the Message Repeat Time Adjustment Mode, pressing the dash paddle will cause the time to be decreased and pressing the dot paddle will cause the time to be increased. While decreasing the delay time you will hear the letter “D” (for down) and while increasing the delay you will hear the letter “U” (for up When you exit the Message Repeat Time Adjustment Mode the keyer will send the letter “D” followed by the new time value. The minimum delay time value is one second and the maximum delay time value is 15 seconds.

? – M – Monitor Frequency

Changing the monitor frequency is very similar to changing the weighting and ratio. If after hearing the ?, you enter the letter “M”, you will put the keyer into the Monitor Frequency Adjustment Mode. While in this mode you can increase or decrease the monitor frequency. Increasing the monitor frequency will make the frequency higher pitched. Decreasing the monitor frequency will make the frequency lower pitched.

While in the Monitor Frequency Mode, pressing the dash paddle will cause the monitor frequency to be decreased and pressing the dot paddle will cause the monitor frequency to be increased. While changing the monitor frequency, the keyer will send dashes so you can hear the current monitor frequency as you are changing it. Adjustment is supported for 15 values which will cause the frequency range of approximately 300 to 1000 Hz. You can exit the Monitor Frequency Adjustment Mode by pressing the Menu Button. When you exit the Monitor Frequency Adjustment Mode, the keyer will respond by sending the letter “M” followed by the new monitor frequency value.

? – L – Low Speed Mode

The keyer is capable of operating in one of two speed ranges, low (5-35) and high (15-50). You can put the keyer in the Low Speed Mode by entering the letter “L” while in the User Input Mode. The keyer will respond by sending the word “ON” to indicate that the Low Speed Mode has been turned ON. You can revert to the normal speed mode by repeating these actions. When exiting the Low Speed Selection Mode, the keyer will respond with the word “OFF” to indicate that the Low Speed Mode has been turned off. Once the Low Speed Mode has been turned ON or OFF, the keyer will automatically exit the User Input Mode.

? – A – Autospace Mode

The keyer is capable of automatically spacing the characters for you. When the Autospace Mode is turned on, the keyer will recognize when you have sent a character and it will automatically provide perfect spacing before the next character starts. You can change to Autospace Mode by entering the letter “A” while in the User Input Mode. The keyer will respond by sending the word “ON” to indicate that the Autospace Mode has been turned on. You can revert to normal mode by repeating these actions. When exiting the Autospace Mode, the keyer will respond with the word “OFF” to indicate that the Autospace Mode has been turned off. Once the Autospace Mode has been turned ON or OFF, the keyer will automatically exit the User Input Mode.

? – I – Iambic-B Mode

The keyer is capable of operating in either Iambic-A mode or Iambic-B mode – the default is Iambic-A. You can change to Iambic-B mode by entering the letter “I” while in the User Input Mode. The keyer will respond by sending the word “ON” to indicate that Iambic-B mode has been turned on. You can revert to Iambic-A by repeating these actions. When entering the Iambic-A mode, the keyer will respond with the word “OFF” to indicate that Iambic-B mode has been turned off. Once the Iambic-B mode has been turned ON or OFF, the keyer will automatically exit the User Input Mode.

? – P – Paddle Reverse Mode

Normally, the keyer will use the left paddle for dots and the right paddle for dashes. You can reverse the paddles action internal to the keyer by keying in the letter “P” while in the User Input Mode. The keyer will respond by sending the word “ON” to indicate that Paddle Reversal Mode has been turned on. You can revert to normal paddles by repeating these actions. When returning to normal paddles, the keyer will respond with the word “OFF” to indicate that the Paddle Reversal Mode has been turned OFF. Once the paddle mode has been set or reset, the keyer will automatically exit the User Input Mode.

? – H – Hand Key Mode

The keyer supports a Hand Key mode which will simply treat each of the paddles as if they were a standard hand key. Closing either paddle will key the sidetone and transmitter until that paddle is opened. You can change the keyer to a hand-key by keying in the letter “H” while in the User Input Mode. The keyer will respond by sending the word “ON” to indicate that Hand Key Mode has been turned on. You can revert back to normal keyer mode by repeating these actions. When returning to normal keyer mode, the keyer will respond with the word “OFF” to indicate that the Hand Key Mode has been turned OFF. Once the keyer mode has been set or reset, the keyer will automatically exit the User Input Mode.

? – B – Bug Mode

You can change the keyer to a bug or semi-automatic key. When in this mode, the paddles respond as they would on a bug key. Pressing the dash paddle responds like a hand key and pressing the dot paddle sends a series of dots as it would in the normal keyer mode. You can enter the Bug Mode by keying in the letter “B” while in the User Input Mode. The keyer will respond by sending the word “ON” to indicate that the Bug Mode has been turned on. You can revert back to normal keyer mode by repeating these actions. When returning to normal keyer mode, the keyer will respond with the word “OFF” to indicate that the Bug Mode has been turned OFF. Once the Bug Mode has been set or reset, the keyer will automatically exit the User Input Mode.

? – S – Speed (wpm)

You can query the current keyer speed in Words-Per-Minute (wpm) by entering the letter “S” while in the User Input Mode. The keyer will respond by sending the current wpm in Morse code (e.g., 22).

? – Q – Query Configuration

You can query the current keyer configuration by entering the letter “Q” while in the User Input Mode. The keyer will respond by sending a configuration letter followed by either a number or by the words “ON” or “OFF”. A typical configuration string is shown below:

Typical Response Definition
W 4 Current weight value
R 3 Current ratio value
M 5 Current monitor frequency value
D 3 Current message repeat delay (seconds)
I OFF Iambic-B Mode
L OFF Low Speed Mode
A OFF Autospace Mode
P OFF Paddle Reversal Mode
H OFF Hand Key Mode
B OFF Bug Mode
XExiting configuration query


You can stop the configuration string from playing by simply pressing either the dot or dash paddle during the playback. Note that if you want to inquire about weight, ratio, monitor frequency or delay time you can simply enter the associated adjustment mode and then exit that mode without making any changes. For example, if you enter the letter “W” the keyer will send the current weight value. If you then press the Menu Button without making any changes the keyer will send “W” followed by the current weight value.

? – 1, 2 and 3 – Message Entry Mode

The keyer is capable of storing up to three messages which can be played back by pressing one of the three message buttons. You can enter a message by keying in the number “1”, “2” or “3” while in the User Input Mode. The keyer will respond by sending the word “GO” to indicate that you can now enter the message that will be associated with the corresponding button.

You can enter up to 82 characters per message. If you exceed this number, the keyer will respond with a series of short dots (raspberry) and will exit the Message Entry Mode.

If the message is to be used as a beacon message, you can add a long dash at the end of the message. This is done by entering dididahdah (dit dit dah dah) as the last character of the message. The code will interpret this non-code character and respond by sending a long dash at the end of the message.

Once you have keyed in a message, you can end the Message Entry Mode by pressing the Menu Button. The keyer will respond by sending the letter “X” for eXit and will exit the User Input Mode. Your message has been stored in non-volatile memory and may now be played by pressing the appropriate button.

Message Buttons

Pressing button 1 will play message 1, button 2 will play message 2 and button 3 will play message 3. While a message is playing, you can cancel it by closing either of the paddles or by pressing the Menu Button. You can cause any of the messages to repeat by pressing and holding the message button down until you hear the second character of the message. When in the repeat mode, the message will finish, there will be a delay and then the message will play again. This is useful for things like calling CQ on a dead band or for using the keyer as a beacon. The delay between messages is settable using the user input “D” which was described earlier.

MENU QUICK-REFERENCE


Immediate
S Sidetone Toggle
T Tune
User Input
W Weighting
R Ratio
M Monitor Frequency
D Message Repeat Delay
I Iambic-B Mode
L Low Speed Mode
A Autospace Mode
P Paddle Reverse
H Hand Key
B Bug
Q Query Configuration
S Speed (wpm)
1 Enter msg 1
2 Enter msg 2
3 Enter msg 3


I have made a small printed circuit board to use to build the keyer. The picture below shows the PCB and the layout of the parts. the board dimensions are 1.5" X 2.5".





You can download the 16F88 hex file here:   Keyer88.zip


The diagram below shows how to configure the PIC 16F88 to work with the PIC Keyer software. Note how few components are necessary.