Arduino CW Keyer

Updated 2016-11-25

This is an open source Arduino based CW (Morse Code) keyer with a lot of features and flexibility, rivaling commercial keyers which often cost significantly more. The code can be used with a full blown Arduino board or an AVR microcontroller chip can be programmed and used directly in a circuit. This keyer is suitable as a standalone keyer or for use permanently installed inside a rig, especially homebrew QRP rigs. It’s open source code so you can fully customize it to fit your needs and also perhaps learn from it or find coding ideas for other projects. A circuit board and parts kits called the nanoKeyer is available from DJ0MY, and Hamshop offers a kit called Open CW Keyer which uses this software. RemoteQTH also offers the Open Interface which runs this code. Consult this page for code support information.

Features

CW speed adjustable from 1 to 999 WPM

Up to six selectable transmitter keying lines

Programming and interfacing via USB port (“command line interface”)

USB or PS2 Keyboard Interface for CW keyboard operation without a computer

Note: Ignore the numbers on the outside of the Arduino symbol and refer to the numbers within the box for pin connections (i.e. D2, D3, A0, etc.) All capacitor values are in microfarads (uF), unless otherwise stated. No values are super critical and typical tolerance components may be used. 1K ohm resistors are better suited than the 100 ohm transistor base resistors shown in the schematic. Use 1k resistors; I am in the process of updating the schematic.

Transmitter Key – pin 11 – goes high for key down; use to drive a transistor to ground the TX key

Sidetone – pin 4 – this outputs square wave sidetone to drive a speaker (schematic coming out shortly for driving with a transistor). The sidetone can be deactivated on transmit for transmitters that generate their own sidetone.

The command button – pin A1 and at least R7

Memory buttons, up to 12. Add buttons and resistors R8, R9, R10, etc. (You can do just a few memory buttons, all 12, or none at all.

Additional pins you may be interested in for other functionality:

PTT (push to talk) (described in more detail below)

Additional TX Key lines for multi-transmitter capability

Potentiometer Speed Control – pin A0 – connect one end of the pot to +5V, the other end to ground, and connect the wiper to pin A0

Rotary Encode Speed Control – no default pins are defined; two pins are required, defined by rotary_pin1 and rotary_pin1.

All pins can be easily changed at the beginning of the code if desired, though note that if the PS2 keyboard functionality is used, the clock pin must remain at pin 3 due to interrupt requirements. Optional I2C functionality uses pins A4 and A5; avoid using these pins if you plan to add the Adafruit I2C LCD display now or in the future.

Configuring the Keyer Code

Starting with (stable release) Version 2.0, the configuration options and various other settings are broken out into separate files:

keyer_settings.h : various settings for features; you probably won’t need to touch this unless you’re a power user or want to tweak stuff

keyer_debug.h : turns on debugging code; you probably won’t ever have to touch this unless you’re deep in the code or someone on the Radio Artisan group asks you to enable debugging and post the debug logs for troubleshooting purposes

This may look complicated and daunting at first, however the instructions below go into detail on what to configure at compile time in order to get the features you want, so don’t fear. It is recommended to start with a minimal software and hardware feature set, then add additional features as needed or if you just want to play around. Be patient and you’ll be rewarded with a darn fun and useful keyer.

Command Buttons

Button 0 is the command button. Pressing it will put the keyer into command mode which is described in detail below. Holding down the command button and pressing the left or right paddles will increase or decrease the CW speed.

Buttons 1 through 12 will play memories when momentarily depressed. To have a memory autorepeat (such as for doing a repetitive CQ), hold down the memory button and tap the left paddle. Holding buttons 1 through 6 down for a half second will switch the transmitter (1 through 6), if multiple PTT lines are enabled.

Buttons are multiplexed on one analog line using a voltage divider. You do not have to install all the buttons, and you can actually configure the number of buttons by changing this compile time setting in keyer_settings.h:

#define analog_buttons_number_of_buttons 4

Two other settings are used to define the voltage divider resitor values:

#define analog_buttons_r1 10
#define analog_buttons_r2 1

analog_buttons_r1 is the value of R7 in the schematic in K (kilo ohms), and analog_buttons_r2 is the value of the remaining resistors (R8, R9, R10, R11, R12, etc.) The code calculates the voltage values for each button at runtime based on the three settings above. If you decide to use other resistor values you can adjust these values in the code, just be sure to do the math and make sure the resistors you chose make reasonable voltages and currents.

Command Mode

To enter command mode, press button 0, the command button and you will hear a “boop beep”, after which you can enter various commands by sending character using the paddle. (Note that if you’re in bug or straight key mode, you will temporarily be switched to iambic in command mode.)

If you enter a bogus command or the keyer didn’t recognize the character you sent, it will send a question mark, upon which you can retry your command.

To exit command mode, send X in CW using the paddles or just press the command button again upon which you will hear “beep boop” and you’ll be back in regular sending mode.

The behavior of the P command (program memory) can be changed with the following compile time options:

#define OPTION_PROG_MEM_TRIM_TRAILING_SPACES – this option will remove all trailing spaces from memories programmed in command mode

#define program_memory_limit_consec_spaces 1 – this setting limits the number of consecutive wordspaces that will be written to a memory

Neither of these settings affect memory programming when using the command line interface (CLI).

Serial Command Line Interface (CLI) / CW Keyboard

The keyer has a serial Command Line Interface (CLI) using the built in Arduino USB port or AVR serial port. This is enabled by uncommenting this line in keyer_features_and_options.h:

#define COMMAND_LINE_INTERFACE

Simply connect to your computer and use a terminal program such as the Arduino serial port program or Putty. If you use the Arduino program, it’s recommended that you set it for carriage return (lower right).

To use the CW keyer functionality, simply type in what you want to send. In the Arduino serial interface you will need to hit Enter to send the data to the keyer for it to start sending. Programs like Putty will immediately send the characters and the keyer will send the code immediately as well.

Commands are preceded with a backslash (” \ “), the key above your Enter key (at least on US PC keyboards). To see a help screen, enter backslash question mark ” \? ” (no quotes). The status command (\s) is a useful command for viewing various settings and seeing the contents of the memories. If you enter a double backslash (“\\”), all sending buffers will be cleared and any memory sending will stop (this includes sending invoked by the PS2 keyboard or Winkey interface protocol emulation features).

CW Speed Adjustment

The memory macro \w, or \y and \z for incremental increases or decreases

Holding down the command button (button 0) and pressing the left and right paddles

Potentiometer Speed Control

Rotary Encoder Speed Control

Potentiometer Speed Control

Adjusting the speed pot will immediately change the CW speed during manual sending or memory playing, however its changes will not be written to non-volatile memory. If the speed is changed using other methods (command mode, command line interface, memory macro, command button shortcut) that will override the pot setting until the pot is adjusted again.

Straight Key Support

Go into straight key mode by holding down the right paddle when powering up or power resetting. This places the keyer exclusively in straight key mode with very limited functionality.

Activate FEATURE_STRAIGHT_KEY in features_and_options.h and define pin_straight_key in keyer_pin_settings.h . Grounding the pin with a straight key will give you straight key operation in parallel with paddle operation and still give you access to the all the normal keyer functionality. (The straight key does not work in command mode, however it can be used to program memories when used with FEATURE_STRAIGHT_KEY. )

Bug Mode

To go into bug mode, use the command mode G command or the command line \g command.

Ultimatic Mode

To go into Ultimatic mode, use the command mode D command or the command line \d command.

Single Paddle

To go into Single Paddle mode, use the command mode C command of the command line \c command.

CMOS Super Keyer Timing applies only to Iambic B mode. Setting the timing percent to 0 (zero) is essentially pure Iambic B and 100 is pure Iambic A. This function can be turned on and off at runtime using the command line interface \& command, and the timing percentage can be set using the \% command. Settings for this are stored in nonvolatile memory.

Sidetone Line

The sidetone line normally outputs square wave sidetone for driving a speaker. Sidetone can be disabled on transmit using the command mode O command. This is for transmitters that generate their own sidetone.

The sidetone frequency can be adjusted using the F command in command mode.

PTT (“Push To Talk”)

The PTT pins go high whenever code is sent. If it’s desired to have the PTT line go high before code is sent or stay high for a period of time after code stops being sent, these lines can be adjusted in keyer_settings.h:

The lead and tail times are in milliseconds, and these are set for each transmitter independently. This feature is useful for driving T/R switches or older transmitters than need a little more time to get keyed up, or FM fox transmitters that need to have PTT keyed and sidetone pumped into the microphone line.

PTT tail time is invoked when sending code automatically, such as via a memory play, the CLI, the PS2 keyboard, or Winkey interface emulation. PTT hang time is invoked for manual sending using the paddle and is speed (wpm) dependent.

Note that if you activate PTT lead time, you should activate tail time as well, otherwise PTT lead time will be invoked before each dit or dah, significantly slowing down the sending speed.

Currently PTT lead, tail, and hang times can only be changed at runtime using the Winkey interface emulation. (Let me know if you would like CLI commands to do this.)

For testing purposes the PTT line can be manually toggled on and off using the \u CLI command.

If your CW transmitter keys up when the CW line is keyed (or you are not going to use multi-transmitter support), there is probably no need to use the PTT line.

If you do not need the PTT lines and wish to use the Arduino pins for another function such as a transmitter keying line, simply set the pin number to zero, as so:

#define ptt_tx_1 0

#define ptt_tx_2 0

PTT and TX key lines can be inhibited with the FEATURE_PTT_INTERLOCK function. The PTT interlock pin is defined on this line:

#define ptt_interlock 0

When the input is taken high, the PTT and TX key lines will not go active.

QRSS (Slow Speed CW)

QRSS mode can be activated using the command line \q command or in memory macros using the \q macro. Both take the dit length in seconds (double digit number) as an argument. For example: \q09 would put the keyer in QRSS mode with nine second long dits (and 27 second long dahs).

The \r command will switch back to regular CW speed mode in both the command line and in memories.

HSCW (High Speed CW)

High speed CW can be accomplished by using the \w command line interface command or in memories as a macro. Whereas the command mode speed adjustment and the speed potentiometer allow the speed to go up to a maximum of 60 WPM, the \w command will let you take it up to 255 WPM.

Hellschreiber

The keyer will send Hellschreiber characters by placing it in Hellscreiber mode using the \h command in the serial command line interface or memory macros. In the command line interface \c will return the keyer to CW mode and the \l (as in lima) memory macro will change back to CW. While in Hellschreiber mode, the paddle will still send CW. The Hellschreiber mode is intended mainly for beacons but works just fine for direct keyboard sending and is enabled with FEATURE_HELL in keyer_features_and_options.h.

Hellschreiber Copied From the Keyer Speaker into a Laptop (click to enlarge)

Memory Operation and Memory Macros

Memories can be manually played using buttons 1 through 5, or using the \# command in the command line interface (for example, \1 plays memory 1). In command mode the memories can be sent without transmitting by entering the number of the memory.

Memories are programmed using the command line interface \p# command or in command mode using the P command.

To program memory 1 with CQ CQ CQ DE K3NG, the command would be \p1CQ CQ CQ DE K3NG.

To program memory 1 using command mode, enter command mode by pressing the command button and sending the P command. After hearing a beep, send the CW code to be stored and when finished, hit the command button to exit programming. The keyer will then play back the memory. If the keyer didn’t recognize a character you sent it will send a question mark in its place.

Macros can be placed in memories to do cool things. Some macros include:

\# Jump to memory # (1 through 9)

\c Play serial number with cut numbers

\d### Delay for ### seconds

\e Play serial number, then increment

\f#### Set sidetone to #### hertz

\h Switch to Hell sending

\i# Insert memory # (This is different from \#, the jump macro. The insert memory macro plays another memory, then comes back to the memory the keyer was originally playing. The jump command jumps to the other memory and doesn't come back.)

\l Switch to CW (from Hell mode)

\n Decrement serial number, do not send

\q## Switch to QRSS mode, dit length ## seconds

\s Insert space

\r Switch to regular speed mode

\t### Transmit for ### seconds

\u Activate PTT

\v Deactivate PTT

\w### Set regular mode speed to ### WPM

\x# Switch to transmitter # (1, 2, 3, 4, 5, or 6)

\y# Increase speed # WPM

\z# Decrease speed # WPM

\+ Prosign the next two characters

(Note that both command line commands and CW memories are case insensitive.)

The number of memories is set at compile time using these lines in keyer_settings.hs:

#define number_of_memories 12

#define memory_area_start 20

#define memory_area_end 1023

Up to 12 memories can be configured, with some caveats. Nine memories are supported in the CLI and in memory macros, and the full 12 are supported with the PS2 keyboard.

Memory_area_start and memory_area_end define the starting and ending EEPROM locations for the entire bank of memory. The memory area is divided up evenly between the memories. The example settings above will result in 12 memories each with 83 bytes, or 83 characters.

CW Dah to Dit Ratio Adjust

The CW dash length to dot length ratio can be adjusted using the J command in command mode. Upon entering the J command you will hear a repeating dit dah. Use the left and right paddles to shorten or lengthen the dah. Squeeze both paddles to exit the adjustment command. After that you can enter X or press the command button to exit command mode.

The ratio can also be adjusted in the command line interface using the \j command. \j300 sets the keyer for a normal 3:1 ratio, \j250 would set it for a 2.5:1 ratio, for example.

Paddle Reverse

The command mode N command switches the left and right paddles. The equivalent function in the CLI is \n and using the PS2 keyboard it’s CTRL-N.

Tune Mode

The command mode T command or command line interface \t command goes into tune up mode. In the PS2 keyboard, use CTRL-T.

TX Disable / Enable

The transmit line can be disabled and enabled using the \i CLI command or I command in command mode. The equivalent PS2 keyboard command is CTRL-I. This feature can be used for sending practice without keying the transmitter.

Autospace

The autospace feature can be toggled on and off with the Z command in command mode, the \z command in the command line interface, and CTRL-Z using the PS2 keyboard. This feature “cleans up” manual sending a bit by automatically inserting a wordspace delay if the operator waits more than one dit after sending a dit or dah to paddle either paddle. The autospace feature is activated by uncommenting this line:

#define FEATURE_AUTOSPACE

Wordspace Adjustment

Wordspace is the key up time in between words. By default it is set for seven dit lengths by this line in keyer_settings.h:

#define default_length_wordspace 7

This can be adjusted using the \y command line interface command.

Dit and Dah Buffer Control

The dit and dah buffers can be turned on and off by adding this feature:

#define FEATURE_DIT_DAH_BUFFER_CONTROL

The dit and dah buffers can be turned on and off using the command line interface \. and \- commands. The settings are stored in nonvolatile memory.

Keying Compensation

The keying compensation filter extends the time of both dits and dahs to compensate for older transmitters that are slow on the draw in QSK at higher speeds. The inter-element key up times are reduced a corresponding amount of time. The time in mS can be set here in keyer_settings.h:

#define default_keying_compensation 0

Currently there is no command to adjust this at runtime, however the Winkey emulation will adjust this if it is set in the host application.

First Element Extension Time

This feature makes the first dit or dah sent longer to compensate for slow T/R switches in rigs. The time is set here in keyer_settings.h:

#define default_first_extension_time 0

Currently there is no command to adjust this at runtime, however the Winkey emulation will adjust this if it is set in the host application.

Prosigns

Custom prosigns can be sent using \+ in the CLI or in memories as a macro. Several “hard wired” / common prosigns are available for various keys on the PS2 keyboard like =, -, &, etc. and the Sroll Lock key can be used to create custom prosigns on the fly.

If you are programming a memory in command mode using the paddle, the \+ macro can be used to create prosigns. The \ is six dahs ( – – – – – – ) and + is didahdidahdit ( . – . – . ). Common prosigns AR, BK, and SK are automatically recognized and do not need to be proceeded with a \+ macro, just send the prosign as you normally would (AR would be didahdidahdit, not didah didahdit).

Receive Callsign Practice

In the command line interface the \k goes into callsign receive practice. Random callsigns are sent, the user enters the received callsigns, and the keyer will tell the user if they were correct.

Currently this code produces only US callsigns. I’ll be working on enhancements later to add other country callsigns, allow various user settings and adjustments, and variable speed based on the user’s accuracy.

This feature requires this to be uncommented:

#define FEATURE_CALLSIGN_RECEIVE_PRACTICE

PS2 / USB Keyboard Interface

A common PS2 or USB PC keyboard can be interfaced with the keyer to create a computerless CW keyboard. The two types of keyboards use different libraries, so read carefully how to install and configure the proper libraries.

PS2 Keyboard

1. Download the modified PS2Keyboard library files from GitHub K3NG_PS2Keyboard.h and K3NG_PS2Keyboard.cpp). Create a directory in your sketchbook library directory called K3NG_PS2Keyboard (i.e. \Arduino\Sketchbook\libraries\K3NG_PS2Keyboard\)and place the two files in there.

2. Uncomment the following line in the K3NG Arduino Keyer code:

#define FEATURE_PS2_KEYBOARD PS2

3. Connect up a PS2 keyboard to your Arduino. Details on the pinouts of a PS2 keyboard connector can be found here.

Note that the PS2 keyboard data line can be relocated to other pins if desired, but the keyboard clock line must remain at pin 3 as that pin has special functionality for interrupt operation which is required by the PS2 keyboard library code.

4. If you are using an international non-US keyboard, keyboard mappings can be chosen in K3NG_PS2Keyboard.h:

Arduino 1.6.x (and probably 1.5.x) has issues with these three lines, probably because Arduino now includes library files with the same names with the IDE package. If you can’t get it to compile, try Arduino 1.0.x. For me it compiles no problem with Arduino 1.0.5.

In order to connect the USB keyboard, you need hardware with a host USB port. This can be accomplished several ways:

4. Build your own USB host interface using the MAX3412 chip using any one of the above circuits as an example.

PS2 / USB Special Key Assignments:

F1 through F12 – play memories 1 through 12

Up Arrow – Increase CW Speed 1 WPM

Down Arrow – Decrease CW Speed 1 WPM

Page Up – Increase sidetone frequency

Page Down – Decrease sidetone frequency

Right Arrow – Dah to Dit Ratio increase

Left Arrow – Dah to Dit Ratio decrease

Home – reset Dah to Dit Ratio to default

Tab – pause sending

Delete – delete the last character in the buffer

Esc – stop sending and clear the buffer

Scroll Lock – Merge the next two characters to form a prosign

Shift – Scroll Lock – toggle PTT line

CTRL-A – Iambic A Mode

CTRL-B – Iambic B Mode

CTRL-C – Single Paddle Mode

CTRL-D – Ultimatic Mode

CTRL-E – Set Serial Number

CTRL-G – Bug Mode

CTRL-H – Hellschreiber Mode (requires FEATURE_HELL)

CTRL-I – TX Line Disable/Enable

CTRL-M – Set Farnsworth Speed (requires FEATURE_FARNSWORTH)

CTRL-N – Paddle Revers

CTRL-O – Sidetone On/Off

CTRL-T – Tune

CTRL-U – PTT Manual On/Off

CTRL-W – Set WPM

CTRL-Z – Autospace On/Off

SHIFT-F1, F2, F3… – Program memory 1, 2, 3…

ALT-F1, F2, F3… – Repeat memory 1, 2, 3…

CTRL-F1, F2, F3… – Switch to transmitter 1, 2, 3…

USB Keyboard Only

Keypad / – Dit Paddle

Keypad * – Dah Paddle

Keypad ENTER – Tune / Straightkey

Myself and others have experienced issues using just the Arduino USB client port +5V to power the Arduino and PS2 keyboard, with operation being erratic or the keyboard just not functioning at all. This is due to computer USB ports not being able to supply enough current. The solution is simple: power the Arduino board directly using the power connector.

Some keyboards (like mini keyboards) may require a reset code sent to them in order to function correctly. To enable this, in keyer_features_and_options.h uncomment:

#define OPTION_PS2_KEYBOARD_RESET

USB Mouse

Why connect a USB mouse to a keyer? Because you can!

I added this feature on a whim after getting the USB keyboard code completed because the USB library supports mice and I wondered what it would be like to send code with a mouse. The answer is it’s not great sending code with a mouse, however this feature code have a practical application. I connected a wireless mouse to the Arduino and was able to walk around the room sending code. Undoubtedly you could use the guts of an old wireless mouse (I seem to go through one of these a year) and build a wireless paddle by mounting the electronics on a respectable paddle.

To enable the USB mouse functionality, install the USB library as described above in the USB Keyboard section and uncomment this line: #define FEATURE_USB_MOUSE

That’s it. The left mouse button is dit, the right is dah, and the middle button is a straight key.

As of this writing I have not been able to get both the USB mouse and keyboard to work simultaneously in the code, however it is possible to run a PS2 keyboard and USB mouse, if you have a bigger Arduino, like the Mega, that has more memory to work with.

USB HID Human Interface Device

This cool feature, which requires an Arduino Due or Leonardo, turns things around and lets you use your keyer as a keyboard for your computer. (Yes, really.) With it you can type up emails or whatever you like using your paddle. Don’t try this with your off-the-shelf MFJ keyer or a pre-programmed proprietary keyer chip you bought, because they won’t do it. LOL. Open source rocks. But I digress.

The keyer can be interfaced to logging and contest programs with the K1EL Winkey interface protocol emulation feature. To enable, uncomment the following line:

#define FEATURE_WINKEY_EMULATION

This defaults the code to Winkey 1 mode. To enable K1El Winkey 2 interface protocol emulation functionality, uncomment this line in addition to the one above:

#define OPTION_WINKEY_2_SUPPORT

If you want compile both the CLI and K1EL Winkey interface protocol emulation features and upload to a unit, uncommenting the line below will cause the unit to default to K1EL Winkey interface protocol emulation rather than the normal Command Line Interface mode at power up or reset.

#define SERIAL_PORT_DEFAULT_WINKEY_EMULATION

With the K1EL Winkey interface protocol emulation feature enabled, if you hold down the command button (button 0) and reset or power up the unit, it will go into the non-default mode. (If the default is K1EL Winkey interface protocol emulation, it will go into Command Line Interface mode, and vice versa.)

You may need to disable some features to get both the CLI and K1EL Winkey interface protocol emulation features to fit into an Arduino Uno. Other larger Arduino variants like the Mega can hold all of the features and options.

In K1EL Winkey interface protocol emulation mode the USB port will be set for 1200 baud. The emulation is a 99.9% complete emulation, and it should work with most programs that support K1EL Winkey interfacing. The N1MM contesting program and Ham Radio Deluxe (HRD) have been tested and work with all features I’ve tried. Win-Test works as well, however only with the keyer in Winkey 1 mode. (There is some sort of initialization error in Winkey 2 mode that I have not been able to identify and correct.)

The emulation functionality translates the K1EL Winkey interface protocol to native K3NG keyer functionality. The K1EL Winkey “protocol” is a de facto standard and many programs support it, and developing an open standard protocol and getting all the major programs to support it would be a monumental undertaking. So it made sense to merely emulate the existing protocol everyone else is talking.

SO2R operation has been run successfully with the N1MM contest program.

I have found to have this emulation work reliably with programs other than N1MM, you should disable the Arduino Automatic Software Reset as described here. This is done by cutting the PC board trace labeled RESET-EN on the Arduino Uno board, or an alternate solution is to install a capacitor on the reset line. I have found when some programs, including HRD, connect to the COM port, errant bytes are interpreted or received by the Arduino which trips up the protocol conversation and the program and keyer will not connect. In this configuration the keyer will not reset when a program connects to the COM port and it will be “ready to talk” immediately when the program begins sending bytes.

If you do not disable Automatic Software Reset and are using Ham Radio Deluxe uncomment the following line:

#define OPTION_WINKEY_DISCARD_BYTES_AT_STARTUP

This option will discard the first three bytes that arrive on the USB port. This hack works for my hardware, but your mileage may vary. The number of bytes discarded at start up can be set here:

#define winkey_discard_bytes_startup 3

A side effect of disabling Automatic Software Reset is that you will need to manually hit the reset button when uploading new software to the Arduino. The button should be pressed as soon as you “Binary sketch size: xxxxx bytes” message in the Arduino program.

In the last free version of HRD, there is a bug in its Winkey interface implementation. If you rapidly change the dah to dit ratio in the graphical user interface or change the speed rapidly, HRD will send incomplete commands to the Winkey. This will cause errant characters to be sent by the keyer, but otherwise the keyer will continue to function.

Ham Radio Deluxe offers a very nice Winkey settings interface. Presumably one could use this interface in place of the keyer command mode or command line interface and control most of the functionality in this keyer.

If you attempt to use this emulation with other programs and have issues, please let me know and I’ll attempt to figure it out. Serial port sniffer captures are very helpful in troubleshooting these issues.

N1MM exhibits a minor bug in the Send CW (CTRL K) window. If you hit the Tab key, N1MM sends a 0x09 byte to the keyer which is actually the PinConfig command. The next keystroke that is sent will be interpreted as an argument for this command and will alter the pin configuration and sidetone operation. If you accidentally hit the Tab key and the keyer stops keying the transmitter, or the sidetone is operational is toggled, re-initialize the Winkey interface in N1MM to restore the keyer back to proper operation. However, never fear, there is a workaround in the code for this bug. Uncomment this line:

#define OPTION_N1MM_WINKEY_TAB_BUG_WORKAROUND

Note this option breaks SO2R functionality in N1MM, but if you’re only going to be using one rig it will work fine. I offered to give the N1MM team details on the bug, however my offer was ignored. But I digress.

Despite theclaims, the N1MM program is not open source. If you request the source code it may be given to you and you can’t redistribute it or fork the code. That’s called freeware and beg-for-the-source. Not that there’s anything wrong with that, just don’t call it open source. But I digress. This keyer is compatible with both N1MM classic and N1MM Plus, despite my polite requests to be listed on the hardware compatibility page which have been ignored. But I digress. I seem to digress a lot, don’t I?

If you would like to use RUMlog or RUMped activate OPTION_WINKEY_FREQUENT_STATUS_REPORT. Both programs like to have very frequent status bytes back from the Winkey host in order to send code properly.

If you’re using Wintest, activate OPTION_WINKEY_2_HOST_CLOSE_NO_SERIAL_PORT_RESET.

If you are using UcxLog, activate OPTION_WINKEY_UCXLOG_9600_BAUD and check the 9600 baud checkbox in the UcxLog setup.

Dead Operator Watchdog

This feature turns off the transmit line after 100 consecutive dits or dahs. It can be enabled by uncommenting this line:

#define FEATURE_DEAD_OP_WATCHDOG

EEPROM / NonVolatile Settings

Most settings are stored in non-volatile EEPROM memory. Memory macros which alter the CW speed are not stored to EEPROM as to avoid “wearing out” EEPROM locations, especially in beacon mode.

Reset to “Factory” Defaults

To reset the keyer to defaults, depress both the left and right paddles and do a reset or power reset. This will wipe out all memories and change all the settings back to defaults.

Multi-Transmitter Capability

This keyer supports multiple transmitters that can be selected using the \x CLI command, the CTRL-F1, F2, etc. key combinations on the PS2 keyboard, or using the hardware buttons (button1 hold, button2 hold, button3 hold, etc.). Up to six transmitters can be configured, each with its own keying line and PTT line. PTT lines are optional. The configuration of the TX Key and PTT lines are here:

Setting a line to zero disables it. At the very least you need one TX Key line defined. Obviously, with the Arduino Uno, pins are at a premium and each features uses pins. Larger Arduino platforms like the Mega offer more pins and more compiled-in functionality due to the larger memory space.

Dit and Dah Pins

If you need separate pins to indicate dits and dah, the pins can be defined here:

Note that the Adafruit I2C display uses pins A4 and A5 by default for interfacing as these are the hardware I2C pins. No pin setup is required in the code when using this dispay.

No pin setup is required when using FEATURE_LCD1602_N07DH

3. If you are using a display that does not have 16 columns and 2 rows, adjust these two lines:

#define lcd_columns 16
#define lcd_rows 2

4. If you have free memory, uncomment this line for more messages on the display:

#define OPTION_MORE_DISPLAY_MSGS

At higher CW speeds, the sending speed may be impacted by I2C LCD displays. This can be rectified by
increasing the I2C bus speed in file twi.h (it will be in ….\arduino-1.0.1\libraries\Wire\utility). Alter this line:

#define TWI_FREQ 100000L

…and change the setting to something like 500000L. (Thanks to AD7KG for discovering this bug and testing the fix.)

To change the character that is used to indicate unknown characters in paddle echo, customize this line:

#define unknown_cw_character ‘*’

(If you want to hear a sound when an unknown character is sent, enable OPTION_UNKNOWN_CHARACTER_ERROR_TONE)

Non-English Characters

If you need to customize the characters for your locality or language, modify the code in functions send_char() and convert_cw_number_to_ascii(). This support was added in version 2012011701 and currently works only with the command line interface and the K1EL Winkey interface protocol emulation. Support for the PS2 keyboard is in the works.

Sleep Mode

Sleep mode will put the unit to sleep after a certain amount of inactivity, in order to preserve battery power. To enable the feature, uncomment this line:

#define FEATURE_SLEEP

The inactivity timer is set here (the unit is minutes):

#define go_to_sleep_inactivity_time 10

To wake the keyer after it goes to sleep, simply hit the left (normally dit) paddle.

Command Mode Active LED

If you would like to have an LED activate when in command mode, define this pin and have it power an LED:

Alphabet Code Practice Mode

The feature allows you to practice sending the alphabet. To access it, go into command mode and send S on the paddle. You’ll here a dit. Send the letters in alphabetical order on the paddle: A, B, C, etc. If you send the correct letter in succession, you’ll hear a beep. If you send the wrong CW, the keyer will tell you with a boop sound. If you make a mistake, try to send the character again. To exit alphabetical sending practice, press the command button.

This feature is enabled by uncommenting:

#define FEATURE_ALPHABET_SEND_PRACTICE

The code for this feature was provided by Ryan, KC2ZWM.

QLF Feature

This feature emulates someone sending with their left foot. Activate with FEATURE_QLF. Various settings to tweak the behavior are:

QLF mode is activate in the command line interface using the \{ command.

Have fun!

CW Decoder

The keyer can be configured to decode off the air CW using FEATURE_CW_DECODER. The decoded character are displayed in both the Command Line Interface (CLI) and LCD display, whichever is configured. The input pin for the CW decoder is defined in keyer_pin_settings.h:

#definecw_decoder_pin A11

If you wish to have a indicator to assist in tuning in the CW signal and setting levels, define this output pin:

#definecw_decoder_indicator24

This is especially useful with the DSP Audio Decoder described below, driving an LED indicator.

The CW decoder can be interfaced two ways:

External Tone Decoder Hardware

If external tone decoding hardware is used, cw_decoder_pin is a straight digital input. Drive it low (0V) when there is a CW signal, and high (+5V) when there is no CW tone.

DSP Audio Tone Decoder

To activate the audio tone decoder in software, activate OPTION_CW_DECODER_GOERTZEL_AUDIO_DETECTOR. This option compiles in a Goertzel DSP audio detector. The code used in the CW keyer was originally written by Hjalmar skovholm Hansen, OZ1JHM and is described further on his project web page. When using this option cw_decoder_pin must be an analog pin, such as A1, A2, A3, etc.

Prior to making changes, please read the notes in the source code. The sampling frequency is CPU dependent and there is a mathematical relationship between the sampling frequency, target frequency, and number of samples.

The Arduino Due has an 84 Mhz clock, so the sampling frequency will be different than the Arduino Uno and Mega which both have a 16 Mhz clock. For the Due, you can use these settings:

#define GOERTZ_SAMPLING_FREQ 46872.0
#define GOERTZ_SAMPLES 168

To interface the audio with the Arduino, consult Hjalmar’s project page for the circuit. It’s very simple. A 10k ohm resistor goes from +5V to the analog pin, and a 10k ohm resistor is placed from the analog pin to ground. This biases the analog pin at +2.5 volts. The audio is coupled to the analog pin via a 0.1 uF capacitor.

As far as tuning in signals, I have found that the DSP decoders better when receiver filters are wide. It’s counterintuitive, but narrow CW filters seem to make the DSP decoding not perform as well. Also, the optimal audio level appears to be just slightly above the threshold where tone detection occurs. An LED using the cw_decoder_indicator output pin is very helpful in determining this point.

The CW decoder is still a bit experimental and it is planned to improve the decoding algorithm.

Multiple Serial Ports

Some Arduino models like the Mega have multiple serial ports. With this keyer code it is possible to run two serial ports simultaneously. One port can run Winkey emulation, the other can run the Command Line Interface, or both can run the CLI.

If you enable FEATURE_WINKEY_EMULATION and OPTION_PRIMARY_SERIAL_PORT_DEFAULT_WINKEY_EMULATION, the primary serial port will go into Winkey emulation mode at boot up. The primary serial port is also defined in keyer_settings.h:

#define PRIMARY_SERIAL_PORT &Serial

If you hold down the command button at boot up, the primary serial port will switch to Command Line Interface mode.

FEATURE_COMMAND_LINE_INTERFACE+FEATURE_WINKEY_EMULATION+ OPTION_PRIMARY_SERIAL_PORT_DEFAULT_WINKEY_EMULATION: Winkey on the primary port (“Serial0”) by default, hold command button at boot up for CLI

FEATURE_COMMAND_LINE_INTERFACE+FEATURE_WINKEY_EMULATION: CLI on the primary port (“Serial0”) by default, hold command button at boot up for Winkey

FEATURE_COMMAND_LINE_INTERFACE+FEATURE_WINKEY_EMULATION+ OPTION_PRIMARY_SERIAL_PORT_DEFAULT_WINKEY_EMULATION+FEATURE_COMMAND_LINE_INTERFACE_ON_SECONDARY_PORT: Winkey on the primary port (“Serial0”) by default, hold command button at boot up for CLI on primary port (“Serial0”), CLI on secondary port (Serial1) all the time

FEATURE_COMMAND_LINE_INTERFACE+FEATURE_COMMAND_LINE_INTERFACE_ON_SECONDARY_PORT: CLI on both primary port (“Serial0”) and secondary port (Serial1) all the time

Hardware Profiles

Various hardware profiles can be enabled at compile time in the keyer_hardware.h file. With no hardware profiles uncommented in this file, the normal keyer_features_and_options.h, keyer_settings.h, and keyer_pin_settings.h files are compiled. If a hardware profile is uncommented, an alternate set of files is used:

These alternate hardware profile files are preconfigured to match the hardware and provide an easy and quick way to compile. More hardware profiles will be added later.

Arduino Due Hardware

The Due does not have EEPROM memory like the other Arduino boards. So either you must run the code without EEPROM functionality, or install an external EEPROM. Support for the E24C1024 EEPROM is available; compile in FEATURE_EEPROM_E24C1024. If you do not install external EEPROM hardware, you cannot compile in FEATURE_MEMORIES and all settings will be volatile (they will not survive a reboot). You will also notice that the keyer does the beep-boop-beep-boop-beep-boop at power up to indicate that it is initializing with “factory” settings. This is because there is no EEPROM to pull settings from and the code thinks it is being booted up for the first time.

Code Compilation

All of the features will not fit on an Arduino Uno simultaneously. If the compiled code goes over about 28.5K, the upload a stock Uno will fail. The Nano holds slightly more than a stock Arduino.

You can burn an alternate bootloader to your Uno called Optiboot which will free up an additional 1.5K of program space to stuff additional features on to your Uno.

The Arduino Mega will run the entire “nine yards” compiled and is a fun board. The Arduino Due will also run all of the code.

Miscellaneous Notes

Do not enable the potentiometer feature if you do not have a potentiometer connected, otherwise noise on the pin will falsely trigger speed changes. Also, do not enable FEATURE_BUTTONS unless you have the corresponding resistors on the button pin connected. If the analog button pin does not have +5 volts on it, the keyer will not start up as it thinks there is a button depression in progress.

The K3NG Arduino Keyer will not work with Logger16, Logger32, Logger64, Logger128, and Logger256. I haven’t tested Logger1024 or Logger2048, but it probably doesn’t work with them either. Attempts to interface this keyer to any version of Logger may result in your Arduino board smoking or perhaps bursting into flames. Contact the (un)friendly support people on the Logger Yahoo Group for help with this issue. Be sure to drink a Lager or 32 afterwards.

Arduino LLC versus Arduino SRL

Please note that the real Arduino organization is Arduino LLC at arduino.cc, not Arduino SRL at arduino.org. If you have purchased an Arduino board since about March 2014 with arduino.org on it, this board did not support the Arduino organization or development of Arduino projects and code. Encourage the resellers you buy Arduino products from to drop Arduino SRL products and carry those which support the Arduino LLC organization.

Arduino models specifically offered by Arduino SRL such as the Yun and Zero and the forked Arduino SRL IDE interface will not be supported by this project.

Support

Please consult this page for support information. Feature requests and bug reports are documented and tracked on GitHub.

I encourage you to experiment with the code, customize it, learn from it, and have fun. That’s what amateur radio is all about. However, if you’re a novice programmer, please don’t ask me to work on your hacked up code to implement some specific application you’re looking for. If you would like for me to develop code for a specific piece of hardware or a device, you may be able to interest me in doing this by sending me a piece of hardware (free) to develop with and use.

I am not an expert or professional programmer. I tend to write readable code with sufficient though often sparse comments. (Good code shouldn’t need a lot of comments.) I avoid complexities that some hotshot C or C++ programmers may do as the goal here is to have fun, not show off how obfuscated I can make my code. Undoubtedly there are better or more efficient ways to do some things in the code.

Marc, F6ITU, has created a Wiki page (En Francais) describing the keyer project and plans for an Arduino shield. There is also an alternate patch PS2 keyboard library for European/French(?) keyboard localization.

Sverre, LA3ZA, provided additional OPTION_DISPLAY_NON_ENGLISH_EXTENSIONS code work and has documented it here.

If you contributed and I’ve failed to list you above, please email me!

I would like to give special thanks to the staff of an unnamed popular contest logging program for refusing to provide any help in implementing a certain feature and prompting me to create a better technical solution with others who were willing to help.

DXpeditions

I will donate keyer parts or assembled keyer units for DXpeditions. Please contact me at anthony dot good at gmail dot com to discuss if you’re organizing a DXpedition.

Kitting

If you sell kits using my code for a profit, I ask that you send me a free kit as a courtesy. Share the love. :-)

The Code

Now that you’ve read through all of the documentation, you will be rewarded with source code. :-)

Source code is located on GitHub . Click the Download Zip button on the lower right to get all the code in a ZIP file.)

Older code versions can be found here. Click the commit you’re interested in, click Browse Files and you will find a Download ZIP button that you can use to download that particular git commit / version.

Share this:

Like this:

370 responses to “Arduino CW Keyer”

In order to accomodate the growth in interest, support for all my projects and all discussions have been moved to this Yahoo Group: http://groups.yahoo.com/group/radioartisan/ . The comments areas on the blog are now disabled. Thanks everyone for your support. 73 Goody

Hi Robin. Where are you attempting to download it from? Upgrading the firmware isn’t too difficult, it’s the same way you would upload a new sketch to an Arduino. You have to select the appropriate features and options in the source code, per the instructions on this page.

At last !
Any useful ham application for Ham Radio for the Arduino. Been doing some tries myself but your code rock… Great job… Also looking fwd to the Winkeyer “mode”.. Have a Winkeyer thru my microHam today but I like to run things remote some times.
Keep up the good work

If I were to run this as a USB-only keyboard keyer – apart from not connecting all the other paddles and paraphernalia – you wouldn’t see any problems running this just as a cut-down keyboard only device?

You can’t connect just a keyboard to it (you still need a computer with a terminal program connecting to the COM port), but yes, it will function fine without a paddle as all the commands needed to control it are available in the command line interface.

If you’re looking to just connect up a keyboard directly to the Arduino (computer), I can probably have that functionality in the code in pretty short order. Let me know if that’s what you’re looking for and work something up :-)

Hi Oscar. Unfortunately there is no new progress to report. I’m still going to try to get the emulation working, but I have submitted a feature request to N1MM for functionality to support “generic” external keyers.

It is amazing, thanks for the leads, I’ve made a few changes that better suit my needs, not sure
if they are improvements as much as tailoring… like a custom suit of clothes. Still it all came
from your base, thanks. I’ll send you my minimal changes as well as photos of completed unit
once it is mounted.

Hi Art. Good deal! Please do send me your customizations. If you see a need for them, undoubtedly someone else will as well and I may be able to incorporate them in as options. That’s the great thing about define statements and modular code; you can add and remove options easily at compile time.

Thanks for dropping me a note. I like it when people can benefit from the code!! :-)

Please take a look at the K1EL “OpenQRP” project. Steve has created a complete 40M transceiver using an Arduino CPU with all his famous K1EL WinUSB keyer features and system control functions.http://www.openqrp.org

Hi Ken. When you mentioned the OpenQRP project to me back in March I joined the site and also offered to volunteer some coding time to the project. No one has taken me up on my offer, but my offer still stands. It looks like a good project.

I should mention that it’s not my goal here to compete with the Winkey or any other keyer project. I just like the Arduino and coding, and I wanted to implement my PIC keyer on the Arduino platform. The project took on a life of its own and it does much more than my PIC keyer project did. Admittedly I think I’ve become addicted to the Arduino.

I’ve been too busy coding software to lay out any hardware :-) Since the Winkey interface emulation is pretty much done, I’m going to focus on the PS2 keyboard feature for a bit and after that I think I’ll design a keyer shield.

Can you post some pics when you get it cut? Some people fret over the circuit and what is inside. I’m one of those that will use ugly, dead bug, etc and not care but fret for hours over the perfect enclosure. I’m planning on building two of these for 2 CW stations for use at a special event in October. http://www.qrz.com/db/k4l

This weekend I have another update coming out. The Winkey interface emulation is now 99% complete and I’m making major updates to the PS2 keyboard feature would should get it to the 95% completion level with CTRL key combinations to set most parameters and memory programming. Also with this update the number of memories can be easily changed at compile time and the PS2 keyboard will support up to 12 memories and the CLI will support 9. If anyone wants more memories supported with the buttons, let me know and I’ll work on a button MUXing scheme. I’m also going to find a way to support more transmitter lines and have it easier to configure at compile time. I want to be able to switch between multiple rigs in the shack without swapping cables.

After this update I think I may work on the I2C and LCD display functionality I’ve been thinking about.

Okay, is there enough room for all those enhancements :) I enabled the the practice feature last night and the IDE had an issue uploading. After sending some of the stuff it complained that the UNO had stopped responding. I think the compiled code was about 30k. Probably just an issue on my Ubuntu machine.

I’ll have to merge your updates with some of my minor changes. In lieu of the practice feature you may want to add a command that will set key_tx = 0. This will allow folks to use the keyer as a practice oscillator. I guess the non-lazy person could just unplug the tx cable from their radio instead :). The result would be the same.

On the muxing you could use one analog port and then use resistors. You could also use a 4051 multiplexor. I thought about changing the code to get more memories by adding buttons but the reality is that my case is going to be packed if I any more! At home I use a serial interface I built and CWType. In the field I use AA0ZZ. The AA0ZZ has 3 memories and I’ve never ran into an issue where that had not been enough. It is still good you are thinking of it so for others who want 20 buttons on a case they can have those.

I’ve been enjoying playing with this thing and it is consuming much of my time.

If you are using agle Cad and would like to share the file for the version that is on this page I would be interested in laying out a PCB for it.

New code posted. Note that the modified PS2Keyboard library files are posted here now, instead of just the code modifications. The modifications to add support for CTRL key combinations were getting too extensive to just list the changes.

I’ve not plugged in my power supply in the UNO so this may be relieved. Everytime in Linux the port is opened it resets the Arduino. I’ve got WINKEYER mode set to default and I had to not say HI when using CWType. Could be related to timing and WINE but if it did say HI CWType would error that there was no response.

I’ve almost got my enclosure complete and it looks good. I only had room for 5 buttons. Paid $2 for the case at a hamfest. Plastic so I hope this does not cause issues with lack of shielding. So far I’m able to TX at 20w in my shack.

Updated code and schematic posted. Multi-transmitter capability is now implemented using multiple PTT lines rather than multiple TX key lines, and the PTT line (now PTT line for transmitter 1) moved to pin 13.

I’m currently working on button multiplexing using an analog pin and voltage divider resistors in order to free up pins for the upcoming LCD display functionality. This will also allow the number of buttons to increase. I’m thinking of up to 19 buttons total (one command button, 12 memory buttons, 6 LCD soft keys). The number of buttons would be optional, as would the LCD display functionality.

I am seeing some issues with character sending on both paddle input and keyboard. I see that the cw speed starts out slow and speeds up slightly but noticeable, +2, 3 wpm. I am not sure what’s going on. Do others see this symptom? I’ll upload the new code later this weekend and see if it makes any differences.

On another note, the issue with the “space” timing being so long (previous note able) was a result of the ATMEL chip being bad. I replaced the processor and the space timing issue went away.

Also, I’ve added a simple serial LCD display to prior to the latest code. Seemed to work ok, just needed some additional formatting/scroll code. (By the way, I am using unmodified code during my testing with the timing issues stated above.)

Updated code posted. This code introduces analog line multiplexed buttons, so now up to 16 buttons (maybe more) are supported. This is to free up some pins for the upcoming LCD functionality and also provide more buttons for LCD display “soft keys”. Memory repeat can now be done without a memory macros (CLI: \! , PS2 Keyboard: ALT-Fx , or button hold + left paddle).

If you want to continue to use the old buttons (one button per pin) uncomment #define FEATURE_LEGACY_BUTTONS . I don’t know how long I’ll continue to keep the old code in there.

Wow, where are you finding the program space on the chip? Have you upgraded?

I have purchased about $50 worth of goodies from Evil Mad Scientist. I’m going to build one out on one of their proto PCBs and then put it in an enclosure. I use CWType with winkey support but after reading a Winkey vs cwdaemon email on QRP-L I’m debating about modifying the circuit to support RTS keying. This would make the AVR chip functionally worthless but I’m thinking more on the lines of the RTS in the circuit being an option and not standard. The RTS line would key TX1. Of course it could be used on a digital input pin and then the AVR could key. Like a pass thru.

I can’t fit everything into an Uno. However, I suspect most folks won’t want or need all features in one box. I still haven’t gotten a Mega, but now that I’ve freed up a bunch of pins for the LCD I’ll probably hold off a bit. But it will be cool to compile the whole nine yards sometime and upload it to a Mega…

Just got the keyer built as a simple USB serial TTY-to-CW unit. With careful wiring (and brute force and ignorance) I fit a speed control pot, two buttons and a simple piezo as a sounder into the standard Arduino project box – https://www.sparkfun.com/products/10088 – with the wiring on a protoshield. Worked first time! Made a nice QSO with an operator in TN with Fldigi decoding his CW. Thanks!

(Also: as an avid Hellschreiber user, we *have* to do something about that font you used …)

I was told by someone that the Uno bootloader has a bug that causes it be unable to receive a software load that’s larger that 28K or 29K, and there is a hacked/fixed bootloader that you can write onto your Uno to upload these larger loads. I have not researched this, your mileage may vary.

I am almost done with my own build using the EvilMad Scientist boards and Hammond enclosure. I think I’ve found a bug in your schematic. I’m using the July schematic and code. In Winkeyer mode when I use a paddle it seems to behave erratically. It works when I key but seems to lock up or shut down. I’ve added 1K resistors on D2 and D5 and this seems to fix the problem. I’m going to close the box up and try it out during a QSO. This is all new to me so I’m not sure what may be going on but I have an idea that too much current is being pulled and the low voltage protection that I’ve enabled in the fuses is kicking in and the chip is shutting down. You may want to modify the new schematic.

Are you powering this via USB or the coaxial jack? Does this occur when connected to a rig or just when using it “dry”? The D2 and D5 lines shouldn’t be able to load down the power supply as they’re just being pulled up with internal pullup resistors, probably on the order of 1K or more. Do you indeed see the V+ line getting loaded down with a voltmeter?

I am powering via a DC coaxial check using power off the USB bus. What I have seen a voltage drop after this occurs. So far with the 1Ks I can’t seem to recreate this. I will also try with a straight key. I could also have a chip issue since this is one I built from the ground up. I can easily order another chip and program it.

What mode are you using your keyer in when operating on the PC? Currently I’ve programmed mine for WinKey. I have 2 computer keyers. I have a homebrew that uses DTR/RTS. Standard circuit. I have this one that I’ve programmed to do WinKey. I run Linux and use CWType. It can use either keyer. I’m curious if anyone is using the CLI method on their computer. I used it as I was experimenting with this and made a QSO, but my terminal program sends and erads in raw mode so it was cumbersome to use this way. I suppose if I modify my terminal program to send in line mode the keyer would not confuse me so much.

I even debated about interfacing the RTS or DTR method with a digital pin so that if that method was required, for a program that did not support WinKey, it could be used.

I will add a feature tonight to toggle the CLI CW sending behavior between the current way (send characters immediately) and “wait for a carriage return” mode. It shouldn’t be too hard to do as I already have pause sending capability in the send buffer code.

This has no buttons. I built this to be a computer keyer only. It does have paddle input so you could use as stand-alone but you would have no way via the paddle to program the memories. There is no side tone since all my rigs have a ST. but you could not get audio feedback from command mode if you were to somehow invoke it.

I wanted to put a MAX232 on the PCB but there were not enough holes. I have plenty of USB PL2303 to TTL cables so I decide to use TTL as the interface to the device. Since I’m not using a boot loader I have no issues loading the whole code.

I may add male headers that will allow me to use a jumper to go from CLI to WinKey. This would require a code modification and you would have to open up the Hammond enclosure to change modes.

I spent more money and time than if I would have just bought a MasterKeyer but the ROI was education. I can quickly build specific keyers based on the code. In smaller enclosures.

Hi Anthony, I’ve had two reports that my Hellschreiber output is illegible using your keyer. Both were used mid-QSO with experienced Hellschreiber operators. I thought at first it was the capacitor in the keyer circuit, but replacing that with a tiny ceramic made no difference. I’d be happy to help out testing, ‘cos I’ve intrigued several people with the idea of a Hellschreiber keyer.

How are you keying the transmitter? Are you using the sidetone output going into the audio input of the rig (in SSB mode) or using the CW key line with the transmitter in CW mode? I could see where the squarewave output might not play well. Did the people who provided the reception reports take a screen shot of what the received signal looked like?

I’m using the CW key line with the transmitter in CW mode. I got no screen shots from the contacts, but descriptions like slanted, smeared, timing off, and illegible. I had to switch back to Fldigi’s SSB Hellschreiber mode to maintain a conversation. I’ll try a screen shot request next time; there’s a QRO operator in Louisiana with whom I’ve traded screenshots before, and I can ask again.

Sounds like a timing issue. I had to play with the timing a bit to get it to display correctly for me. For some reason the original values I calculated for the code didn’t work. I’m not sure why.

If you fire up your Hell program and use your computer microphone to copy the hellschreiber from the keyer sidetone output, you should be able to see what it looks like and adjust the timing. Change the number in this line in the transmit_hell_pixel function:

Why does WinKey need to do EEPROM writes. I saw a feature to disable that and mine is still disabled. At K4L I ran into an issue where N1MM would not work with ESM on my keyer. With ESM turned on you simply hit enter to send the macros. If you hit F1 to do CQ and get no returns you simply hit ENTER again. On my keyer I had to hit F1. We then installed the K1EL keyer and it worked fine. I’m thinking this has something to do with that feature, but I’m also wondering why it is even required and why it is so darn complicated. Why can’t N1MM simply send macros instead of putting the keyer in some form of state. I am back from St. George Island and need to do some more testing. I’m new at N1MM and do not use it regularly.

Winkey changes some settings that are non-volatile settings, most notably the CW speed. By default the code doesn’t write to EEPROM, but if you enable strict writes it does. I’m not sure why anyone would want to do this, but the option is there. N1MM does a setup routine after initially connecting to the Winkey and each time you send a memory or activate the CW keyboard it sets a few parameters. So there isn’t really much of a need to store any settings when using Winkey.

I’m not sure why N1MM ESM wouldn’t work. I would expect it does the same commands it does for memory sending and CW keyboard (CTRL-K). Can you get a capture of the serial port when doing N1MM ESM?

Do you have ASR (automatic software reset) disabled? I had problems with HRD and ASR activated. Does the keyer send random / errant characters upon connection? That tends to point to ASR screwing things up.

I could replicate Chri’s problem, when ASR is enabled (= default Arduino config)

I noticed that the keyer code would not send back a version number to N1MM during initialization and each macro (no matter if sent via the PC function keys or via ESM mode hitting return) is not terminated by a C0 status byte and therefore N1MM hangs because it is waiting for the transmission to end forever….

As Goody ponted out you need to disable ASR, otherwiese the serial port communication is creating trouble…

I tested ESM mode (with ASR disabled on the Arduino) with N1MM and it works perfectly well with the latest keyer sketch version….

One easy way to disable the hardware based ASR (automatic software reset) is to put a 100-200uF electrolytic cap between the Reset and GND pins. This keeps the voltage up and doesn’t allow the serial port anymore to pull the line briefly down to reset the microcontroller. This way you do not need to cut PCB traces… ;-)

This mod is also essential for using the keyer with other software such as HRD, etc.

Only drawback of disabeling ASR is that when you upload a new modified sketch to the Arduino you need to reset it manually just within a second or so when the RXD/TXD LEDs start to flicker.

I have abandoned using UNO for my keyer. I use the chip, 16mhz rock, caps, and a few other discrete components. My setup does not support ASR. My USB->TTL adapter is only using TX,RX, and GND. There is no way I could reset the keyer when I connect to the port.

ESM works for me but this is what fails.

Hit enter to send F1. This works
Hit enter to send F1 Again. This does not work.

If I replace this keyer with the K1EL WinKeyer USB then the above DOES work. I have not been able tro track down what is causing this behavior. This keyer works fine for CWType. It will not work with CQRLog.

Oscar and Chris, when the problem is present, when the program attempts to connect to Winkey, do you hear a “boop beep” from the keyer? That indicates that it received a connect request and it has initiated the connection. If it doesn’t think the connection is up (no boop-beep), it won’t send the version number or C0 bytes. If you’re having connect problems or it is connecting but you’re still experiencing issues, and serial port capture would help me troubleshoot it.

BTW, I posted updated code. There haven’t been major changes, just little items here and there.

my ESM works as it should with the latest sketch (not the one that Goody just uploaded, but the previous revision). I only need to disable ASR….

If I hit enter, the F1 text is triggered (CQ)
I leave the call sign box empty and hit enter again and CQ is triggered again….
This goes on again and again every time I hit enter……….
When I then type a call signt into the call box and hit enter the call + rst is sent….etc.
(just as the ESM mode should be…)

If your homemade board doesn’t support ASR this clearly can’t be the issue…
I would try to re-program with the newest sketch and do some serial port sniffing if the problem persists.

I suggest to use the Freeware Serial Port Monitor and monitor the data streams. This helps Goody a lot with debugging…

I was able to test N1MM ESM successfully this evening. I haven’t had a serial monitor for awhile as the free trial one I was using ran out of time and disabled itself. So, I fired up a virtual machine running XP and installed the serial port monitor Oscar recommended (unfortunately it won’t run in Windows 7, so I had to get an XP box somehow). Any ESM works fine for me. Looking at the serial port conversation, N1MM sends the same bytes as if you were hitting the keys without ESM.

Hi Goody, *PLEASE* *PLEASE* work with Steve K1EL to incorporate your keyer in his new OpenQRP.org kit. I just finished my Beta kit and it is simply a wonderful rig. *BUT* It really needs the WinKey style keying with features and adjustments that you have created. Please contact Steve and work out some schedule for incorporating your amazing new code in his Arduino.
thank you,
72/73 de Ken N9VV

I’m interested in what you’ve done. Would also like to know where you had your boards made. I laid out a PCB in Eagle CAD, but have not sent them off to be fabricated. I stumbled upon a vendor named ‘Evil Mad Scientist’ that sells proto PCBs for $3/ea. You see an example in the pic I posted of mine. I like their board, but it can get populated fast. On both sides of the chip are areas that you could install an IC. I wanted to install a MAX232 but there was not enough holes. I ended up just using TTL directly. TTL, Serial or USB, it is all the same to me :)

I’ve been thinking about creating a “portable only” version of this keyer. The only issue I can see is that it is not possible to set memories from the paddle. I’ve been thinking about implementing the method the AA0ZZ keyer uses. That keyer goes into a record mode where you have 1s to send a letetr from the paddle. It beeps between those seconds. If you want a space you simply do not send for that byte. To stop recording you hit the command button. Seems to be a good method.

If you want to contact me directly you can look me up on QRZ.com and my email is in my profile.

Not being an EE, and having limited building experience, please allow me to post a question or two and expose my noob-ness :) .

I’m not sure I understand the buttons – from what I can see, they don’t link to any particular analog pin. If I see this correctly, I have a 10k resistor (R7) that links to the 5v rail. On the other side of that resistor (between S1 & R7) I see a linkage to Analog1. The buttons run between the resistor stack (R7-R12) and ground. I can see how AN1 would see how S1 is pushed, but how does the Arduino know if any other buttons are pushed?

Also, I see R7, but do not see Q5 or C7 on the diagram, if I wished to build a PS2 keyboard into the unit.

Do I not have the right schematic? Have there been modifications? (I’m looking at schematic 2011081901)

When pressing a Memory switch they create via R7 + R8 (eventually +R9 + R10, etc.in series) a voltage divider. This means when pressing S2 you get aroun 450mV at AM1, when pressing S3 you get 850mV and S4 you get 1.1V etc. etc.

By frequently reading the AN1 voltage (or equivalent ADC value) you can trigger the corresponding evnts. This is how it is implemented into Goody’s sketch.

Forget about the comments above the PS2 lines in the schematic – its “leftovers”from previous revision, where Q5/C7 still existed…

You have done a remarkable job with your very professional PCB for the Arduino keyer. It is a wonderful combination of the Nano board, your board, and the open source Arduino code.

I would like to design and fabricate an aluminum enclosure for your version of the Arduino keyer and make it available at my cost to the ham community. I’ll publish the CAD files too. Call it open source sheet metal! hi hi I believe that your PCB makes the keyer a very attractive home brew project and a nicely painted and labeled case would be the finishing touch. So, if you are willing to share in the dimensions of your board and the location of parts that must go through the cabinet, I can then design the enclosure and have 50 or so made.

Do you plan on making the PCB itself or the artwork available to the ham community? Are the parts your chose readily available from DigiKey or Mouser, especially parts like the switches and connectors?

No. That would drop the voltage on analog pin 1 and make the Arduino “think” there is a key depressed. R7 + R8, R9… act as a voltage divider. The voltage divider is activated whenever a button is depressed. Each button has a different voltage corresponding to it. This technique is used to “multiplex” multiple buttons on one line, saving lines for other purposes.

Also using the prototype from the youtube video above in the CQ WW CW contest right now as some sort of “real life test”…..works very nice with N1MM logger. Back to the contest now….(only casual style participation). The keyer is real fun, as Joop already points out.

Not yet – still in beta testing phase with a few test builders and already found some potential improvements and bugs in the current PCB REV B, so very soon I would need to make a PCB REV C, hi !
I will keep folks posted here, please be patient with me, as my free time besides my dayjob and family is very limited…

These are compiler warning so maybe I’m supposed to ignore them? Is this normal or am I screwing up? I’m an experienced embedded hardware/software guy with the 8051 and PIC but this is my first time using Arduino. I mean, it’s fairly idiot-proof: set board type (Uno), paste code, compile. Right?

Here is some compiler output showing the crabbing it’s doing:

Keyer.cpp:819:8: warning: extra tokens at end of #endif directive
Keyer.cpp:1015:10: warning: extra tokens at end of #endif directive
Keyer.cpp:2021:10: warning: extra tokens at end of #endif directive
Keyer.cpp:641: warning: only initialized variables can be placed into program memory area
Keyer.cpp:642: warning: only initialized variables can be placed into program memory area
Keyer.cpp:643: warning: only initialized variables can be placed into program memory area
Keyer.cpp:644: warning: only initialized variables can be placed into program memory area
Keyer.cpp:645: warning: only initialized variables can be placed into program memory area
Keyer.cpp:646: warning: only initialized variables can be placed into program memory area
Keyer.cpp: In function ‘void check_memory_repeat()’:
Keyer.cpp:1186: warning: comparison between signed and unsigned integer expressions
Keyer.cpp: In function ‘void loop_element_lengths(float, float, int, byte)’:
Keyer.cpp:2464: warning: comparison between signed and unsigned integer expressions
Keyer.cpp: In function ‘void service_send_buffer()’:
Keyer.cpp:3607: warning: comparison between signed and unsigned integer expressions
Keyer.cpp:3613: warning: comparison between signed and unsigned integer expressions
Keyer.cpp: In function ‘void service_serial_paddle_echo()’:
Keyer.cpp:4892: warning: comparison between signed and unsigned integer expressions
Keyer.cpp: In function ‘byte memory_nonblocking_delay(long int)’:
Keyer.cpp:5639: warning: comparison between signed and unsigned integer expressions
Keyer.cpp: In function ‘void play_memory(int)’:
Keyer.cpp:5881: warning: comparison between signed and unsigned integer expressions
Keyer.cpp:5927: warning: comparison between signed and unsigned integer expressions
Keyer.cpp: In function ‘void program_memory(int)’:
Keyer.cpp:6169: warning: ‘last_element_time’ may be used uninitialized in this function
Keyer.cpp: In function ‘int get_cw_input_from_user()’:
Keyer.cpp:2516: warning: ‘last_element_time’ may be used uninitialized in this function

“warning: extra tokens at end of #endif directive”
is resoned by the macro name that added the “#endif” directive. I.E.
#ifdef NAME
…
#endif NAME <– this is not allowed. Remove NAME that followed the #endif directive.

"warning: comparison between signed and unsigned integer".
A forced type casting should solve that message. The compiler does'nt know what kinda type of Variale (integer or unsigned integer) should be used.

warning: only initialized variables can be placed into program.
The compiler/linker must know how many memory should reserved in ROM section because a variable in ROM code area is not "variable". The compiler and linker will determine the memory consumption of the variable. This is impossible if the variable is declared but not initialized. The start address is known, but the end address of the variable is unknown at compilation time. So this is just a warning. I don#t understand why the copiler response with this warning in this case. I will try to fix them later but does'nt matters further.

The GNU-Compiler don't like uninitialized variables. Most of the messages are resoned by this circumstance, but this is a code cleaning task, not more. N3KG wrote a nice formated and clean code. Many thanks to him to made this avaliable for all.That's not to be taken for granted.

The next version of code I post will take care of most of the compiler warnings. One of these warnings is actually due to a gcc bug, however I’ve implemented a workaround to make the warnings disappear.

My Arduino install must be corrupt. I downloaded and installed the Arduino software again on a clean Windows 2000 virtual machine under VirtualPC 2007 and your sketch compiles perfectly without warnings. Sorry to bother you. (I keep these VirtualPC images just for such testing purposes.)

Now I’m off to see if I can get the circuit to simulate under Proteus VSM.

OK, I have my problem sorted out. It *is* your code throwing all those warnings from the compiler. In Arduino v1.0 go to File–>Preferences, and check the “Show Verbose Output During Compilation”. You’ll see all the compiler warnings the Arduino IDE has been suppressing. In my book, “Non-Verbose Mode” does NOT imply “suppress all pre-processor/compiler/linker warnings”! The IDE has the “Show Verbose Output During Compilation” unchecked by default. (So as not to intimidate the noobs with a bunch of scary compiler output, I suppose.) Anyway, you now know there is minor code clean-up to be done. Thanks for making your project available. I found my clone Duemilanove and will give your Sketch a spin tomorrow on real hardware.

For Farnsworth I basically have two WPM/speed registers rather than the normal one. For sending characters, the Farnworth WPM register is used for timing and for spacing timing the regular WPM register is used. If the Farnsworth WPM register is less than the regular WPM register, Farnsworth mode is disabled. With both timings normal unit ratios apply, and unit timing in mS is WPM/1200.

I love you circuit. I have the arduino duemilanove. I am going to build this circuit myself, just to see how it works on my PC. I also want to start using paddles. This would give me a perfect opportunity to tray this out.

I have a couple questions.

When it comes to resistors 1, 2, 3, 5, and 6, I am assuming these values are in Ohms, not KOhms. Could you please verify?

In regards to Capacitors 1, 2, 3, 4, and 6 are “.01” while C5 is “100”. Could you verify whether they are in milli/micro/nano?

The capacitor types aren’t critical, however typically the 100 uF cap is electrolytic, and the .01 uF caps are disc ceramic. All switches are momentary and normally open. Linear would be a better choice for the pot, though it’s not critical.

Have been using this for about a month on a large breadboard, and I LOVE it!

However, I really want to put this onto a circuit board & into a box…but I lack the skills to do that at this point. Oscar – how is that board working for you? Any possibility of posting the eagle files, or similar?

You can also use a non-iambic single lever paddle with this great keyer. You won’t get the squeeze modes, but single lever paddles work fine too and are a little less error-prone. Check out N0SA’s SL-2 for an excellent paddle. He also has an iambic model. For a kit single lever paddle, look at the American Morse Bushwacker.
73
Steve Silverman
KB3SII

I have finally switched to the analog buttons interface. Voltages look okay, 0.454 with button1 pressed, 0.832 with button2 pressed, etc. However, can’t get any memory messages out of the keyer when pressing a button.

Hello, Joop. You are correct about analog_buttons_number_of_buttons needing to be 5. The other two constants are the values of the button voltage divider resistors in K (kilo ohms). analog_buttons_r1 is the value of R7 in the schematic, and analog_buttons_r2 is the value of the remaining resistors (R8, R9, R10, R11, R12, etc.) The code calculates the voltage values for each button at runtime based on the three settings.

grabbed the newest code and replaced the 4 with a 5. Still a no go. It is weird… I can program memories okay. When using the command button and sending ‘P1’ plus text, I can recall the programmed memory by using the command button and sending ‘1’. Also, pushing the first button and holding it for a while it will say ‘TX1’, second button will say ‘TX2’. So this is correct. However, I can’t use the buttons for recalling the memory content.

Updated code posted. Command mode memory programming wordspace detection was improved and I added a feature to trim trailing spaces. I also updated the page with an explanation of the analog button settings.

Hi Anthony,
I like your code. It is an excellent piece of software. Thank you for sharing with us.
I combine it with an Arduino Pro Mini (very small) and a P3 touch keyer electronic. This gives me a very effective small keyer with a maximum of features at a minimum of investment.
Thank you your great work.
Sincerely
Karl-Heinz

He also started modifying the sketch with some personal improvements and expresses ideas on how the code could be improved to probably result in a smaller compiled size which would allow more features at the same time….(again – just in German on his blog – no English)

Hi dear Oscar,
i have checked up your nanokeyer project and would give you some notice about it. The Keyer code ist a great peace of source – i guess you aggree with me. did some local qso’s and talked about my work around it and some hams would like to get a keyer like this. We found out that your assembly contains not an Arduno-Nano,just the stuff around it .It’s would be a good idea to get some of them an put them preprogrammed into a package. remember, not all the cw operators are familar with microcontroller handling, programmung and got the knowledge of the processes they need to them running. Your keyer kit is a great thing – specialy the opto isolated keyer frontend. This would helpful.
I would prefered to use a single chip instead the arduino-nano – this is cheaper and the advantages of ARDUINO concept is unimportant for a fix application. I also don’t use the USB adapter in my single chip release because an USB–RS232 converter is quite cheaper as an FT232RL implementation and gives me the possibility to use them on both interfaces.
vy 73

I fully agree that the most convenient way would be to deliver already a preprogrammed Arduino Nano together with the keyer parts.

However, the nanoKeyer was designed as an “add-on board” for Arduino nano (in the Arduino nomenclature a socalled “Shield”- just that this one is for Arduino Nano rather than a standard Arduino)

The problem is that if I would offer such preprogrammed Nano’s I would have to prefinance them and import a larger amount from the Chinese manufacturers. While ordering 1-2 Nano’s as a homebrewer you usually can import them duty-free due to the low value. But if I would order Nano’s for e.g. one batch run of keyer kits (lets say 20-30 kits) the total value would trigger importation duties of 20% on top of the import value incl. shipping.

This would make the preprogrammed Nano’s not attractive to the buyer anymore specially if they compare it to the cheap bargain prices the direct importing ham gets on ebay from the flood of Chinese sellers there.

What I rather more consider (already started some thoughts and initial CAD work) is to have the Nano substituted by an on-board ATMEGA 328 (through hole versino – not SMD) and supply a preprogrammed ATMEGA328 instead (with Arduino Bootloader on it too, for future USB updates without the need of a programer)….

Technically speaking you are fully right with the RS232 port suggestion….those RS232-USB converters are so cheap and available as mass ware everywhere that it would make sense.

However, in my dayjob in a leadership sales&marketing position I know how important eye-candy and the consumer expectations are. I think nowadays the users simply expect a new device to have an USB port by default…

The problem is that then you would need to use again a FT232RL design which means SMT soldering, which is also not ideal for the users not familiar with SMT soldering and more comfortable with through hole soldering only.

So you see, no matter what you do you always end up in a Catch 22 situation, hi hi!

Anyway thanks for your comments Tom and I will certainly consider a few things.

Thanks for the translation. I like your memory bank idea, it’s very clever. I’m going to integrate your code into the main code and update the schematic for this as an option, if you don’t mind (I’ll give you credit).

One comment to your blog remark regarding code size optimization:
“This would also help to reduce the core size of the code, so that some more features like Keyboard and WINKEY can be compiled into one sketch.”

It is actually possible to have PS2 Keyboard and Winkeyer at the same time compiled.
For this you need to remove the Serial Command Interface Function.

My used code options with Winkeyer and PS2 (this way you can still command via paddle commands and Winkeyer commands) compiles just to around 28kByte….this just fits into the Atmel328.

While in the field I would not use CLI anyway and while in the shack I prefer the Winkeyer mode, hi!

I have found out a compile problem in String class operations like trim(), toUppercase(), toOwercase() that also touches the keyer source code. The line:” user_entered_callsign = user_entered_callsign.toUpperCase(); ” should convert the content of the string variable user_entered_callsign to uppercase. The compiler response this formula with an “error: no match for ‘operator=’ in… ” error and stops immediate.
A quote : Changing trim(), replace(), toUpperCase(), and toLowerCase() to not return the string after they modify it. This makes it clearer that they operate on the string they’re called on, rather than returning a
new string and leaving the original unchanged. It means that prior code that used these functions will get a compiler error, which I prefer to silently changing the behavior of a program.
Well – change the line just to user_entered_callsign.toUpperCase(); The arduino examples seems not be actually modified to the Arduino V 1.0 environment usage.
vy 73

Tom, thanks for your tips. Ironically, just this morning I stumbled upon the error you mentioned about toUpperCase(). I did more compilation testing and everything should be OK now with Arduino 1.0. Thanks again for your help.

Hajo and Karl-Heinz, thanks for your kind words!

Hello to Joop!

All, I’m working on a schematic to show how to do multiple transmitters using the PTT lines. I’m also working on integrating the button bank feature from Dietmar, DL2SBA.

@K3NG:
In function “void check_ps2_keyboard() ” the compiler response that the variable “keystroke” (defined as char) is to small for an integer 129.

// read the next key
char keystroke = keyboard.read();
Your definition PS2_HOME and the definitions of the keytroke greater that 128 will not fit into a char variable. Just declare them as uint8_t – an unsigned char type.

In addition, i found some semicolon that follow a directive definition – this don't like the compiler too.
as example : #ifnef JOOOUUUPP ; <—— This must be removed.

I am now finished with the portion of your keyer code to use them in an AVRSTUDIO 5.1 and AVR-Studio 6beta. This environment is a little easier in edition and "JTAG" supported debugging, that's now possible.
My processor plateform is now a single ATmega1284p on a prototyping board. Works fine – just the linker of the internal GNU-Compiler of AVR-Studio6 beta is rubbished so i decide me to use winavr 10102010. In Avr-Studio, this is just a simple click to change them.

Gerd, thanks for the tip and code improvement. I wasn’t aware the char type was signed and therefore could only go up to 127 (http://arduino.cc/it/Reference/Char). That’s strange; I’m not sure what purpose a negative number in a char type would serve.

Just a notice around the compiler warning :” warning: only initialized variables can be placed into program memory area”.
This seems to be a Bug in the prototype definition of PROGMEN declaration in the header files of the C++ GNU compiler. I have found some notices about this. The C GNU-Compiler doesn’t matter. The code is still ok, just a warning will be shown at cpp file compilation process. It’s a very old bug that seems remain since 2007 and is not fixed yet. I guess that C++ on an AVR 8-Bit is not often used, so nobody has seen the requirement to do that job.
The implementation of ARDUINO, that’s uses C++ and the extensive usage of them will hopefully change that.

If you like, i would upload the translated manual in german language and your Keyer code that’s now migrated to AVR-Studio 5.x / 6beta and Winavr-20100110 (AVR-Studio 4 comes later, too) for JTAG debugging, ISP-Upload and development without the Arduino environment. I also plan to build a PCB of my version of Keyer hardware for me. If you wanna like to have that, let me know an Email address.

Here is the K3NG software at work….
My latest enclosure prototype in a short video descrition. I used a professional CNC milling service for producing the face and rear plates and combined it with an slightly flatter enclosure than my previous prototype:

@DJ0MY:
Nice keyer, looks pretty.
Did you calculate the estimated costs for complete Kit inclusive Arduino-Board and the enclosure?
I assume that this will be less then MFJ wanna have for there Keyer – that’s not winkey compatible.
That peace of software is amazing and make somthing possible for that you need to pay mutch more, if you wanna buy them on the commercial market.

as you may guess the most expensive parts are the front and rear plates :-)

I had them made by this famous German fabricating house (well known to German hams).
Their face plate CAD design software is easy to use too…http://www.schaeffer-ag.de/

I think total cost “as on the video” is close to 100EUR (out of which 60 EUR is just for the front / rear CNC milled plates !!!)

But still way better then MFJ, hi !

To Hajo:
Yes I will post my next viedo with “full light show” very soon :-)

I am using ultrabright LED’s with high current limiting resistors (depending on the colour they run at 2-6 mA only) to avoid overloading the digital pin maximum rating. Even at this low current they are still extremely bright…perhaps I will even use higher value resistors if the shack is illuminated too much, hi…

Oscar, that nanoKeyer looks really nice: Well Done! Perhaps you should add a little video with all the lights blinking and the Keyer whistling for another cup of coffee ;-)

I will stick to my idea integrating a LCD shield. At at the end of May I will get a Mega and a new shield fom Adafruit: RGB LCD Shield Kit w/ 16×2 Character Display – Only 2 pins used! and 5 buttons integrated. Signals are send via I2C-Bus. So I will have lots of ram and a shield which is less pin-hungry. I already had a look at the libraries and they look good. So there seems to be no development needed to adapt the display.

We will see how far I get and if all works out well we can integrate a db on a smartcard for the call signs ;———–)

And if everything works within this century, Oscar I will give you a call and you are invited to construct an enclosure.

I did this to in an older USBASP programmer with an ATMEGA8 and a few resistors and shottky diodes.
Well, i decide me to use an old school RS232 converter instead to use an USB directly. The reason is, thats’s an RS232 to USB converter is quite cheap and you don’t need to solder SMT devices like the FTDI FT232RL , even this is not a great deal to solder this chip. It’s also possible to get the chip mounted on a breakout board that’s save the MAX2233 on the PCB. However, all the are possible. There are many ways possiible.
The key is the programm memory that’s will be rare, if you don’t use an ATmega 1284p.
vy 73 de Gerd, DD4DA

@K3NG:
I have found some bugs in the winkey support functions. Here the info about the code.
In function void check_serial () find the following expression: for ( byte x = incoming_serial_byte; x–; x > 0)
The compiler response: Warning 25 3rd expression in for has no effect D:\1_AVR-Projekte_keyer\working copy keyercpp\KeyerCPP\keyer.cpp 5887 1 KEYERCPP

The compiler i actualy use is the GCC 3.4.0.65 that is now build-in Atmel AVR-Studio 6 RC. In Adruino environment there is an older WinAVR 20100110 used and they does'nt response any
warnings like this – even thats used in AVR-Studio 6RC, thats alternativly usable. In addition, the compiler stops if a numeric variables are not initialized – well, we discussed them
a couple of weeks before.
It's recommended that local variable declarations are defined in the top of the function instead in expressions.

My PCB design is near finished and will be published quite soon. The feeling of the keyer at operation is great. I have checked them out in combination with a Schurr Profi2 key and an older
HI-MOUNT MK-706 key. The keying feels quit similar as the IDIOM-Press CMOS keyer that's in germany published by ETM (ETM9COG-X3) – my prefered keyer.
vy 73 de Gerd, DD4DA

Hello Gerd. Which version of code are you using? I fixed the issues you mention in the last code version I posted. (Thanks to your advice, I now run my compiler in verbose mode so I see these warnings, unlike before when I just saw fatal errors.)

I just did a bit more testing. It seems to me that the letter space detection is the problem.
If I increase the spacing between P and the number the command gets recognized correctly.

But what follows then is the same problem while programming the message: I need to insert too long letterspacing in order for the CW characters to be recognized. It seems at least to me too long….how about anyone out there?

Could this be related to the wordspacing that you corrected in the previous revision of your code?
I do not remember this problems with letterspace detection (or my CW has become a bit lousy, hi)

today I noticed a small issue in Winkeyer emulation mode when used for serious contesting… :-)

Most contest loggers allow entry of partial callsigns and then it is a common practice by the operator to press e.g. F5 (Call of calling station) + followed by an immediate F7 (?) based on the standard function key messages in N1MM and other loggers……normally this is then sent just as one series of text….

Now your code always waits around 1s after terminating a sent Winkeyer message before it sends the C0 winkeyer status byte back to the logger and therefore the logger waits before sending the F7 (?) text part….this results in a strange/too long break inbetween the two messages…especially at fast contest CW speeds.

Is there a possibility to send the C0 status byte immediatelly after the last cw sign has been keyed without any delay?

Great job you’ve done. Thanks for sharing it with the community. In order to disable the auto-reset, you also can just add a resistor (100-300 ohm) from +5V to RESET and an electrolytic cap (at least 10µF) between GND and RESET.
73,
Yan.

An external /RESET hardware is not needed in this keyer design because the ATmega MPU support POR internaly.The scound method is to use the Brown-Out detection fuse, that’s also power level triggered and resets the mcu if the level is reached that’s programmed in the BOD-Fuse bits.
vy 73 de Gerd

Oscar, thanks for your comment. I knew your design but did not check what you have done before.
By the way, I am not able to have a consistent functioning of the keyer with N1MM in Winkey emulation. The keyer works ok for 5 minutes but then send incoherent code with choppy keying. I have to do more tests but I am disappointed since I hope it would be working easy.

VIN Pin usage in Keyer software design. Take care about the Pin usage !!
The purpose of the VIN Pin is to put the extern stabilized voltage reference into the build-in ADC of MPU. In the case of Arduino-Environment, the developer don’t setup the adc’s voltage reference to internal because in this mode, the intern generated voltage will be available at the VIN Pin of the MPU. The reference voltage level is lower that VCC 5V+. If you put the pin to VCC 5V+ or GND, the internal resistor will failquite soon and the ADC will unusable. There is a notice in the arduino adc support source code that will describe why you should take care about that VIN pin in every design.
vy 73 de Gerd, DD4DA

@K3NG:
Does you plan to use the LCD ?? I am in testing an 24char 2 Lines lcd. The usage of the /RW line of the display to read the busy-flag instead a fix time delay,is recommended. I will put the characters in line 0 out and the did-dash combination in line 1. This looks fun.

I was going to add LCD support but it hasn’t been high on my priority list and no one has really expressed interest in it. An LCD uses a lot of I/O lines. If there are I2C LCD displays, I was thinking one of those might be easier to use and leave I/O lines available for the PS2 keyboard and multiple transmitter lines.

An LCD is quite helpfull in combination of the PS2 Keyboard usage. OK, you need near a full I/O port avaliable to use the classic HD44780 display. But the avalibility of I/O Pins should not be the limit. If you need more that 32kbyte flash memory, you got them because all of the ATmega’s with more that 32 kbyte will ave enought of i/o pins. i.e. m664 or m1284p. I have build one pcb thats support a full configuration and need 78kbyte flash mem.The HELL support consume much of them. If you wanna save some pin’s i can imagine that the 44780 display can used with a8-bit shift register – you need just 3 Pin’s – i don’t prefere this – the cpu load will raise. I will do some test with the lcd stuff and the support routines and will write you my experiences.

Every time i restart the keyer, the keyer speed is set on default speed – even the Poti has moved on different speed. If you move the poti just a tick. the keyer speed is changed to the poti value. Unfortunatly, after a restart of the keyer, you must move the poti to get the tuned speed. To fix’em, it’s just a simple hack.
There are two fixes needs to do. In the Setup() function – the setup defaults will be loaded in a variable called wpm. wpm = initial_speed_wpm // setup current wpm to default wpm
This load the startup speed with the previously defined speed instead reading the poti value if this feature is enabled and activated.
I replaced the line with:

Thanks for the tips, Gerd. I will incorporate into the next update which should be in a few days. I’m working on K1EL Winkey 2 support and I also have multiple TX lines in the code now. Instead of having to multiplex the one TX key line with the multiple PTT lines for multiple transmitters, you can have up to six TX key lines and the PTT lines can be totally disabled if they are not needed.

I think after this update I’m going to look into I2C LCD functionality.

The LCD support library of arduino is limited so i decide me to move to the lcd support libraries from peter flury. That’s just need to move to c++ / Arduino. The reason is that this routines are not reentrant.
If you wanna support I2C, try to use the TWI instead bitbang routines that ARDUNIO uses. An alternative for serial hd44780 support ist using an 8bit shift register. Check em out here: http://embedded-lab.com/blog/?p=30 . An Arduino support is written quite fast.Using SPI capabilities needs just some tests.

Updated code posted. K1EL Winkey 2 is now supported and multiple transmitter keying lines can be defined. You no longer need to use PTT lines for multiple transmitters, they are totally optional. I also incorporated DL2SBA’s banked memory button code. Sorry, Gerd, I didn’t get your potentiometer fixes in yet.

NanoKeyer users, note that you can use the PTT output as a second TX output if you like. Oscar, DJ0MY, has tested SO2R with the N1MM program successfully.

Hi,
I have only one Arduino Nano 3.0.
I will do further testing unplugging the Arduino from the breadboard.
I had tested commenting the software options so to leave the minimum but it was unsuccessful…

I had the same problem. It was kind of a hardware problem. The Arduino can only load round about 28 Kb of code. Try to comment some code so that you get under the magic number. At least it worked for me. And that was one of the reasons I still consider using the cw-keyer with the LCD-Shield with a Mega-Arduino.
My Adafuit shield arrived today. I will assemble it and give it a try with the Arduino Uno. I will report.

Last night I worked the contest casually using N1MM and the keyer in Winkey mode. It’s working quite well. I discovered one minor bug at startup if you don’t have the potentiometer feature activated. The logging program will have the wrong speed reported to it on start up, however the speed can be set by the program after that. I’ll have an update posted soon.

I have worked a couple of hours in WPX with the keyer in Winkey mode and N1MM logger. This works great – it was’nt required to use the backup keyer Winkey2. I will now move them into an enclosure for final using. I decide me to use the MCP23017 based LCD and Keys later. My 4bit interfaced LCD works pretty nice and i got a bunch of I/O pin’s left for options. I got some experiences with the IIC-Expander – i use 2 of them in my remote symmetric antenna coupler to switch the L,C and low/hi-Pass filter mode.
The MCP23017 is just a little bit tricky in programming but works great if the programmin work is done.
Is a schematic of the I2C-Display available ? Does they use 8 Bit or the 4 Bit Display mode? I/O Pins should not be problem – it’s support 1 x 16Bit or 2x8Bit Bank of I/O pins.
@K3NG: can you imagine to move the source code to sourceforge SVN system ?

I created a SourceForge project for code here: https://sourceforge.net/projects/k3ngarduinocwke/files/ . I’m not doing SVN yet; I just dropped the latest ino file up there. I have to admit I don’t have any experience with source code systems and need to do some research and educate myself. Any recommendations for clients would be appreciated.

@k3ng
Did you already try to connect the cw-keyer with the RGB-shield on an UNO or did you switch to the Mega Arduino. I tried it several times but without success. Compiling was not the problem but the upload was not possible due to the 28 KB restriction.
73 de Hajo

I have it connected to an Uno and it is working quite well. I have the display integrated with the command buttons and the PS2 keyboard functionality. If you go up on SourceForge ( https://sourceforge.net/projects/k3ngarduinocwke/files/ ) you’ll see a directory called “in development”. I dropped the latest code in there. I hope to get the documentation updated today or tomorrow with how to compile the LCD functionality, but for people like you who already know the code, it’s pretty easy.

You are correct about the RGB shield code taking a lot of memory. With the PS2 keyboard and RGB display libraries compiled in, I’m up to the limit of an Uno (with the standard boot loader).

Note that this code supports both the I2C RGB LCD and a standard LCD display in 4 bit mode.

I am using Atmel Visual Studio 6.0 and when I “Build” the solution, I get an error “EEPROM.h : No such file or directory.” Where can I find this file and other include files that I may need. I’m using the Arduino Duemilanova with Atmel 328P.

I’m not familiar with Atmel Visual Studio, but eeprom.h and the other standard libraries are included in the Arduino IDE directory structure (i.e. \arduino-1.0.1\libraries\EEPROM\ ). You can download the Arduino software here: http://arduino.cc/en/Main/Software .

I have ported the actual version to Visual-Studio6 and the entire project is available at ” http://sourceforge.net/projects/k3ngkeyer4as6/files/Sourcecode“.
To compile the project successfully, the WinAVR-20100110 toolchain must be installed.
Atmel uses a newer Compiler Toolchain as Arduino. All flash memory access macros are removed in the newer toolchain. This is not a great deal – just install the winavr and select the alternative compiler toolchain in the project properties. The winrar-archive that i uploaded at sourceforge predefined to use winavr instead AVR-Studio6 Toolchain. I had no warnings at compilation time. The code works great.

With this IDE, it’s possible to do a on-chip-debug. You can see what’s going on in the variables, registers, timers, IRQ’s and more. You need a cheap AVR-DRAGON or an AVR-JTAG-ICE3.Don’t use a clone of them. They often got problems and a protection for the hardware is missing. Check-out the MCU’s you wanna use and decide what kinda debugger u need. Bye the way, AVR-JTAG-MK1 does’nt support most of the modern MCU’s and is not supported by AVR-STUDIO 5 and newer.
Developing with an OCD-Feature is a different world like “printf(….)” or ever. IT’s in-system and realtime.Manipulation variables, memory, registers are possible at runtime.
I don’t wanna missing them.
vy 73 de DD4DA, Gerd

I guess that you must change the used MCU in the Project properties if you are using a different MCU as ATmega1284p – that i have pre-defined in the project file. In addition, the I/O Pins have to be changed to your Pin-mapping in the source file header, of course. And at last, the file pins_adruino.h must exchanged to the similar named file from arduino project, who support your MCU.The used pin-mapping is further descripted in the pdf-file.
I decide me to write a handout how to change the mcu in the AVR-Studio6 environment. There are some small steps to do, but a compilation of them would be made this job to 20 secound task.
I do the project file to the svn system today. It’s easier to handle updates.

I have uploaded the stuff for ATmega2560, ATmega1284p, ATmega664p. Thats tested, others are possible. I have added the new ARDUNIO 1.0.1 support files and hardware driver too.
The ATmega328P needs just a different pinout description file “pins_adruino.h”. Don’t forget to change the device in AVR-Studio6 project properties.
I have not tested the I2C-Bus support routines, need to spend more time to do that. It’s also possible to use a hombrewed LCD with the MCP23017 and HD44780 – isn’t a mysterious, just a simple task.
The RGB-LCD files are missing yet. If the I2C-Bus support is enabled, take care about the TWI-lines of the MCU. THis schould be not used otherwise, if the driver support is activated.!!!!

Arduino have limited support of everything. They use the GNU-Toolchain similar as AVR-Studio. I have added a 3party mapping file who supports the 2560. That’s the reason why you need to replace the mapping file to get the support of that kinda mcu. In normal circumstance, it’s enought to change the device in the Project properies. Ardunio developers decided that they uses just one file to map the mcu / Hardware platform. They does’nt resolve the macros of used mcu so you must replace the mapping file.
In Arduino environment, you need to somthing more if you wanna use a different hardware as they promote. I use a naked ATmega1284p for my keyer. This is not supported directly by Arduino.
You don’t have to do much more that just download the project from sourceforge and compile them.
I have predefined all you need. Just set the Pin-Out for your Pin’s – i don’t know what PIN you use for.vy 73 de DD4DA

I have the MarkII and it’s always worked great for me. I’ve tried direct USB to the Arduino and I always got an error message. And, no one seems to have the answer for the error message, so, I’ll stick with the AVRISP MarkII.

Hey Goody – Just a belated note to say thanks for all your outstanding work on this great code. I’ve homebrewed 2 standalone keyers thus far and both work flawlessly. Using barebones ATMega 328’s on both with PS2 and command line functions enabled and my K8RA non-iambic paddle – I’m in smooth CW heaven.

I’m currently using version 2011100601 & the only issue I had was the keyer beep-booping 3 times at power-up on its own and clearing memory which I note that you’ve fixed in more recent code. I figured it was related to timing around the paddle bypass caps & just remarked out the related reset code as a workaround on the earlier version.

The 1st keyer is dedicated to my homebrew CW station & includes a 2nd 2n7000 keyed output to drive a pin diode QSK box & I use a PTT line with lead & tails adjusted for receiver mute. The 2nd keyer includes a neat grid-block keying circuit – designed by Art Boyars K3KU – which works flawlessly with my Drake 4-line BoatAnchor setup. I use an APS-92 PNP (cheap on ebay) & it’s good to -200V or more.

And finally – I’m REAL anxious to see what you come up with on your Arduino antenna tuner. This has been high on my list for years and what you’ve got under development looks terrific.

Hi Bob. Thanks for your kind words. Sorry about that bug that involved the bypass caps. Although I’ve always had these caps on the schematics, my test jig unit didn’t have them until recently. I hope others didn’t get bit by this bug. But I digress. The tuner is a very challenging project. I haven’t seen anyone publish a relay-switched unit like this yet. I’m working on the relay board as we speak. The I2C I/O expander code has been written and tested. I’m really eager to get to the actual tuning logic as I think there could be multiple tuning strategies and a lot of potential for optimizing the tuning code to reduce tune times. I’m probably going to have to build a test jig with various impedance loads to test and benchmark tune times. It’s going to be fun.

But back to the keyer, last night I wrote a subroutine for CW decoding and it’s working nearly perfectly with machine-generated CW (I have one keyer going into another to test). I want to test with sloppy straightkey generated code tonight. I have some ideas for the circuitry to convert analog receiver audio into the digital logic levels the keyer input needs. I should have some beta code up in the development folder tonight if anyone is interested in playing with it.

The relay switched tuner is finished since a couple of week. I also used two atmega’s to control them and network cable to link the remote controller and switch controller for the relay’s. The I/O unit for relay switching is linked to an ATmega88 using I2C-Bus and MCP23017. The ULN2803 will do the switching job. Each of the relays are sepperatly controlled – (symetric tuner) so it’s possible to adjust the balance on the feedline of the antenna.
The Tuner is based on a german unit called “christian Koppler” developed by dl3lac – a very popular unit, published a couple of years ago.
i have modifies the controller part and use RS422 instead 24 lines (awg14 wire) controller cable, to link both controller. My antenna tuner is capable to handle 1000W-PEP and actually, the G5RV 10m-80m is used with them. The limitation in power resistance are just the “C’s” and Relays. The firmware is written in AVR-Studio and actually, i will move the project from “C” to “C++” Language.
I am looking for a pair of roller “L” and vac-“C”‘s for build a symetric antenna tuner that’s robust to handle 2KW PEP. Switching relays are to expensive in this range of power and voltage.
At the weekend, i will upload the complete project with source and PCB to sourceforge too.
At “http://www.dc4jg.de/html/sym_koppler.html” you can see what i talking about.

I stumbled across your July 4 post about the keyers. You mention using the (ill-named) K3KU circuit for grid-block keying your Drake 4-Line. (That’s the rig I was using when I “invented” the circuit.) Did you realize that the circuit will also key your +12V rig, with no modification? That’s it’s beauty. 73, Art K3KU artboyars@gmail.com

I’m using the MCP23008. I like that ULN2803 chip for driving the relays. Thanks for the design idea.

I hadn’t thought about the possibility of doing asymmetrical tuning. Does your unit have current sensors on the two balanced line conductors? I thought of putting current sensors just to measure the current for fun.

I decided me to use an MCP23017 and ULN2803 for driving relays, because the other good available chip was an Phillips PCF8574(A) who’s drive current limit was 1mA each line.This is less than you need for just one LED. The ULN has a limit at 500mA each line, if you switch to GND (low-side). This should be enought fór 24V relay’s that i would recommend you to use. You must know that the Hi-Pass/Low-Pass switch needs min 4 relay’s and 2 needs to switch as tandem. You get a little bit more that the doubled current that’s needed to swich and “HOLD” a longer time.
If the antenna tuner is switched off, the relay’s should be release to bye-pass the load to the feeder line.
The problem that i have not solved is the tranformer who balanced and phase shift (180°) for the symmetric L-C lines. The available core materials does’nt works optimal from1.8Mhz to 30Mhz. I belive that the Guanella-BaLun is the best solution to do that job, but i did’nt checked them out, yet.
Mabye, i can imagine a construction of two balun tranformers – one for the lower bands, one for the higher bands. This is a project until the summer.

Hi guys,
I could use a little help, please. I went through and compiled code rev ‘2012070201″ (w/Arduino 1.01) in several stages, progressively toward the feature set I wanted. First as downloaded – compiled fine. Second, I changed several values to get to my personal preferences (sidetone freq, etc – nothing major) – it compiled fine. Third, I tried to enable the PS2 keyboard (created sub-directory [PS2Keyboard] in my sketchbook directory, un-commented the include stmt, #define FEATURE_PS2_KEYBOARD, and PS2Keyboard keyboard; etc) when I try to compile this, it halts on the last stmt (PS2Keyboard keyboard;) and says:” ‘PS2Keyboard’ does not name a type”.
I have rechecked several times to make sure I have all the steps correct but its pretty simple (famous last words!). what else do I need to do or what have I done wrong?? All I’m trying to do at this stage is enable the PS2 KeyBD. Thanks!
Archie KX5X

Yes, I uncommented 4 stterments including the ‘#include’, I then created the PS2Keyboard subdir in the sketch directory and copied files into it. Does it go here or ‘up one level’?
I tried to follow your instructions, then I did a search on PS2Keyboard to see if I missed anything.

OK, its morning, I’m fresh – – –
I checked a bunch of things. I had a mess, trying to find where the compiler wanted my (your) library, I scrambled things good! Its simple, put it in the “Libraries” directory in the Arduino install and it shows up in the sketch pull down for “import library”. Might find it elsewhere but this is where I put it.

I ‘UNcommented 3 lines:
#include (actually I imported the library to make sure it would find it)
#define FEATURE_PS2_KEYBOARD
PS2Keyboard keyboard;

I compiled the sketch:
it made it down into the “check_ps2_keyboard()” subroutine to line 1343:

—> case PS2_SCROLL : // Prosign next two characters

and reported the error:
“duplicate case value”

Maybe I don’t need the PS2 keyboard option (:-(

Thoughts?? (I’m still guessing its my setup – I compiled the “simple_test” sketch in the examples for the PS2keyboard library to verify that the library I had compiled. It compiled fine.)

Is this project in CLI mode or Winkey emulation, suited to connection by a physical RS232 port, and at what speed(s). I have a facility for delivering RS232 ports to the remote radio site, independent of a computer at that site.

Hello Owen. You have several options. If you are using an Uno or Nano or similar Arduino unit, you can compile either the K1EL Winkey emulation or the CLI, but not both simultaneously due to memory limitations in these model Arduinos. If you have an Arduino with a larger memory footprint (i.e. the Mega), you can compile and upload both the K1EL Winkey emulation and the CLI into the unit. You can then switch between the two modes at boot up (power on or reset). If you have #define OPTION_SERIAL_PORT_DEFAULT_WINKEY_EMULATION uncommented, the unit will default to K1EL Winkey emulation upon reset and if you hold the command button at power up it will switch to CLI mode. If you comment out this define, the behavior will be reversed.

If you would like two RS232 ports, one operating K1EL Winkey and the other operating CLI, I can work on that feature. The second port would be software based and would be on normal pins at 0/+5V levels and not true RS232 voltage levels. You could easily convert this with transistors or a TTL-to-USB chip or module that is readily available from several sources.

The CLI port speed is configured with this line: #define default_serial_baud_rate 115200

In K1EL Winkey mode the keyer complies with the K1EL standard by starting up in 1200 baud. If the client invokes Winkey 2 mode, the keyer switches to 9600 baud. These speeds can obviously be changed in code, but the client program needs to be able to switch port speed as well, however if you needed some special baud rate I’m sure with back-to-back Arduinos acting as baud converters we could make anything work. Let me know if you need anything special for your remote radio site project. I like coding new features and I find remote control and remote site stuff interesting.

I was not thinking of trying to use both CLI and Winkey in parallel through separate ports, one or the other is fine and the flexibility to offer to change the power on default at boot up is quite adequate for my purposes.

I am not very Arduino savvy… but quite experienced in AVR, so excuse the questions…

So, ‘out of the box’ this will run on the larger Arduinos (I have a Arduino clone with a Atmega168 and a TTL serial port). I expect to adapt the TTL serial to the RS232 interface, I assume it uses only TxD and RxD.

I should also have a Pro 328 somewhere if it needs more memory, or I may have a 328 chip to put on the MHV clone board.

1200/9600 is fine. The ports are delivered by a TS4 four port Ethernet terminal server. Concept is one port to control the TS2000, another port to feed the keyer. My expectation here is that the keyer provides perfectly formed Morse code, less affected by network jitter than sending dits and dahs across the network.

I have downloaded the keyer distribution, and it failed compile… I need to chase down some libraries.

As far as I’m aware the Arduino code and hardware supplies only TxD and RxD. Unfortunately I’m not experienced in the AVR environment, but I can tell this is something I should explore in the future.

I think this keyer will work well for your application. As you surmise, it will send good CW regardless of network jitter. At 1200 baud it works flawlessly, however it should be noted that HRD has some minor bugs in the Winkey GUI. I’ve used the keyer with N1MM quite a bit with no problem.

If you’re primarily interested in interfacing with existing logging and contest software, K1EL Winkey emulation is the obvious choice. However, the CLI has more flexibility and is more extensible as it isn’t encumbered by the Winkey standard. But awhile ago I started to code an extension to the Winkey emulation where you could send a $ sign as an “escape” and send commands to the keyer. This could be used for controlling digital lines to control relays and do other things that the Winkey protocol wasn’t intended to do. Let me know if you have any interest in that.

It’s not an advantage to sepperate the CLI and WINKEY interface. You have more cables and more hardware that makes the keyer not cheaper and the wiring more complex. I like the On-Boot-Reset decision – Winkey or CLI. You should remember – this is a keyer electronic to doing morse code, not a general purpose MCU-Board that know’s morse code. This schould it be. Mybe expand the command set of Winkey to switch back to cli and extend the cli to switch to WINKEY – but, i don’t think that this is useful.

Well, I have loaded a Sparkfun Arduino Pro 328P with either CLI or Winkeyer2 successfully. I have talked to the CLI from a serial prog, and tried the Winkeyer2 with DM780 and it seemed to work fine (KEY and PTT).

I am thinking that the production version might be more reliable without the bootloader, so in looking for proto boards that have the ISP connector, the one I have used looks good, or Sparkfun’s Mega Pro 5V/16MHz.

I have ordered a little RS232-TTL interface from Chine, about $4 I think, and it will wire in place of the USB/Serial module I am currently using to talk to the board.

Anthony, this looks a very practical functional replacement for the Winkeyer RS232.

Yes, a great opportunity for some additional bitswitching of relays etc… but as you say, that has to be built into the client software and commercial interests might impede that. Perhaps we need a Good protocol OM!!!

I used a native ATmega1284p and a MAx232 for Winkey purposes. If USB is avalable only, that’s a job for a simple converter. This is cheaper than a single FTDI chip. I addition, i have replaced the PTT an keying transistors with a quad Opto-coupler like TIL196. The other parts are just socket for Plugs. It’s not required to buid a printed pcb. The used 1284p comes in DIP40. vy 73 de DD4DA, Gerd

Indeed Gerd, another option I am considering for this reduced function set (RS232/Winkeyer2/PTT+KEY) is to put a regulator, MAX232, Atmega328P and a couple of 2n7000 FETs as PTT and KEY switches, all on a piece of veroboard. I nearly did it this morning, but I couldn’t find any MAX232 in stock.

@DL2SBA: Why the complete code is in just one file instead in more, ask k3ng – in english, of cource. I agree in the point of float variable usage. The ATMega is not the best choice for floating point usage. The library is quite big. To convert the float routine into a an integer is just a job that’s needed to do. K3NG has release the source code. This makes it possible to to the job – just do it and send it him. The advantage will be in saving programm memory for optional hardware support that’s fit in smaller arduino’s.
IT’s not helpfull to publish your questions about the keyer software on YOUR webpage and in german language. Just do it here – nobody will blame you.
vy 73 de DD4DA, Gerd

its time for a new video. I just returned from EA6 (Mallorca Island) summer holidays were I participated in the IOTA 2012 contest in Mixed mode QRP for 4h with my backpack station. The CW keying was done with N1MM logger and an Arduino Nano running Goody’s code (ultralight travel version on a perfo-board, hi hi)… Enjoy…

Anthony, I am thinking of using an 18.432MHz crystal. This suits high RS232 speeds down to the ground, do you foresee any issues with the Morse code side (provided of course that I create the appropriate board definition in the Arduino IDE?

Hi I have an urgent problem. The keyer version K3NG_Arduino_Keyer_2012090501.ino works OK in Ham Radio Deluxe it seems. The board is an Arduino UNO. However in N1MM it sounds like it is reset. It sends “hi” several times when N1MM is started. It suddenly says “winkey not detected” even if I can send to it. Some times it sounds like it resets because it suddenly says “hi”. Do you know what can cause this? I need it for a dxpedition so its urgent. Hope you can help if you have experiences something similar.

Hi Mike. Do you have OPTION_WATCHDOG_TIMER activated? If so, deactivate it in the code and recompile. Do you have the Arduino Automatic Software Reset disabled (which is done by cutting a trace on the Uno PC board)? I highly recommend doing that. Does it make a difference if you deactivate Winkey 2 support( OPTION_WINKEY_2_SUPPORT )?

Hi. I tried to turn off watchdog went back to Winkey 1 mode, turned off boot message, turned on the “Winkey TAB bug workaround”, turned on the “discard bytes at startup”. This seemed to fix it. I think the problem was that N1MM didnt get proper feedback after message was finished. I still get some “hi” “hi” messages when I first starts N1MM but thats problably due to the handshake lines toggling. Here are my options (sorry for positing long info here):

If you’re getting multiple HIs when N1MM starts up and if you have ASR enabled on the Uno (the default configuration), I think you’re right about the handshaking lines. I found interfacing in general works better if you disable ASR. The “disable bytes at startup” was a bit of a hack, and as I mention in the documentation, you may have to play with the number of bytes that are discarded to get reliable operation. Having a serial sniffer greatly helps, though you have to dig into the Winkey protocol a bit to know what’s going on. One of these days I may write up some documentation on this, but disabling ASR cures a lot of USB port ills.

I loaded up the latest version of N1MM and I’m not experiencing any issues. I have it running on a repeating CQ and messed around with CTRL-T and CTRL-K a bit and can’t reproduce the issue, so I don’t think an N1MM code update is the cause.

Just to rule another item out, I would try powering the Uno from the coaxial connector. This shouldn’t be an issue because you note that HRD works fine, but stranger things have happened. :-)

Hi, disregard the above. I fooled myself. It didn’t work after all. I run N1MM V12.9.2. I have this version that i grabbed from the sourceforge rep : K3NG_Arduino_Keyer_2012090501 – There is a cw message sent but the red tx lamp in N1MM fails to come off after pressing F1 (CQ) and the cw message has been transmitted to the end. The red tx “lamp” stays on for ever until i press ESC. After I press ESC the keyer is able to take commands again. It seems like the keyer is not notifying N1MM that it has finished transmitting? Would you be able to send the code you have that works?

what you describe are exactly the symtomps you get, when ASR is not disabled (I know this from my very own experience very well)…I have this problem occasionally when I forget to disable ASR in my nanoKeyer (the nanoKeyer uses an external Jumper to conveniently switch ASR on/off)

If you do not like to cut traces as Goddy suggests alternatively you can put a 10uF electrolytic cap between the Reset pin and GND. This will keep the reset line on logic high level and avoid the resetting via the serial port (aka ASR).

This is a fairly easy mod. But do not forget to remove the cap again before you upload the next sketch…since the Arduino will not automatically enter the bootloader anymore with ASR disabled.

By the way what is “ASR” and how do I turn it off? I would like to not do hardware mods as I use the board for other things and I dont have access to the reset button. (I have built it into a small chassis already … :) )

Search for “Automatic Software Reset” on this page and you’ll find the section on it above. Follow the link and you can read what it does. Cutting the trace labeled RESET-EN disables ASR. You could put a reset button on the chassis. I’ll email you a configured code file, but again, ASR is likely the problem.

the ASR issue is not specific for the UNO. It is a general problem on all standard Arduino designs.
For convenience (programming) reasons they all have the ASR feature built in.

Switching to the Mini Pro will make your unit smaller, but not fix automatically the ASR problem.

As soon as you connect the Mini Pro with a serial port (e.g. direclty to a RS232 COM port or via the external FTDI Interface) you will have the ASR functionality back again, which you need to disable in order to run the keyer in conjunction with an contest logger such as N1MM via Winkeyer mode.
As written above – simplest solution is to put a 10uF cap across RST and GND pins…
73 de Oscar DJ0MY

the extruded aluminum enclosure I use for my nanoKeyer prototypes (the photos on my website) are made by a german manufacturer called Fischer Elektronik (a manufacturer of heat sinks and enclosures).The dimensions are such as to fit exactly an 10x10cm PCB inside. It is basically a shortened version of the typical standard Packet Radio TNC enclosures of the good old times when packet was still popular (most TNCs were based on 10x16cm PCB’s or aka Euro-Size PCB).

I saw that there is one model from Hammond Manufacturing in the USA that comes very close, but is a bit longer, so that eventually the front LED leads as well as potentiometer axis may need to be extended.

I once found on the internet a enclosure for 10x10cm PCBs (I think outer dimensions are then 4.06 x 4.06 Inch roughly). But the company doesnt seem to be in bsiness anymore or at least the website looked very old.

Has anyone had issues with their arduino (nano, in the nanokeyer kit from Oscar) locking up? I have a replicable lockup occurring when I change the sidetone frequency either above or below a certain amount.

I will be bringing this in to load a new version of the code onto it, but wanted to see if anyone’d run into this issue.

Never changed the sidetone in my keyer, since I mostly have it disabled anyway and listen to the radios own side tone…thats why I never experienced this behaviour.
Since you say it is replicable – can you tell at which sidetone frequency it starts to hang?

I’m not able to reproduce the bug with my Nanokeyer, however I may not be doing exactly the same steps or have the same features compiled. If you send me a more detailed process and a copy-and-paste of your features and options, I’ll see if I can reproduce it.

It most likely cannot be an ASR issue, because Owen’s board (according to the website schematic) does not make use of ASR feature. It is all manual reset.
So I assume the bootloader is activated manually and not via the RS232 port automatically, right?

I wrote a little script in EZGPIB to send 0x00 0x04 ‘Z’ to the keyer. It echos fine on real COM1, EZGPIB cannot open the Portserver port,

I tried the same script on a FTDI port on COM28 and it worked fine.

So, it looks like the Portserver ports are not 100% compatible. Whilst HRD uses such a port for rig control just fine, DM780 doesn’t work properly on the same port (though it doesn’t complain about problems opening the port… just the log shows no response to the sent messages).

I have tried a DOS command line to send the echo prompt to the keyer, (\bin\echo -ne 015015000004Z >\\.\com20). This elicits a response from the FTDI port connected keyer, but not from the Portserver one. The Portserver looks deficient.

BTW, not an ASR issue, and I do have a removable shunt on the board to disable ASR.

In order to accomodate the growth in interest, I am moving support for all my projects and all discussions to this Yahoo Group: http://groups.yahoo.com/group/radioartisan/ . The comments areas on the blog here will be disabled shortly. Thanks everyone for your support. 73 Goody

Hi Jordi. Unfortunately I can’t definitely answer your question as I don’t have a Due (yet), however I think it’s supposed to be code compatible with the Uno. Just a note – I’ve moved support and discussions to this Yahoo group: http://groups.yahoo.com/group/radioartisan/ . You may want to join over there and post your question. 73 Goody

The code could’nt run on an ARM based MPU like Cortex M3. The destinated platform is ATMEGA MPU based and need the ARDUNIO C++ derivated IDE. I could not see a quick way to port them.
In addition, that’s would be a waste of a nice and fast MPU.
MPU’s like ATMega32 and up will work fine.

Hiya Jordi,
well, you mean the Arduino Due board that uses a Cortex-M3 MPU instead an ATMEGA derivate. Well, i get this board in january and waiting for the ordered J-LINK Debugger. If this is arrived, i will take a look whats going on. The Arduino IDE for Cotrex-M3 is in alpha stadium. The Adruino mapping code is’nt finished and it looks like, that the maintainer try to build them like the Atmega IDE. If, and how the code will be portable or not, i can’t confirm or deny them. The code of an ATMEGA looks quite different compared by an ARM Code and the the CPU’s works different too. If a code is abstract enought, this should work. Most of them will be impossible because the ARM is quite faster and all routines that need timed loops or counting loops to waste time, will not work properly. Why you wanna use Arduino for your ARM? The most code you need is available for Cortex-M3, because this is a very popular MPU worldwide. I will use the GNU-CPP compiler Toolchain for the ARM MPU too. Look to Keil or the Open Suurce IDE’s like Eclipse. You got all you need.

K3NG-Keyer in ATMEL-STUDIO 6.
I have uploaded the actually keyer source package with some minor fixes in the ps2keyboard interrupt code. I also fixed some minor bugs in Arduino 1.03 support code that handles the static strings in program flash. This is more a problem of the obsolete macro usage of Arduino IDE as the K3NG keyer code. Some minor fixes in the general enummeration of Pin-mapping code are included that be related by usage the ATMega1284P and ATMega664P processors. Some major design related bugs are still remain in the Arduino support code that will be fixed in the next few days. I will attempt to get in contact to th maintainer of Arduino IDE to get the fixed for all users. For all who uses the external INT0 or INT1 line, keep sense about the Falling/Raising edge who sould be triggered. This seems to be not work proper this time. This is reasoned by the older WINAVR Toolchain who is used by Ardunino. This is also used by the PS2Keaboard.Cpp (and h) file in the keyer Project.
vy 73 de Gerhard, DD4DA

Hi Gerhard, (DD4DA)
Excuse me for the delay in replay, I have been out, and many thanks for the information.
I have received my Due and I have tested some elemental programs and with the the Arduino libraries for easy code works OK, an other think is if you want to use other libraries. I’m playing with a freescale K60 cube and I have curiosity to see how the arduino due work. I’m an “old” electronic engineer that begins to play programing MCU and I would like to adapt the K3NG keying program to set the options by means of a touch screen LCD like the freescale cube unit. and other thing that I wan to do is add the hardware to key by , screen, cathode, or greed blocking I have drawn the schematic 2 years ago but I have been very busy and I have not finished the PCB.

Hiya dear Jordi,
congrads that youre doing the first steps with an K60-100? /120 ? Cube. This are ARM based Cortex-M4 MCU’s and this is running at 100Mhz clock. To port the Keyer on this hardware will not work without extensible modifications – they all reasoned by the timing and differents of variable Typ’s. The Arduino Environment will not help to solve all this hints you will get. In addition, i could not seen the advantage to use a 100Mhz MPU in a CW-Keyer. This MCU has power enought to drive an SDR with an 4096 Point FFT (or more).
For experimentals with MCU’s, i use the RealView ULINK2 JTAG Interface and the KEIL µVision 4 IDE with the GNU-ARM MDK Toolchain. All This works pretty nice. I use an ST SM32F4-Discovery Cortex-M Development Kit that quite cheap and fast. ($15.-) My experiences with the Arduino IDE is more bad as i expected before.
This is reasoned by the beta State of the ARM support of Ardunio. The Toolchain (GNU-CPP) is a litte bit older as the ARM-MDK from KEIL or ATMEL. Try to do some experiments with the Keil kit and send me your EMAIL address. I have some extensions for the KEIL IDE available, that will helps you at the beginning with the ARM Cortex MCU’s.
To get my EMAIL just look at qrz.com.
vy 73 de Gerhard, DD4DA

This is such a great project thanks so much. I was just getting ready to write keyed code for my Arduino when I found this project and it is 20 times more than I wanted… but now I want all of it. Thanks again

Great project Thank You.
I made it on ATMEGA evaluation board using ported software on Atmel Studio 6 on ATMEGA1284P processor, wth all the functions included.
Currently i am working on final hardware implementation: LCD display, PS2 Keyboard, USB connections, 9 memory buttons, 4 transmitters, for each separate kay and PTT output isolated by photomos relays.
I have just completed PCB’s design using Eagle.
Testing keyer on evaluation board I found some areas that could be better:
1. For multi Tx implementation it would be nice to have PTT / key delays timers set up independantly for each transmitter and possible to be changed by kayer commands. Currently key / ptt delays can be set only during compliation and are common for each transmitter.
I plan to connect IC-7000 (No delays needed), FT290RII ( just short delay) and…. Uniden 2020 (100ms leading and another 100ms trailing delay neccesary). Impossible to find compromise values for this set of radios.
2. Great feature is to entar macro into macro, however only first macro is transmitted. I.e: \p1 SP5IOU , \p2 CQ CQ DE \1 \1 \1 PSE K.
When I invoke memory 2 it will transmit: CQ CQ DE SP5IOU
Remaining content of memory 2 will not be transmitted.
3. When Autospace is ON, LCD displays kayed characters only when spaces between characters are long enough, even longer than just character space. Text is transmitted correctly, but not displayed or partially displayed on LCD display. When autospace is off – text is displayed correctly.
4. I prepared hardware to be possible to adjust LCD contrast and LCD light LED adjusted using commands, but it is not implemented in software. It would be nioce to have it controlled by PWM’s.

There just features mentioned as nice to have. But software is great and ready to use. I didn’t find anything better.
Great feature is K1EL Winkey emulation. I tried it with Ham Radio Deluxe – works fine toegether with own Adruino Keyer features.

Congratulations and many thanks for this great project.
When my hardware implementation will be ready and tested I plan to publish it for everybody.

Cortex implementation mentioned im post above is a great idea. I though also about it, Keyer with touchscreen display, virtual keyboard etc. I have such Kit.
Maybe for the next step.

Hello Marcin. Thanks for your email and compliments. Here are my thoughts on the items you mention:

1. This would be a good feature. I will add it to the list for development.

2. The macro to call another memory was intended to be a “jump” function whereby the keyer would jump from one memory to another and not return to the memory it was called from. But I will put on the feature request list what you are looking for. I’m not sure, however, how to prevent people from programming endless loops (i.e. memory #1 calls memory #2 and memory #2 calls memory #1).

3. Thanks for reporting that bug. I will put that on the list for investigation and repair.

Hope youre enjoy that AT6 stuff. The evaluation board that you are using make it possible to use a different LCD like 20×4 based hd44780.
I will integrate the actually source from K3NG quite soon.
I am now working on a TFT-Based Cross-Needle SWV-Messurement Instrument. The CPU is an STM32F104CV @72Mhz. (ARM Cortex-M3) If this is finished i turn me to the keyer again.

Hi Goody and Gerhard
I am finishing prototype based on ported firmware to atmega 1284P.
Designed and issued processor / display and interconnect board which feets toegether as “sandwitch” to typical box approx 120x90x50 mm, keyboard connector, USB connector, jacks for paddles and 4 transmitters – (key + PTT) separatated by double opthomos relays.
I am still awaiting for 19mm high micro pushbuttons from supplier (TME) to complete prototype.
Also predicted place for encoder to replace potentiometer, but i do not know which processor pin will be suitable for ported software.
Also hardware for adjusting contrast and ilumination leds by keyer commands, to have it ready when those will be implemented in software.
As soon as I complete prototype I plan to publish diagrams and PCB’s design here and / or Yahoo.

So I kindly ask You Goody You to continue code development and implementation of features I mentioned in post before. Also porting final version to atmega 1284p will be neccessary – Gerhard please.
I have advertised this hobby – no profit project as “All features having kayer” (Wszystko mający klucz) and some Hams are interested to buid it.

Hi Marcin,
welcome to the community of the arduino keyer. I will do the portation of the actual code quite soon. I did’nt see the newer code of the keyer implementation but i have read about it somthing last week.
I will hope that you have used opto-coupler for keying and PTT as replacement of the Transistors. In my Hardware layout i have used a TIL196
that contains 4 Units with AC Outputs. This makes it possible to handle negative or positiv keying / PTT withouit Keep sensing the wiring / polarity.
I will leave a notice here if the actual code is ported.
vy 73 de Gerhard, DD4DA

Hi to all,
first to all I want to thanks the collaboration, help and advises of K3NG (Goody) and DD4DA (Gerhard).
I’m finishing the hardware design for a new version of the K3NG Arduino keyer and I want to post it in order to know opinions and suggestions to add more features, improve or correct this non profit version.
Features:-
External 12 battery, or main AC supply.
Hi Voltage key operation 4200V. this feature will give the possibility to work with HI power tube TX, in grid, cathode or screen modes. The switch is a discrete IGBT opto-drived gate controlled that permits to key the TX fully isolated.
Wire Less key operation. By means of a tree channels IR receptor, could be possible to work in standard iambic mode or paddle squeeze. (I have designed too the TX module to adapt to the paddle ).
Possible use of 3.2″ LCD TFT + touch screen (for example SaintSmart) or the I2C model.
Contrast LCD potentiometer Control.
Capability of Headphone or Speaker with volume control pot.
All TX-RX signal optocoupled, allowing negative or positive keying.
Speed potentiometer control.
Key board entry.
6 or 12 memory selected by means of a miniature rotary switch.
Set-UP button control.
3 TX-RX outputs for standard TX an 1 for HV Tube TX.
And the fully features that the K3NG and collaborators have introduced until today, and I know.
Modular concept: This construction mode permits not only to assembly the modules that fits your today work mode exigences and after will give the possible updates for the future needs, it make possible too design or adapt a different CPU platform or any custom hardware module modification that the user wants, without to change the fully keyer.
Modular construction.
A base board to plug on:
CPU module for the version Mega 2560.
IGBT driver and protections (all the signals opto-isolated).
IR 3 channels receptor
The base board build in circuits:-
VCC supply -12, +12, +20, +3.3, +5 (+3.3 and 5 could be used of the Arduino board, but are preview for future CPU modules versions without VCC supplies).
Square to sine converter and audio amplifier (to use with earphones or speaker).
Signal decoder (new feature from K3NG).
Frequency Counter (new feature from K3NG)
Project situation:
At this moment the electronic design (schematics) are finished only waiting for a first test to adjust values and retouches the possible mistakes.
PCB design I have only finished pending to retouch (overlapping, angles out of greed etc. ) the IGBT driver and protection module.
I wait for your feedback.
When finished I will post the full information

Note the schematics are too big to be inserted, if there are any people that are interested in, please ask me and I will email it to you

Hi Gerhard,
The IGBT driver could use a negative gate blocking, normally only used to drive IGBT modules but in a HV-Hpower tube keying I prefer use this driving mode. then for IGBT driving I need 5Vcc for entry logic, +15VCX for isolated logic and IGBT ON gate, -15VCX for IGBT OFF gate. The Inverting circuit to generate -VCX employ +20VCI. the 5V and 3.3V are for CPU and general keyer logic and the -12/+12 is used for UAF42 square to sine converter (head phone) and audio amplifier (speaker).
I immediately will email you the schematic.

Hi there,
a nice project!!! I like it. I am familiar with the IDIOMPRESS timing (or ETM9COG in DL).
Is this special timing implemented, or can it be?
There is an project, called OPEN keyer. There are 2 commands in it to controll the CMOS-SUPER-KEYER timing:
—————————-
BC – Cmos Super Keyer timing oN/oFf [N]
Query or set iambic mode B emulation of the Cmos Super Keyer III. This setting is only relevant if mode A is
turned off using command “AF”. See section “Keyer modes” for details.
BR – Cmos Super Keyer ratio [33]
This setting can be used to adjust the Cmos Super Keyer timing. This allows a continuous setting between 0%
(normal mode B) and 99% (similar to mode A).
——————————————————
Thanks for reading. Is something like this implemented in the code?
I am not familiar with programming, so please excuse my question.

I have some code written to do this. Currently it’s hard coded at compile time, but I’m going to add a command line command to set it. Would you prefer to have a command line command or another way to set the percentage?

i am also familar with the Idiom press K3 CMOS Keyer that based upon an 68HC708 MPU and this is my prefered keyer. The Timing that this keyer has got, quite handier as the most i ever taste and owned. In consequence, i got a spare keyer if one will fail. Well, it is not an easy job to analyze and program the timing and behavior charactaristics of the K3-Keyer. I did’nt find a replacement of them since a couple of years, but the Winkey2 and the K3NG keyer are close to the K3 if IAMBIC mode B is selected. The most build-in keyer in the rigs are uses iambic mode B. The K3 uses an ultimatic mode thats a variant of mode b. The ultimate mode is more tolerant if your key-timing is not exact. For beginners of doing CW this is quite helpfull.

Hi Goody,
thanks for trying implementing this. Yes, the timing is really good. I have the real CMOS-SUPER KEYER-III and the OPENKEYER. OPENKEYER is good too, but has no contest number feature and the seidetone is allways on. It can’t be switched of with the command… No idea why.
But your arduino keyer is really nice – so much features.
I have the Winkeyer USB, too. That’s what I use especially for contesting. But it’s not comparable with the CMOS-3!! The CMOS-3 is MUCH BETTER!! The Winkeyer-USB even has stalls (delays) while comunicating with pc… The CW stops for a small while and that’s really disturbing.
I have a timing chart what that command **BR – Cmos Super Keyer ratio** is used for. If that can help??

I would help programming, but I use only BASCOM-AVR for small projects.
I like the idea of having an LCD… and the WINKEYER AND CMOS-3 features in ONE thing, HI.

According to what I read (and how I have implemented this feature), the setting is used during iambic operation when both paddles are squeezed. In normal iambic B, an opposite element is queued immediately when an element is being sent (i.e. a dit is queued if dah is being sent, a dah is queued if dit is being sent.) In iambic b, this queuing happens immediately. In pure iambic A, the queuing of the opposite element does not occur until the element is sent. The dit or dah must complete prior to the queuing to occur. CMOS Super Keyer timing is a hybrid between iambic A and B. A 0 (zero) setting makes it pure iambic B, while 100 makes it pure iambic A. The setting changes the amount of time the keyer waits to queue the opposite element, with the number setting representing the percent of time of the element. So if you set it for 25, the keyer will wait for 25% of the dit or dah being sent to complete before it will queue an opposite element. I hope this makes sense :-)

yes, that absolutely makes sense and I understand it. Its correct, that is the way it is in CMOS SUPER KEYER.
Thanks a lot for that work. To control the function with an command-mode command would sure be the more comfortable way. But after finding the best setting for themselves – I think it is not neccessary to change it anymore.
If the keyer should be used for more than one operator, e.g. in club stations, than changing it can be an advantage.

Now I have to find the arduino kit of my work colleague. He is in parents vacation (3months) until August. SRI :-((
Maybe I can get a nanokeyer kit or a arduino by myself if not succesfull.

Hi Goody again,
I just tried to take a look at the code. But checking the code ends up in a bunch of error messages about PS2Keyboard I don’t understand…
I didn’ change anything. Like in your page, I installed the two Librarys, but no effect.
What I am doing wrong? Maybe I am just stupid, then I am sorry for this question.
73, Andy

please note that the primary “support”media was moved away from this blog into a dedicated Yahoo group (see info further above).

I suggest that you use the libraryinstall instructions provided in the nanoKeyer package. This was for me the only way of using the library. If following Goodies way it also did not work for me and I was getting lots of errors….

Hi OScar, Hi Goody,
I used the instructions on Oscars nanokeyer infos. It workes well now without errors.
Will now going forward to test the SUPER-KEYER feature at the breadborard next days.
73, Andy, DL1AKP

I have have designed and built my hardware implementation. Tested with 300W amplifier, Keyer currentlu has no cabinet. No rf problems, However I proactively secured all input cables by ferrite rings.
Very important to block all the inputs with 10nF capacitors. I used smd ones.

Hi All! I got Arduino mega some day ago. I wanted check CLI first as I have no hardware around yet. Uploaded default source + serial help, I could see FW version and msg how call for help. But, no response for any my command with proper serial console setting, arduino led blinked. Finally, I left SERIAL + CLI + SERIAL_HELP features only and suddenly it started work. Seems like COMMAND_BUTTONS feature without HW blocks serial RX.

Thanks Goody for description! Could be there short note by plugin #define similar like it is by potentiometer feature that hw is needed? You know, I read all manual information about serial port as it first appeared like error with it. Tomas

Hi, I would like to know if when the keyer is sending from a memory and one touches the paddle (either way) does the transmission stop. If so is a dit or a dah sent or does it just stop. I believe this is a feature of K1EL v23.Thanks in advance Glen

What means: “Enhanced LCD Menu System” ?
Do I need additional buttons on the front or even a rotary encoder? Can I put in settings using these buttons instead of keyboard or paddle?
I plan to make a housing and want to have all in to get ready for all the cool features planned! Great project, I love it!!

Currently the LCD display shows some basic things, like paddle echo. You can’t change settings with it. I’m planning to write a menu system that could control all of the settings using front panel buttons. I intend on using the same analog button scheme that is used for the command buttons today. You may still want to put a rotary encoder on the front panel so you can adjust the speed quickly without having to navigate menus on the display. I often need to turn my speed up or down quickly when operating.

Thanks for the link to the menu library. It’s the best one I have seen yet. I’m attempting to determine if it’s the one I would like to use. I was hoping to have something with soft keys, where labels on the screen would correspond with six buttons on the sides of the screen, rather than the up/down/left/right/enter/exit methodology this library appears to use. But considering how much time it would take to develop from the beginning, a library like this is probably the way to go.

Hi Goody
In the the schematic there is a 10K pot for speed control, is the encoder a substitution of this potentiometer to enhance the features or is an additional control?
Many thanks for your constant support.

Hi Jordi. It performs the same function, so it’s a substitution. Since an encoder doesn’t have minimum and maximum rotation stops it does provide some advantages over a potentiometer. There wouldn’t be any reason to include both a potentiometer and an encoder on a unit, and on a new keyer I would build it with the encoder. I am going to continue supporting potentiometers in the code for the foreseeable future.

I have a request when asked to develop to specific devices, please send me a device for free so I can test with it and use it. This speeds up development greatly as it’s very difficult to troubleshoot problems when you don’t have the device. Also, it saves me the expense of buying a device, one that I may not necessarily have bought for my own use. And it gives me another toy to play with :-)

I’m absolutely agree, but at this moment I have not finished yet the design of main board and the TX, basically for mechanics questions. if you meanwhile prefer that I send to you the LED ring and the Alps encoder please email me your address and when I receive this components I will ship to you.
In the TX I have added the posibility to use one centered IR LED or two in the sides and one standar red led in the center also I have added the options of duty cicle control and modulation, but the main question to get the definitive design, is that I have to order a Begali Sculpture paddle to have the exact shape for the PCB and I’m not decided yet.
73
Jordi

I had used a simple PCF8574 Expander to decode two incremental Encoder, switched two LED’s and decode two Switches (like the button of the Encoder or just 2 button switches)
This works great but needs to be handled by an IRQ Service Routine and the clock Speed of the IIC Bus must be raised upto 800khz.
Also a choice would be use an mcp23s17 as SPI variant. That’s fast enough and is expandable.
Well, all this is possible, but this is just a keyer and this should be usable in portable Environment. Current consumption is also an importand Point of view – this should allways be in mind, if an extension of functionality is planed.
To use an incremental Encoder combined by the lcd Display is a consequent stepp but should be an optional possibillity, not an requirement.
Instead using the LED bar / ring, use the lcd-bar instead. This Needs just more code and does’nt consume more current and a Hardware Expansion that would i recommend.

Hi Gerhard,
I’m agree, all the functions that aren’t basic, have been designed software or hardware selectable and the user have the non mounting option without any consequence for the main functions of the keyer. By the other hand I have been looking for the right angle rotary encoders endurance, and all of types that I have found have an operating life lower than the vertical mount (the ALPS vertical type minimum 100k), due that I want to mount the encoder in the front panel I have thought that the LED ring PCB will give me this possibility beyond his main function. Moreover the LCD bar representation is too possible due the encoder is directly connected through the ring PCB to the CPU port. In this way you have two options display by means of the LCD or the LED ring.
73
Jordi

Hiya Jordi,
everyone should decide what kinda functionality the keyer who owns, got in. I cannot describe how i feel, if i follow the keyer thread and the developing of them. It’s amazing to see how many fellows interessting into the project, but the main function – to be an alternative and homebrew keyer, is slowly move away from there destination. The main Advantage of the K34NG keyer is, that this is not so komplex, can fit into nearly every Radio and do many more things as everyone would expect who attempt to find a keyer unit.
A big point is the tunable timing charactaritics and the winkey emulation who makes it very usable for any contest or other Stations.
This should be the final destination of the keyer and the basement of every extensions was made by K3NG by Publishing the schematic and source code of them. This is a good playground for everyone. This seems to be lost by overloading the project. The size of code and the consume of RAM limit’s the usable MCU and the keyer will not be implementable on cheaper platforms. Keep in mind, that sometimes is less getting more.
Jordi, catch the code as a base Fundament for your keyer and implement the Incremental Encoder with the LED ring – this Looks quite nice and i am sure, there are some HAM’s out here, who wanna build it – trust me. I would recoment to fix the keyer development and move to a new one.
A good and nice tool where a digital SWR messuring instrument based on arduino board – or something like that. Those things are available on the market but there are not cheap – a good reason to brew them. I would expect that this unit coast are less that $30 and could be used up to 2KW HF.
Hey Goody, what’s about a digital quadrature decoder to get sense the phase-angle and amplitude to get the XL / XC as a tuning argument for your antenna tuner project?

Hi Gerhard,
I fully agree with you, I started my idea only with the target of add the possibility to work with hi power vacuum tubes TX that involve hi voltage keying, later reading different posts in the Radio Artisan I saw the possibility to design a hardware including the suggestions made by the ham people, the main problem is to know the moment to stop the design and produce the definitive PCB.
In my design actually I have added the following features all of them are modular : an IGBT HI Voltage module that will permit to operate with vacuum tubes TX, in cathode, greed, or screen keying (4000V max), a square to sine circuit plus an audio amplifier to use headphones or speaker, the hardware implementation of the K3NG decoder following his design used in the antenna tuner, the speed control by an incremental decoder with the LED ring, its true that this last device probably could be considered only cosmetic, but why not? I thing could be nice, other possibility is use different types of LCD including a 3.52 TFT touch screen, also you can use all the compatible Arduino modules including the DUE (not compatible with the actual software as you comment me, but in the future?) and finally an IR RX module and the IR TX for the paddle to operate it in a wire less mode. All of this features are plug in modules or independent circuits that everyone can choose to customize his keyer according his preferences or his budged.
Now I thing that is complete enough (for me) and I will stop this design, now only is pending to decide the final PCB dimensions according the box and the paddle. When I have fully checked the design will post the schematic and PCB in order to get the maximum feed back.

>Hey Goody, what’s about a digital quadrature decoder to get sense the phase-angle and amplitude to get the XL / XC as a tuning argument for your antenna tuner project?

An amateur in India asked me about this recently and provided some technical information on how to do it. I haven’t had a chance to dig into it yet, but I am interested in including this as an option for the antenna tuner. It would let you use the tuner as an antenna analyzer.

I actually intended to include a frequency counter as my old PIC keyer project included one. That was intended for use in a QRP rig where you didn’t have a frequency readout. The PIC keyer frequency counter actually worked quite well, and I have an 80m homebrew QRP rig that still uses it. But unfortunately the Tone() functions use the same timer that’s need for a frequency counter, and I never got around to writing some sort of workaround. Probably the thing to do would be to have a separate ATMega328 for a frequency counter and interface it to the main unit using I2C. But no other people have inquired about the frequency counter functionality.

Jordi, my last notice should be understood as a vote to stop every development or extension of the keyer – nevertheless, i had the feeling, that the main focus is getting lost of the keyer project.
The main advantage of an IR wireless key is getting lost if this is not integrate like the PALM’s PK1 Key. The Key must have the wireless link to the keyer but this Need a secound, very “Tiny” device and space. You must join them hidden to the key and this is often impossible reasoned by the key’s “design”. In technical aspect, this is possible without Problems, but it lacks the design.

Hi Gerhard,
A digital SWR with arduino is a great idea! I would like that, too. I really had an eye on such a thing often at HAM RADIO, but always was to expensive. At the moment I am a beginner in Arduino but working on it. Just trying to build my Arduino keyer – I love it. And looking forward to see new projects.

Is it intended to make this a keyer project or is the creep of the scope of the project intentional. These other ideas are good but in the keyer box?

Just a thought, Glen, K1GW

On Sun, Jun 2, 2013 at 5:11 AM, Radio Artisan wrote:

> ** > DL1AKP commented: “Hi Gerhard, A digital SWR with arduino is a great > idea! I would like that, too. I really had an eye on such a thing often at > HAM RADIO, but always was to expensive. At the moment I am a beginner in > Arduino but working on it. Just trying to build my Ardui” >

@DL1AKP
Hi Andy,
i’m in developing of a cheaper digital SWR messuring Instrument by using a 3.5″ Touch-TFT Display a Cortex-M3 Controller, supported by an reel free RTOS called CoOS . (Free RTOS is not free !!! so this is not my choice.)
I have decide me to use a Bruene-Bridge that can handles up to 2KW but this can be replaced by a “Tandem Match Coupler” if prefered. The Interface between the Bruene-Bridge and the Controllers ADC need a buffer and impedance conversation stage builded by a simple OP-Amp. The Project can be build by a Vero-Board but need a PCB that contains the MPU. This boards are cheap available i all parts of the world an called ST-Discovery (less than €20.-) and contains the Programmer / Debugger (JTAG SWD) who can sepperate later and use by other Projects.
Actually, the TFT shows two needles that represents the transmitted and reflected power. The scale that be underlayed under the needles are not finished, but this is the last Job i need to do before this work is done.
The ADC’s sample rates are to fast to poll them by the MPU (this clock at 72Mhz) so this read-out must be handled by a DMA – an awesome feature, trust me. If the Project is functional finished, i will publish them.
The greatest hint as now was the 3.3V voltage of all components – i am not very familar with this – all my digital hardware experiences are based up on 5V Technologie. A simple RS232 driver stage must replaced, because my converter stage for a simple rs232 / rs485 / rs488 are all 5V based.
vy 73 de Gerhard, DD4DA

Capacitive Input is a nice Feature but it’s very sensible about RF too. I did some checks with them a few years ago to solve my cw Speed Problem, but None of the Units i got and checked where RF reliable enought if 400Wtts power was exceeded. I have seen schematic that uses photoelectric barrier instead the paddle contacts, but i never checked up them, yet. In the meantime, i have lost the skill of faster cw reception, so my morse key Schurr Profi2 is fast enought to do the bunch of qso’s i do in the year.

Hello Goody
I try to download the files *. Ino Development Site and open all instructions together as a single structure without separating instruction fields. The old files *. Ino that I have not have this problem. I’m interested in the Super CMOS.
Something is wrong .. in my Explorer?
73
José – LU1KAK

Well … I could not change the structure of Windows Explorer to download either the *. ino … but Google Chrome is perfect the *. ino. I try now the Super CMOS..
Thank you .. thank you for your work Goody
73

Using compiler options for Board=Arduino Uno and Programmer=USBTinyISP under IDE 1.0.5,
I am able to compile and load code version 2013040201 into a bare ATMega328 chip and run it without issues.
Attempts to do the same with code version 2013051901 result in failure. Key presses do nothing and there is no audio.
Any thoughts on the subject would be appreciated.
An attempt to do the same with code version 2013051901 results in failure. The load is apparently successful, key presses do nothing.

Hi Peter. Try compiling with less features and see if you’re able to upload and run it. I get the feeling you’re getting close to the memory limit of the 328. It would help to know what features you’re compiling.

Goody,
Here’s a photo of the breadboard I’ve been using for testing. There isn’t much to it… an Atmel ATMega328P chip and a few
discrete components are all you need. The programmer, a USBTinyISP, provides power to the keyer after the code is loaded.

Thanks for your help optimizing your code for this very basic implementation.