Sei sulla pagina 1di 141

Radio Artisan

amateur radio journey

Main Menu
Skip to content

 Arduino Controlled Beacon


 CW Keyer
 Rotator Controller
 Frankenrotator
 Antenna Tuner
 Directional Antenna Array Controller
 What is a Radio Artisan?
 Specialization is for Insects
 Support
 About K3NG

Arduino CW Keyer
Updated 2014-07-04

This is an open source Arduino based CW (Morse Code) keyer with a lot of features and
flexibility, often rivaling commercial keyers. 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. Consult this page for 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
 Logging and Contest Program Interfacing via K1EL Winkey 1.0 and 2.0 interface
protocol emulation
 Optional PTT outputs with configurable lead, tail, and hang times
 Optional LCD Display – Classic 4 bit mode , Adafruit I2C RGB display or YourDuino
I2C LCD Display
 Up to 12 memories with macros
 Serial numbers
 CW keyboard (via a terminal server program like Putty or the Arduino Serial program)
 Speed potentiometer (optional – speed also adjustable with commands)
 QRSS and HSCW
 Beacon / Fox mode
 Iambic A and B
 Straight key mode
 Ultimatic mode
 Bug mode
 CMOS Super Keyer Iambic B Timing
 Paddle reverse
 Hellschreiber mode (keyboard sending, memory macro, beacon)
 Farnsworth Timing
 Adjustable frequency sidetone
 Sidetone disable / sidetone high/low output for keying outboard audio oscillator
 Command mode for using the paddle to change settings, program memories, etc.
 Keying Compensation
 Dah to Dit Ratio adjustment
 Weighting
 Callsign receive practice
 Send practice
 Memory stacking
 ―Dead Operator Watchdog‖
 Autospace
 Wordspace Adjustment
 Pre-configured and Custom Prosigns
 Non-volatile storage of most settings
 Modular code design allowing selection of features and easy code modification
 Non-English Character Support
 CW Receive (EXPERIMENTAL)
 Rotary Encoder Speed Control
 Sleep Mode
 USB Mouse Support
 Mayhew LED Ring Support
 Alphabet Sending Practice
Basic Schematic (Click to Enlarge)

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.

Another circuit schematic featuring optoisolated outputs and a speed rotary encoder (PDF)

A Fritzing breadboard plan of the keyer

Connecting the Keyer

Here are the main pins you need to connect up to get started:

 Left Paddle – pin 2 – connect to your left paddle (grounding will send dits)
 Right Paddle – pin 5 – connect to your right paddle (grounding will send dahs)
 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_features_and_options.h : configure the features you want here

keyer_pin_settings.h : map the pins you‘re using with your hardware

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 list asks you to enable debugging and
post the debug logs for troubleshooting purposes

keyer.h : this is for some IDEs like Sublime/Stino that require function prototypes in order to
compile (or don‘t fully auto-generate function prototypes at compile time); leave the include in
the main .ino file commented out unless you need this (if you don‘t know if you need this, you
don‘t need it)

k3ng_keyer.ino : this is the main code; object declarations for some hardware devices are
included in this file

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.

Command Buttons

To enable the command buttons, uncomment this line at compile time:

#define FEATURE_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:

#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.

A - Switch to Iambic A mode


B - Switch to Iambic B mode
D - Switch to Ultimatic mode
F - Adjust sidetone frequency
G - Switch to bug mode
I - TX enable / disable
J - Dah to dit ratio adjust
N - Toggle paddle reverse
O - Toggle sidetone on / off
P# - Program a memory
S - Alphabet Send Practice
T - Tune mode
V - Toggle potentiometer active / inactive
W - Change speed
X - Exit command mode (you can also press the command button (button0) to
exit)
Z - Autospace On/Off
# - Play a memory without transmitting

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 using the built in Arduino USB port. 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).
Command Line Interface Showing Status (\s) Command Output

CLI Commands:

\? Help
\# Play memory #
\a Iambic A mode
\b Iambic B mode
\c Switch to CW (from Hell)
\d Ultimatic mode
\e#### Set serial number to ####
\f#### Set sidetone frequency to #### hertz
\g Bug mode
\h Switch to Hell sending
\i Transmit enable/disable
\j### Dah to dit ratio (300 = 3.00)
\k Callsign receive practice
\l## Set weighting (50 = normal)
\m### Set Farnsworth speed
\n Toggle paddle reverse
\o Toggle sidetone on/off
\p# Program memory #
\q## Switch to QRSS mode, dit length ## seconds
\r Switch to regular speed mode
\s Status
\t Tune mode
\u Manual PTT toggle
\v Toggle potentiometer active / inactive
\w### Set speed in WPM
\x# Switch to transmitter #
\y# Change wordspace to # elements (# = 1 to 9)
\z Autospace on/off
\+ Create prosign
\!## Repeat play memory
\|#### Set memory repeat (milliseconds)
\* Toggle paddle echo
\^ Toggle wait for carriage return to send CW / send CW immediately
\~ Reset unit
\& Toggle CMOS Super Keyer Timing on/off
\%## Set CMOS Super Keyer Timing %
\. Toggle dit buffer on/off
\- Toggle dah buffer on/off

To enable the CLI, you must uncomment two lines in the source code before compilation:

#define FEATURE_SERIAL

#define FEATURE_COMMAND_LINE_INTERFACE

CW Speed Adjustment

The CW sending speed can be adjusted several ways:

 The W command in command mode


 The command line interface \w command
 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.

The potentiometer functionality is enabled by commenting out this line:

#define FEATURE_POTENTIOMETER

The pin the potentiometer wiper is connected to is defined here:

#define potentiometer A0

Only enable this functionality if you have a potentiometer connnected, otherwise stray voltage on
the Arduino pin will cause erratic and unexpected speed changes.

Rotary Encoder Speed Control

Speed can also be controlled using an inexpensive rotary encoder. The functionality is enabled
by uncommenting this line:
#define FEATURE_ROTARY_ENCODER

The pins for connecting the encoder are defined here:

#define rotary_pin1 0 // CW Encoder Pin


#define rotary_pin2 0 // CCW Encoder Pin

The center pin of the rotary encoder should be connected to ground.

Beacon Mode

In order to have the keyer go directly into beacon mode at power up or reset and stay in beacon
mode, simply ground pin 2. This is useful for keyers that are dedicated to beacon or fox service.

Iambic Modes

To switch to Iambic A mode, use the A command in command mode or \a in the command line
interface.

To switch to Iambic B mode, use the B command in command mode or \b in the command line
interface.

(An explanation of Iambic A and B can be found here.)

Straight Key Mode

To go into straight key mode, hold down the right paddle when powering up or power resetting.

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.

CMOS Super Keyer Timing

This is enabled by uncommenting this line:

#define FEATURE_CMOS_SUPER_KEYER_IAMBIC_B_TIMING

And the default timing setting can be set here:

#define default_cmos_super_keyer_iambic_b_timing_percent 33
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:

#define initial_ptt_lead_time_tx1 10
#define initial_ptt_tail_time_tx1 10
#define initial_ptt_lead_time_tx2 10
#define initial_ptt_tail_time_tx2 10
#define initial_ptt_lead_time_tx3 10
#define initial_ptt_tail_time_tx3 10
#define initial_ptt_lead_time_tx4 10
#define initial_ptt_tail_time_tx4 10
#define initial_ptt_lead_time_tx5 10
#define initial_ptt_tail_time_tx5 10
#define initial_ptt_lead_time_tx6 10
#define initial_ptt_tail_time_tx6 10

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.

Hang time can be set by modifying this line:

#define default_ptt_hang_time_wordspace_units 0.0

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

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.
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:

#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 weight adjust
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:

#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:

#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:

#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 Sourceforge. Create a directory in
your sketchbook library directory called PS2Keyboard (i.e. \Arduino
Sketchbook\libraries\PS2Keyboard\)and place the two files in there. (If you get a duplicate case
error upon compilation, you‘re probably using the stock PS2Keyboard library files and not my
modified version.)

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.

USB Keyboard

1. Download the Circuits@Home library on Github. Install the library in a new directory in your
Sketchbook libraries directory called USB_Host_Shield_20.
2. In the keyer code, uncomment this:

#define FEATURE_USB_KEYBOARD

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

1. Get a Circuits@Home USB Shield.

2. Get an Arduino Mega ADK. (Note that if you use the Mega ADK board, you must uncomment
“#define BOARD_MEGA_ADK” in the library avrpins.h file.)

3. Get a Sparkfun USB Host Shield.

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

I personally use an Arduino Mega ADK, only because I mistakenly ordered one long before I
intended to use a host USB port, but it works well. The Mega board has the added benefit of
being able to run all of the keyer code with plenty of room to spare. Please show your support
for the USB library and purchase a Circuits@Home USB shield if possible, as they developed
the wonderful USB library used here.

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-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.

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. Uncomment this line:

#define FEATURE_USB_MOUSE

Uncomment the generic USB support code block as described above and uncomment the USB
Mouse code block:

/* Uncomment this section if using FEATURE_USB_MOUSE */


/*
class MouseRptParser : public MouseReportParser
{
protected:
virtual void OnMouseMove(MOUSEINFO *mi);
virtual void OnLeftButtonUp(MOUSEINFO *mi);
virtual void OnLeftButtonDown(MOUSEINFO *mi);
virtual void OnRightButtonUp(MOUSEINFO *mi);
virtual void OnRightButtonDown(MOUSEINFO *mi);
virtual void OnMiddleButtonUp(MOUSEINFO *mi);
virtual void OnMiddleButtonDown(MOUSEINFO *mi);
};
HIDBoot<HID_PROTOCOL_MOUSE> HidMouse(&Usb);
MouseRptParser MousePrs;
*/
/* End of FEATURE_USB_MOUSE section */
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.

Interfacing to Logging and Contest Programs / K1EL Winkey 1 & 2 Interface Protocol
Emulation

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.)

Currently the following functions are implemented:

 CW Sending (of course)


 Pause
 Key Down
 Unbuffered and Buffer Speed Setting
 Iambic A & B / Bug Mode Settings
 Ultimatic in normal, dit priority, and dah priority modes
 Farnsworth
 Pointer Operations
 Backspace
 Sidetone Frequency Settings (Winkey 1, 2, and custom frequencies)
 Paddle Reverse
 Paddle Watchdog
 Keying Compensation
 Dit to Dah Ratio
 Contest Wordspace
 Autospace
 PTT Lead, Tail, and Hang Time
 Speed Pot Setup and Query
 First Extension
 Software Paddle
 Weighting
 HSCW
 Serial Echoback
 Prosigns
 Dual transmitter keying lines
 Paddle Only Sidetone
 Memory button reporting
 Standalone Message Sending

K1EL Winkey 2 memory querying and setting via EEPROM upload and download is not
implemented.

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 current build of HRD I‘m using, 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 0×09 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.

Despite the claims, 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.

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:

#define tx_key_line_1 11
#define tx_key_line_2 12
#define tx_key_line_3 13
#define tx_key_line_4 0
#define tx_key_line_5 0
#define tx_key_line_6 0

#define ptt_tx_1 0
#define ptt_tx_2 0
#define ptt_tx_3 0
#define ptt_tx_4 0
#define ptt_tx_5 0
#define ptt_tx_6 0

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:
#define tx_key_dit 0
#define tx_key_dah 0

Banked Memory Buttons

A method for banked memory switches was created by DL2SBA and can be implemented by
uncommenting:

#define FEATURE_DL2SBA_BANKSWITCH

LCD Display

This keyer supports an LCD display, either the standard commonplace Hitachi LCD display in
four bit mode, the Adafruit LCD I2C RGB shield, or the YourDuino I2C LCD display.

The LCD display provides visual feedback for manual sending, memory operation, PS2
keyboard sending, and command button usage. Adafruit RGB LCD module buttons are not
support yet, but a menuing system using these buttons is in the works.

To configure the LCD display, follow these steps:

1. Uncomment one of the lines below, depending on your display type:

#define FEATURE_LCD_4BIT

or

#define FEATURE_LCD_ADAFRUIT_I2C

or

#define FEATURE_LCD_YDv1

2. If you are using the 4 bit LCD display, setup the I/O pins you want to use:

#define lcd_rs A2
#define lcd_enable 10
#define lcd_d4 6
#define lcd_d5 7
#define lcd_d6 8
#define lcd_d7 9

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.

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.)

Non-English Characters

To enable support for non-English characters (i.e. À, Ä, È, Ö, etc.), uncomment this line:

#define OPTION_NON_ENGLISH_EXTENSIONS

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:
#define command_mode_active_led 0

Mayhew Labs LED Ring

To use the Mayhew Labs Rotary Encode LED Ring with the rotary encoder speed functionality,
uncomment this feature line:

#define FEATURE_LED_RING

…and define pins here:

#define led_ring_sdi 0 //Data


#define led_ring_clk 0 //Clock
#define led_ring_le 0 //Latch

You can adjust the behavior of the LEDs with these settings:

#define led_ring_low_limit 10
#define led_ring_high_limit 50

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.

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.

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.

Note that code version 2011081901 introduced analog line multiplexed buttons. ―Legacy‖
buttons (one per I/O line) are no longer supported in the current code, however older versions of
code below can be used if legacy buttons are desired (at the expense of new features and bug
fixes).

The K3NG Arduino Keyer will not work with Logger16, Logger32, or Logger64 (and probably
Logger128 and Logger256). Attempts to interface this keyer to any version of Logger may
result in your Arduino board smoking or perhaps bursting into flames. Contact the friendly
support people on the Logger list for help with this issue.

Support

Please consult this page for support information.

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.

Have fun!

Hardware, Extensions, User Contributions, Other Support Sources, Etc.

Oscar, DJ0MY, offers a hardware kit, utilizing an Arduino Nano (user supplied). The kit
features a speed potentiometer, opto-isolated TX and PTT outputs, three memory buttons, and a
PS2 keyboard connector. Oscar provided testing, especially for the K1EL Winkey interface
protocol emulation, and numerous development ideas.

Dietmar, DL2SBA, has created some extensions to the hardware, including button switch banks.

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.
Hajos Kontrapunkte wrote about his experience building the keyer.

Stewart, VA3PID, wrote an article about the keyer in the Scarborough Amateur Radio Club
newsletter, Wavelength.

Owen, VK1OD, has contributed code and chronicled his Arduino project using this code.

Gerd, DD4DA, maintains a port of the keyer code for the AVR Studio 6 IDE. Gerd has
provided code tips, bug fixes, ideas, and feedback

Hamshop.cz offers an ATMega328 based keyer kit with the Arduino bootloader that runs this
code.

Chris, K4FH, provided testing, ideas, code, and feedback

Chis, W0ANM, provided testing and feedback

Marcin, SP5IOU, provided code, testing, ideas, and feedback

Peter, NI6E, helped identify bugs and test features. Here‘s his discrete component keyer on a
breadboard:

Ryan, KC2ZWM, contributed code.

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.
MJ/ON6NB DXpedition using the K3NG Keyer running on nanoKeyer hardware (Donated May
2013)

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

Source code is located on SourceForge. The master tree contains the latest stable code and is
what you should normally use. Click Download Snapshot to get all the code in a ZIP file.

Unstable / beta versions of code can be found in the unstable tree. Unstable versions of code
may contain new features which are not fully tested and probably not documented (though code
comments may have some documentation.) Do not run this code unless you‘re willing to
experiment and accept buggy operation. Unstable code may give you a rash and cause your
equipment to inexplicably explode without warning.

Code contributions and help testing features are welcome!

Code History (Stable Releases)

2.2.2014070301

S command – Alphabetical Code Sending Practice

2.2 (2014-06-14)

fixed bug with Winkey 00 admin command which affected Win-Test program

no longer necessary to manually uncomment:


#include <avr/sleep.h>
#include <PS2Keyboard.h>
#include <LiquidCrystal.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>
#include <BasicTerm.h>
PS2Keyboard keyboard;
LiquidCrystal lcd(lcd_rs, lcd_enable, lcd_d4, lcd_d5, lcd_d6, lcd_d7);
all USB keyboard and mouse stuff

fixed Arduino IDE compilation errors


fixed issue when FEATURE_COMMAND_LINE_INTERFACE and
FEATURE_WINKEY_EMULATION are compiled without
FEATURE_COMMAND_BUTTONS

fixed compile bug involving hz_sidetone when OPTION_MORE_DISPLAY_MSGS is enabled

fixed compile bug with OPTION_PS2_NON_ENGLISH_CHAR_LCD_DISPLAY_SUPPORT

fixed bugs with FEATURE_CAPACITIVE_PADDLE_PINS

fixed issue with Arduino IDE compilation and FEATURE_CAPACITIVE_PADDLE_PINS code

fixed issue with N command mode command – fix from LA3ZA

improved paddle echo and it should work better with autospace now

OPTION_KEEP_PTT_KEYED_WHEN_CHARS_BUFFERED

OPTION_DISPLAY_NON_ENGLISH_EXTENSIONS // OZ1JHM provided code

OPTION_EXCLUDE_PTT_HANG_TIME_FOR_MANUAL_SENDING

Introduced these settings:


#define WINKEY_HANG_TIME_1_0 1.0
#define WINKEY_HANG_TIME_1_33 1.33
#define WINKEY_HANG_TIME_1_66 1.66
#define WINKEY_HANG_TIME_2_0 2.0

improved paddle interruption of send_char()

Updated OPTION_DISPLAY_NON_ENGLISH_EXTENSIONS from OZ1JHM provided code

OPTION_WINKEY_SEND_BREAKIN_STATUS_BYTE

Updates to OPTION_DISPLAY_NON_ENGLISH_EXTENSIONS

Update to OPTION_NON_ENGLISH_EXTENSIONS

DEBUG_DISPLAY_SCROLL_PRINT_CHAR

OPTION_DISPLAY_NON_ENGLISH_EXTENSIONS addition code in


display_scroll_print_char()

fixed bug with OPTION_REVERSE_BUTTON_ORDER


Introduced these settings:
#define WINKEY_1_REPORT_VERSION_NUMBER 10
#define WINKEY_2_REPORT_VERSION_NUMBER 23

2.0 (2013-12-26)

Changed version nomenclature.

command_mode_active_led

+ is AR

Made it easier to form prosigns in command mode memory program using \+ macro

FEATURE_LED_RING
led_ring_sdi A10 //2 //Data
led_ring_clk A9 //3 //Clock
led_ring_le A8 //4 //Latch

fixed bug in eeprom initialization code


\s memory macro = insert space
check_ps2_keyboard() – changed code structure so Notepad++ displays and collapses it correctly
(bug in Notepad++).

check_ps2_keyboard() – fixed bugs with configuration.dah_to_dit_ratio

improved command button reading accuracy


renamed keyer_debug.c to keyer_debug.h
renamed features_and_options.c to keyer_features_and_options.h
FEATURE_LCD_YDv1 new
FEATURE_LCD_I2C renamed to FEATURE_LCD_ADAFRUIT_I2C

2013071601

tx_key_dit pin
tx_key_dah pin
OPTION_WINKEY_INTERRUPTS_MEMORY_REPEAT
fixed ps2_keyboard_program_memory compiler error

2013051901 – USB Keyboard and Mouse support, CMOS Super Keyer Timing, Dit and Dah
Buffer Control. Also rewrote the EEPROM code to use the struct method used in my other
projects.

2013040201 - OPTION_PS2_NON_ENGLISH_CHAR_LCD_DISPLAY_SUPPORT code


donated by SP5IOU, fixed \Z memory macro bug, fixed CLI \! command bug
2013032901 – Memory macro \i, memory macro now plays memory 10, CLI command added to
play memory 10, CLI command \p0 programs memory 10, Multi-transmitter PTT Lead Time and
Tail Time

2013012901 – Added Rotary Encoder Speed Control support and Sleep Mode.

2012101701 – Fixed another bug in Iambic A mode where additional dah was sent after
releasing a paddle squeeze. Optional non-English character support was added for the CLI and
K1EL Winkey interface protocol emulation. The command mode P command now supports
double digit memory numbers. Fixed a bug with transmitter switch announcements (―TX1″,
―TX2″, etc.) not sent in sidetone.

2012090501 – Fixed bug in Iambic A mode where dits would be lost while holding the dah
paddle and intermittently hitting the dit paddle

2012070201 – Current transmitter setting is now stored in EEPROM, fixed a minor bug with
K1EL Winkey interface protocol emulation where <CR><LF> was sent with every memory
button push, and added OPTION_N1MM_WINKEY_TAB_BUG_WORKAROUND

2012062501 – Added LCD support!

2012060301 – Fixed a bug that I encounter with a unit that previously didn‘t have bypass
capacitors on the paddle leads and experienced RFI, upon which I added caps and the keyer
thought both paddle line were grounded on startup in the brief moment they were charging
up. There‘s now a slight delay on startup to allow bypass caps to fully charge before checking
the paddle lines.

2012052101 Code – Multiple transmitter outputs added (no more needing to use PTT outputs to
switch between transmitters) and K1EL Winkey 2 interface protocol and settings now
supported. Performance with HRD improved. Also incorporated DL2SBA banked memory
button code.

2012042101 Code – Code cleanup to eliminate compiler warnings and two syntax issues caused
by changes introduced in Arduino 1.0. Also fixed two K1EL Winkey interface protocol
emulation bugs.

2012032501 Code – Improved command mode memory wordspace detection, wordspace


limiting, and trailing space trimming option. The potentiometer is now enabled by default now
on the first compile, upload, and power up.

2011120201 Code – Minor bug fixes, OPTION_REVERSE_BUTTON_ORDER, and updated to


compile with newly-released Arduino 1.0

2011100601 Code - Last Arduino 0022 code


2011081901 Code - Introduced analog multiplexed buttons, memory repeat (without having to
use memory macros), beacon bug fix, better handling of Winkey interface protocol emulation
paddle and memory interruption, much improved paddle echo, PS2 keyboard ALT key
combinations

2011081301 Code - Hardware pin changes

2011080502 – Many new features in the PS2 Keyboard functionality, up to 12 memories now,
up to six transmitter lines. Code now includes GNU license.

2011072801 – A bunch of Winkey interface protocol emulation commands, weighting, \j CLI


command, \i CLI command, \u CLU command, \+ memory macro and CLI command, Ultimatic
mode, \d CLI command, D command mode command

2011071801 – Bug fix correcting timing issue, more K1EL Winkey interface protocol emulation
commands

2011071602 – Features: Dead Op Watchdog, eliminated M command in command mode (now 1-


5 entered to play memory), numerous Winkey interface protocol emulation additions, autospace
feature, wordspace adjust feature, Iambic A and B modes (was just Iambic B before), keying
compensation feature

2011071002 – Interfacing to logging and contest programs

2011070801 – Improved preemption of memory sending by pressing button 0 or hitting PS2


keyboard escape key; added F command (sidetone frequency adjust) to command line interface
and memory macros; added additional keyboard commands

2011061201 – Added PS2 Keyboard functionality and had to change the right paddle pin from
pin 3 to pin 5 in order to accommodate it (only pins 2 or 3 on an Arduino can be used for
interrupts). Also improved serial_send_buffer functionality.

2011050602 – Added the \\ command to the serial command line interface code which dumps
buffered characters for sending. Also added functionality for backspace to delete characters out
of the buffer. Slash commands now preempt any characters in the buffer, and are executed
immediately.

2011032501 – Minor correction to potentiometer feature include code

2011031501 – Now the LED blinks rapidly in command mode and slowly in beacon mode.

2011031301 – Added speed potentiometer support

I would like to thank the staff of an unnamed 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.
G+

Share this:

 Email
 Print
 Facebook90
 Twitter16

370 responses to “Arduino CW Keyer”


1. Pingback: Welcome « Radio Artisan·

o k3ng October 30, 2012 at 21:23 · ·

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

 Robin July 23, 2013 at 22:36 · ·

Hello all
Just completed a nanokeyer but can‘t seem to download the ―Firmware
Upload Guide‖.
Any known issues or suggestions for an alternate source?

 radioartisan July 23, 2013 at 23:51 · ·

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.

 robin July 24, 2013 at 01:04 · ·

Oh I am trying to download from k3ng


nanometer.WordPress.com/downloads
Robin
 radioartisan July 24, 2013 at 01:09 · ·

Try this link: http://nanokeyer.files.wordpress.com/2012/01/nanokeyer-


firmware-upload-guide.pdf

2. Chris March 15, 2011 at 21:32 · ·

Excellent! Can‘t wait to try it out..

73, Chris

3. Chris March 17, 2011 at 14:50 · ·

Can you put the source in a zip file. I can‘t copy/paste the source correctly.

Thanks!

4. Hermann AJ4ZS May 14, 2011 at 01:37 · ·

This is AWESOME!. Many thanks for sharing! I never knew how much you can pack
into this little Arduino!
I copied the code and it works perfect.

vy 73 de Hermann AJ4ZS / DL8MCP

5. Oscar DJ0MY May 17, 2011 at 18:50 · ·

Great project. Looking forward for the first experimental Winkeyer emulation mode :-)
73 de DJ0MY

6. Mats May 30, 2011 at 16:33 · ·

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
73′s de Mats

7. scruss June 11, 2011 at 16:07 · ·

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?

o k3ng June 11, 2011 at 16:38 · ·

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 :-)

73

 scruss June 11, 2011 at 17:10 · ·

Thanks — I thought as much, but wanted to check. And no, I‘m not
interested in connecting a USB keyboard directly, even if the Uno‘s
potential for HID is there.

73 de VA3PID

8. Oscar June 11, 2011 at 20:01 · ·

Hi Anthony, is there any progress on the Winkeyer ―emulation‖ – are you still intending
to work on it?

o k3ng June 12, 2011 at 00:35 · ·

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.
9. Art Peters July 7, 2011 at 21:28 · ·

Tony —

Just finished assembling my version of your arduino keyer.

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.

Thanks again!

73,

Art
K0ACP

o k3ng July 7, 2011 at 21:48 · ·

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!!
:-)

73
Goody
K3NG

o Chris Fowler July 29, 2011 at 02:31 · ·

Art,

I would like to see how you mounted yours. Looking for ideas for mine too.
73,
Chris k4fh

10. Ken N9VV July 24, 2011 at 16:56 · ·

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

thanks,
dit dit
72/73 de Ken N9VV
CFO #287

o k3ng July 25, 2011 at 00:55 · ·

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.

73
Goody
K3NG

11. Oscar DJ0MY July 25, 2011 at 18:06 · ·

Hi Ken and Goody,

from what I can read on his site K1EL has so far only implemented his keyer code (from
his stand alone keyers like the K12) into the QRP-Radio firmware…not the Winkeyer.

The reason is simply because his current QRP hardware does not forsee a RS232 serial
port or USB port for external connection to computers (would be a nice addon, though).
73 Oscar

12. Chris Fowler July 29, 2011 at 00:04 · ·

I‘ve got this bread boarded. Have you laid out a PCB yet?

73,
Chris k4fh

o k3ng July 29, 2011 at 21:51 · ·

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.

13. Art Peters July 29, 2011 at 22:18 · ·

Goody and team,

I used ugly construction on a proto-shield for my effort and plugged that into a Arduino
Uno board, when I get sometime, I may try a custom layout from PCB express.

I did order a box from Mouser p/n: 546-1455N1602BK Hammond Enclosures, Boxes, &
Cases 6.3 x 4.06 x 2.09 This is an aluminum box with plastic end pieces and works very
well.

Since I only have a single rig, I only connected up a single transceiver line. Also, later I‘ll
either post a link to the mouser bom or paste a copy of it here.

Wow the keyer works great!

Goody, thanks for putting this out there.

783,

Art
K0ACP

14. Chris Fowler July 30, 2011 at 00:08 · ·


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

73,
Chris k4fh

15. Erik August 5, 2011 at 11:07 · ·

WOW!!!

Awsome work you have done!

TNX es 73 de SM0RVV

16. k3ng August 5, 2011 at 12:04 · ·

Thanks all for your kind words :-)

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.

73
Goody

o Chris Fowler August 5, 2011 at 13:23 · ·

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.

73,
Chris k4fh

 Chris Fowler August 5, 2011 at 14:50 · ·

Darn. I think I‘ve been playing with the 07/18 code. There are many
differences between what is above and what I have.

17. k3ng August 6, 2011 at 14:22 · ·

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.

o Chris Fowler August 9, 2011 at 18:54 · ·

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.

Chris

18. Chris August 9, 2011 at 02:53 · ·

Hi Goody,

I have not found the updated PS2Keyboard Libraries on your site.

Looking forward to trying this version out. I still had issues with the last version and
spacing in CW (very very long delay between words with the keyboard).

Cheers,

o k3ng August 9, 2011 at 11:01 · ·

The modified .h and .cpp files are above, right below the main code….

 Chris August 10, 2011 at 00:32 · ·

How could I‘ve miss that !? Tnx, 73

19. k3ng August 14, 2011 at 17:21 · ·

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.

Thanks to Oscar and Chris for ongoing bug reports and code improvement ideas. :-)
20. Chris August 18, 2011 at 11:58 · ·

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.)

73, Chris

21. Oscar DJ0MY August 18, 2011 at 18:35 · ·

Hi Chris,

I had a similar problem with changing code speed. In my case it was related to a missing
speedpot.
I compiled the speedpot part although I had no speeedpot on my breadboard.

After removing the speedpot option and re-compiling everything was fine.

The latest keyer code works mostly fine here (but I do not use the keyboard – only
winkeyer mode and paddles).

73, Oscar

22. Chris August 18, 2011 at 22:22 · ·

Oscar, that makes total sense…. Thanks for the reply!

Cheers,

Chris

23. k3ng August 21, 2011 at 01:31 · ·


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.

o Chris Fowler August 21, 2011 at 16:33 · ·

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.

Chris

24. k3ng August 21, 2011 at 18:15 · ·

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…

25. James Michener September 16, 2011 at 15:04 · ·

Mouser is having an on line sale of the Arduino Mega board. $46.55 Not a bad price.

I have running a Arduino Mega Icom CI-V router / USB Interface / band decoder that
cures problems for those who are running the ICOM PW-1 and a XCVR with a computer
interface. Contact K9JM for Info

26. scruss September 21, 2011 at 03:32 · ·


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
…)

73 de VA3PID

27. Pete Cook September 21, 2011 at 18:17 · ·

This little section of the documentation is very important -

Code Compilation

All of the features will not fit on an Arduino Uno simultaneously. I find that when the
compiled code goes over about 29K, the upload to the Uno will fail.

Ran into this with a code size of 29004K and the error message is not very helpful…

Changed my options and it works great.

28. scruss September 21, 2011 at 23:31 · ·

I must be lucky; I got 29962 bytes to work on my Duemilanove.

29. k3ng September 22, 2011 at 00:53 · ·

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.

30. Chris Fowler September 22, 2011 at 00:56 · ·

There is a bug. If you have an ISP programmer you can program a new version of
optiboot that fixes this bug.
31. k3ng September 22, 2011 at 01:03 · ·

Ah, yes, it was Chris who told me. Thanks, Chris. One of these days I have to download
that and try it.

32. Chris Fowler September 22, 2011 at 17:37 · ·

Anthony,

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.

73,
Chris k4fh

o k3ng September 23, 2011 at 16:50 · ·

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?

 Chris Fowler September 23, 2011 at 16:53 · ·

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.

33. Chris Fowler September 23, 2011 at 14:36 · ·


I have a question for all the users.

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.

Just looking for usage comments.

73,
Chris k4fh

o k3ng September 23, 2011 at 16:52 · ·

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.

 Chris Fowler September 23, 2011 at 17:04 · ·

Is should probably send pic of my enclosed keyer

Right to left:
DC 5V
TTL
TX1
Paddle

The blue tack is holding the light pipe in place on the front.

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.

Chris

o k3ng September 24, 2011 at 00:24 · ·

Chris, try this code: http://radioartisan.wordpress.com/k3ng-arduino-cw-keyer-


code-in-testing/

This adds a new CLI command \^ which toggles ―wait for a carriage return to
send CW‖.

34. scruss September 25, 2011 at 23:29 · ·

Well, while we‘re sharing pictures:

http://scruss.com/blog/2011/09/24/k3ng-keyer-complete/

I may need to add a way of accessing the reset button, as from boot, neither my Linux
box or Mac can create a TTY (= serial port) for the device.

One weird thing is that the Memory #1 button seems to randomly cycle between any of
the programmed memories. Dunno if it‘s how I‘ve wired it. The Command button mode
works fine, if a little bouncy.

Cheers for this design. Using fldigi to copy the incoming code, I‘ve made several DX
QSOs.

73 de VA3PID
o scruss October 6, 2011 at 13:41 · ·

The reset problem was because I was using a Duemilanove. When I swapped in
an Uno, all has been sweetness and light.

35. scruss October 2, 2011 at 03:15 · ·

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.

o k3ng October 4, 2011 at 00:10 · ·

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?

 scruss October 6, 2011 at 13:50 · ·

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.

 k3ng October 7, 2011 at 00:19 · ·

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:
delayMicroseconds(4025);

36. Chris Fowler October 10, 2011 at 12:45 · ·

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.

Chris

o k3ng October 12, 2011 at 00:33 · ·

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?

 Chris Fowler October 12, 2011 at 01:57 · ·

In ESM mode you would hit F1 or enter to send CQ. This worked. What
was strange was that after no caller hitting enter would no send CQ. I need
to keep doing some testing.

37. Chris Fowler October 11, 2011 at 21:25 · ·

Anyone using CQRLog with this? I‘m having some issues getting it to see it.
o k3ng October 12, 2011 at 00:35 · ·

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.

 Chris Fowler October 12, 2011 at 01:55 · ·

I do not as far as I know. I‘m ―in the raw‖. I‘m not using UNO. Just the
ATMega328 with API. I need to do more testing.

38. Oscar DJ0MY October 18, 2011 at 22:17 · ·

Hi folks,

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.

73 de Oscar DJ0MY
o Chris Fowler October 18, 2011 at 22:25 · ·

Oscar,

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.

I have an ATmel ISP serial programmer that I use on my build.

This is what I‘m using

#define CODE_VERSION ―2011080501″

73,
Chris k4fh

 k3ng October 18, 2011 at 23:23 · ·

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.
39. Chris Fowler October 18, 2011 at 23:40 · ·

I need to modify the code to do the boop_beep via LED. I have no sidetone.

40. Oscar DJ0MY October 19, 2011 at 19:19 · ·

Chris,

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…

http://www.serial-port-monitor.com/

73, Oscar DJ0MY

o Chris Fowler October 19, 2011 at 19:31 · ·

I was afraid of that. I‘ll do some more work. Using the latest sketch may require
me to make a few changes to the code. I‘ll check and see.

41. Chris Fowler October 19, 2011 at 19:32 · ·

Is there anyone here that is building a keyer ―in the raw‖ using this code? If so, I would
like to team up so we can discuss ideas without bothering Anthony. If interested please
send me a message.

73,
Chris k4fh
42. k3ng October 19, 2011 at 23:53 · ·

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.

Perhaps soon I can breadboard a ―bare chip‖ circuit to test that out.

43. Ken N9VV October 20, 2011 at 16:58 · ·

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

o k3ng October 21, 2011 at 00:31 · ·

I‘ve already been in contact with him; I‘m half of the way through building my
beta kit and should have it completed this weekend.

44. Oscar DJ0MY October 21, 2011 at 11:06 · ·

Hi there,

just a quick photo of my perfo-board version of the keyer based on Arduino Nano:

http:/www.qrpforum.de/index.php?page=UserGalleryPhoto&photoID=301

This is a ―PC-Keyer Only‖ version to replace my old LPT port keying cable with N1MM
winkeyer mode….

I am still waiting for my PCB‘s to arrive from China to make a decent keyer, hi hi…

Oscar, DJ0MY
o Chris Fowler October 21, 2011 at 13:43 · ·

Oscar,

I can not see the photo. I think a login is required on that site.

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.

73,
Chris k4fh

 k3ng October 21, 2011 at 21:10 · ·

You can set memories using the paddle in command mode with the P
command (not command line, but command mode where you hit button
0).

45. Oscar DJ0MY October 21, 2011 at 20:43 · ·

Chris,

I used ITeadstudio from China for the PCBs….I will post some pics after thez have
arrived (I just got the shipping notification mail from them)

Try this new photo link:


Nothing spectacular…

On the upper part you can see the electrolytic cap to deactivate ASR mode on the
Arduino.
I love the Arduino Nano‘s – they are soooo tiny.

Oscar

46. N8VSI - Scott November 18, 2011 at 13:57 · ·

This is amazing work!

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)

Thanks, and sorry!

47. Oscar DJ0MY November 19, 2011 at 13:55 · ·

Scott, the analog buttons work as follows:

The 5V is via R7 pulled low by the command mode switch (= pulled to 0 Volt level).

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…

Oscar DJ0MY

o k3ng November 22, 2011 at 22:13 · ·

Oscar, thanks for posting an answer! I was on vacation the past few days and
away from blogging…. 73

o N8VSI - Scottkuma January 13, 2012 at 18:10 · ·

Thanks for the great answer! I had to hook it all up to a multimeter, and was
immediately able to see what you meant.

48. Oscar DJ0MY November 19, 2011 at 15:54 · ·

Hi guys,

just uploaded this YouTube video featuring my professionally made PCB based keyer
hardware variant based on an Arduiono Nano plugin module and running the K3NG
firmware….

73 de Oscar DJ0MY

o Ken N9VV November 19, 2011 at 16:01 · ·

Beautiful job Oscar!! just amazing use of the nano-Arduino board.


I hope you will develop a webpage telling more details about your
outstanding new creation.
many thanks,
73 de Ken N9VV

o k3ng November 22, 2011 at 22:19 · ·

Nice work!!! I‘m so pleased to see my firmware running on your work of art :-)

o Dean - N7XG December 9, 2011 at 19:26 · ·


Cool little project. Anyidea When boards etc will be available?

Dean, N7XG

 Oscar DJ0MY December 9, 2011 at 19:43 · ·

Dean, see my reply posted further below (somehow it got at the end of the
blog rather then listed as reply to this comment….

Oscar DJ0MY

49. Oscar DJ0MY November 19, 2011 at 19:47 · ·

I am too busy with work and family the next weeks, but if I find some free time (latest
around Xmas) I will try to put some info together on a website…

73 de Oscar

o Steve Silverman November 26, 2011 at 18:36 · ·

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?

72 and 73

Steve Silverman
KB3SII
50. joop November 25, 2011 at 07:52 · ·

Just wondering, should the resistors for the button selection be connected to ground at the
bottom end?

Regards, Joop PG4I

o k3ng November 25, 2011 at 13:44 · ·

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.

 joop November 26, 2011 at 14:27 · ·

Thanks for explaining. Will have a go at the new schematic and version in
the near future. I am using the keyer right now in the CQWW CW. It is
great fun!

51. Oscar DJ0MY November 26, 2011 at 20:49 · ·

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.

52. k3ng December 8, 2011 at 00:37 · ·

Updated code posted with minor updates for compiling on the new Arduino 1.0.

53. Oscar DJ0MY December 9, 2011 at 19:40 · ·

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…

54. Pingback: Arduino : un manipulateur CW complet | Les chroniques hertziennes par


XV4Y·

o DD4DA April 19, 2012 at 15:12 · ·

????

55. Lou January 30, 2012 at 03:27 · ·

I‘m getting dozens of warnings at compile time with the code at:
http://radioartisan.wordpress.com/k3ng-arduino-cw-keyer-code-2011120201/

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

o k3ng January 30, 2012 at 03:38 · ·

That‘s not normal. What version of Arduino software are you using (click Help –
About Arduino)?

o DD4DA April 19, 2012 at 15:09 · ·

―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 to be taken for granted.

vy 73 de Gerd, DD4DA
 k3ng April 19, 2012 at 22:36 · ·

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.

 Tom April 21, 2012 at 15:47 · ·

The warnings are not so important – it looks just a little bit better at
compilation time – not more.

vy 73

56. Lou January 30, 2012 at 05:29 · ·

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.

57. Lou February 1, 2012 at 07:47 · ·

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.

FYI, others have had issues with the IDE in this regards, see:
http://code.google.com/p/arduino/issues/detail?id=664

58. cleo February 9, 2012 at 11:41 · ·


Pessoal,
Acesse o site da EMPRETECNET, eles fabricam um KIT com uma placa compatível
com arduino duemilanove, uma placa de rele, de potenciômetro, de sensor de luz, de
sensor de luminosidade, de buzzer, de botão e demais componentes que podem ser
realizados vários experimentos sem a necessidade de solda. Qualidade excelente!!

59. N8VSI - Scottkuma February 15, 2012 at 01:13 · ·

I‘m wondering how you calculate your delays for automatic sending for Farnsworth
spacing. They seem to be a bit fast…

Do you calculate this using the ARRL calculations?

o N8VSI - Scottkuma February 15, 2012 at 01:27 · ·

Sorry, hit return before I was done…

Make that the ―ARRL method‖…calculations can be found at

(http://www.arrl.org/files/file/Technology/x9004008.pdf)

 k3ng February 15, 2012 at 03:57 · ·

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.

60. Pingback: nanoKeyer « Radio Artisan·

61. Michael Gillie March 7, 2012 at 05:08 · ·

Hi there!!

I am a radio amateur, VE1HMY.

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?

I am a Computer Electronics Technician, however my CAD skills are slightly rusty.

I have a chance to pick the parts up over the next few days. Then I can build this beast!!!!
I‘m SOOOO looking forward to building a keyer!!!!

o k3ng March 7, 2012 at 12:50 · ·

Hello! Yes, R1, R2, R3, R5, and R6 are all in ohms. All the capacitors are
microfarads (uF).

 Michael Gillie March 7, 2012 at 15:12 · ·

Thanks so much for getting back to me. I kinda felt like it was a stupid
question, yet, at the same time, I did not want to buy the parts to find that I
blew up the board!

Also, are your capacitors all Electrolytic?

 Michael Gillie March 7, 2012 at 15:19 · ·

Are the switches all momentary in the open position when NOT
depressed? Also, I‘m guessing that the pot on R4 is linear.

Again, I feel like I‘m asking elementary questions, but getting the parts
while I am where I am for a few days is imperative.

I also attempted to read your source code…. AMAZING WORK!!!!!

 k3ng March 7, 2012 at 22:44 · ·

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.

62. N8VSI - Scottkuma March 7, 2012 at 13:23 · ·

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?

o Oscar DJ0MY March 8, 2012 at 19:35 · ·

Hi Scott,

the board is working fantastic.

You may have missed this announcement by Goody?

http://radioartisan.wordpress.com/2012/02/23/nanokeyer/

The CAM gerber files for making 100% identical copies of my PCB are on my
site.
Eagle files are not made available because I use custom part libraries.

Here is a photo of my keyer built into enclosure:

http://nanokeyer.files.wordpress.com/2012/02/nanokeyer-
artwork.png?w=240&h=180

I am currently working on REV D of the PCB.

73, Oscar

63. Michael Gillie March 7, 2012 at 23:14 · ·

Excellent!!! My Arduino Duemilenove is primed with the code!!! Now, once I get the
parts, I‘ll build this baby!!!! (and the iambic key to go with it….)

64. Steve Silverman March 8, 2012 at 00:05 · ·


Hi Michael,

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

65. Tilman March 29, 2012 at 19:12 · ·

Great stuff there !!!


I have been looking out for a CW-keyer on ARDUINO that I can use for QRSS…. Here
we go.

Thank you so very much / SM0JZT / Tilman

66. joop April 9, 2012 at 22:16 · ·

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.

I came across this bit of code:

#ifndef FEATURE_LEGACY_BUTTONS
#define analog_buttons_number_of_buttons 4 //16
#define analog_buttons_r1 10
#define analog_buttons_r2 1
#endif

I have 5 buttons next to the command button. So analog_buttons_number_of_buttons


needs to be 5, but what about the other 2 variables?

Thanks, Joop PG4I

o k3ng April 10, 2012 at 01:05 · ·

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.

73
Goody

 joop April 10, 2012 at 19:37 · ·

Thanks Goody,

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.

Will try and use #ifdef DEBUG next. It may be a fault on my side.

67. k3ng April 10, 2012 at 02:08 · ·

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.

68. Karl-Heinz Kunzelmann April 14, 2012 at 14:01 · ·

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

o nanokeyer April 15, 2012 at 08:51 · ·

Hi all,
regarding Karl-Heinz‘s use of a P3 touch keyer circuit…..this can be actually
done by Arduino, too
(with minimal external parts, just code, hi! )

See description, schematics, code and video here on this blog from Greece:

http://www.robotmotion.gr/robotmotion/Projects/Entries/2011/12/1_Iambic_keyer
_with_Arduino.html

73 de Oscar DJ0MY

69. nanokeyer April 15, 2012 at 08:59 · ·

Hi there,

DL2SBA came up with some nice modifications for the keyer circuit.
Among other things he found a clever waz to switch memory banks with using only few
memory buttons.

See his blog with schematics here (unfortunately only in German language, but the
schematics speak for themselves)

http://dl2sba.com/index.php?option=com_content&view=article&id=131:nanokeyer&cat
id=15:shack&Itemid=27

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)

http://dl2sba.com/index.php?option=com_content&view=article&id=134:nanokeyer-
erweiterungen-2te&catid=15:shack&Itemid=27

73 de Oscar DJ0MY

o Tom April 21, 2012 at 15:44 · ·

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

 nanokeyer April 29, 2012 at 09:59 · ·

Hi Tom,

thanks a lot for your kind comments and suggestions.

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.

Vy 73 de Oscar DJ0MY

70. Dietmar, DL2SBA April 15, 2012 at 13:42 · ·

Hi there,

I‘ve updated the nanoKeyer posts so they contain now also English text :-)

Dietmar, DL2SBA

o k3ng April 15, 2012 at 15:04 · ·

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).

 Dietmar, DL2SBA April 15, 2012 at 15:11 · ·

Hi Goody

yes for sure – please integrate it in the development stream.

Great piece of software – thanks!

Dietmar, DL2SBA
71. nanokeyer April 15, 2012 at 15:09 · ·

Great Dietmar, now also in English, thanks… :-)

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!

73, Oscar

72. Hajo April 15, 2012 at 21:11 · ·

Hello,

thanks for this real piece of art. I tried to marry your keyer software with the Arduino and
a LCD shield and ran into some trouble but finally managed to find my way out.

http://hajos-kontrapunkte.blogspot.de/2012/04/arduino-k3ng-cw-keyer-and-lcd-
shield.html

72 de Hajo

73. Tom April 21, 2012 at 15:25 · ·

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

74. k3ng April 22, 2012 at 00:08 · ·

New code posted.

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.

73
Goody

75. DD4DA April 22, 2012 at 18:09 · ·

@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.

void check_ps2_keyboard()
{
static byte keyboard_tune_on = 0;
static byte ps2_prosign_flag = 0;
int work_int = 0;
uint8_t keystroke = 0; // <———– That's my modification
#ifdef FEATURE_MEMORIES
while ( (keyboard.available() ) && (play_memory_prempt == 0) )
{
#endif

#ifndef FEATURE_MEMORIES
while ( keyboard.available() )
{
#endif

keystroke = keyboard.read(); // <— i removed the int declaration here


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.

vy 73 de DD4DA, Gerd

o k3ng April 22, 2012 at 19:53 · ·

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.

Thanks again and 73


Goody

76. DD4DA April 26, 2012 at 10:33 · ·

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.

vy 73 de Gerd, DD4DA

77. DD4DA April 28, 2012 at 14:37 · ·

@K3NG:

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.

vy 73 de Gerd, DD4DA

78. nanokeyer April 29, 2012 at 10:27 · ·

Talking about eye-candy:

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:

73 de Oscar DJ0MY

79. DD4DA April 29, 2012 at 19:40 · ·

@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.
vy 73 de Gerd

o nanokeyer April 29, 2012 at 20:58 · ·

Well,

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…

73 de Oscar, DJ0MY

80. leselaster April 29, 2012 at 19:53 · ·

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.

72 de Hajo

81. nanokeyer May 1, 2012 at 22:12 · ·

Folks…

Further above I replied to Tom regarding a potential keyer design running this firmware,
but not Arduino based.

A simple ATMEGA standard circuit should do the job instead of a fully blown Arduino
(and would be much cheaper and fun to build, too)…

The only problem would be how to equip it with an USB port, without having to solder
SMT devices (such as the common FT232RL chip) or without having to use an external
serial to USB converter…?

Now – it seems there is a potential solution for a simple non-Arduino based keyer – fully
USB port featured – without need of SMT soldering:

The trick would be to connect the USB port diretly to the ATMEGA and let it manage the
USB communication :-)

There is a project called V-USB which creates such virtual USB port for ATMEGA´s:

http://www.obdev.at/products/vusb/index-de.html

The same code is used e.g. in the Softrock SDR firmware, which is running also on an
AVR microcontroller and has the USB port directly connected to the chip…(running
great here in my shack by the way)

Well, there even seem to be folks out there who have ported this already to the Arduino
world:

http://code.rancidbacon.com/ProjectLogArduinoUSB

The external parts needed (other than USB jack) are minimal….

Only thing needed: A brave programming genious who would like to implement it … :-)

73 de Oscar DJ0MY
o DD4DA May 12, 2012 at 12:29 · ·

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

82. Balaganoff May 5, 2012 at 10:11 · ·

Very cool!
I‘m Waiting for the continuation of this project

73 !

83. Pingback: The nanoKeyer is an Arduino Nano based CW Contest Keyer ‹ SPARKY's
Blog·

84. DD4DA May 12, 2012 at 12:03 · ·

@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

Exchange them with:


byte x = 0;
for ( x = incoming_serial_byte; x > 0; x–) // modify dd4da

Similar in WINKEY status dispatcher routine if (winkey_status ==


WINKEY_ADMIN_COMMAND).
Search for:
(int x = 0; x++; x < 255)
compiler response with: Warning 25 3rd expression in for has no effect D:\1_AVR-
Projekte_keyer\working copy keyercpp\KeyerCPP\keyer.cpp 5972 1 KEYERCPP
just exchange them with:
for (int x = 0; x < 255; x++)

That's all.

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

o k3ng May 12, 2012 at 13:15 · ·

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.)

85. DD4DA May 12, 2012 at 17:12 · ·

I use ―2012032502″ actualy

o DD4DA May 12, 2012 at 17:17 · ·

Get the actual code now – need to find out what kinda changes are u did.I did
some modifications and could‘nt use your code directly.

vy 73 de Gerd, DD4DA

o DD4DA May 12, 2012 at 18:07 · ·


Have now checked the fixes – you fix them in the latest release vom 04/2012.

86. nanokeyer May 12, 2012 at 20:18 · ·

Could some of you check the paddle command P1, P2, etc. (programming of memory
messages) in this latest code revision?

I am getting only a ? back from the keyer and I can program therefore the memories (=
command not understood)…..is this only an issue I have or can you confirm you also
have it and its code related?

It seems it was OK with the previous versions…

73, Oscar

o k3ng May 13, 2012 at 12:06 · ·

Unfortunately I‘m not experiencing the error here. Are you sure you‘re doing
enough spacing between the P and the number?

 nanokeyer May 13, 2012 at 17:38 · ·

Hi,

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)

73, Oscar
87. nanokeyer May 13, 2012 at 11:26 · ·

Goody,

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?

73 de Oscar DJ0MY

88. k3ng May 13, 2012 at 12:01 · ·

Hi Oscar. You can adjust the time the C0 byte is delayed by changing this line:

#define winkey_c0_wait_time 2000

The wait time is in milliseconds. I can‘t recall exactly why I coded wait time in there, but
I seem to think it was something with HRD.

89. XV4Y (@XV4Y) May 14, 2012 at 02:32 · ·

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.

o DD4DA May 16, 2012 at 15:05 · ·


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

 nanokeyer May 16, 2012 at 18:44 · ·

Gerd,

what Yan was referring to is a trick (simpler than the one discribed by
Goody in his documentation above) on a standard Arduino Board to
disable the Auto-Reset via Serial Port.

To disable ASR feature of Arduino is required to get the Winkeyer


emulation mode running OK….
(see also my nanoKeyer circuit – I just use a electrolytic cap instead
without resistor)

Oscar DJ0MY

o XV4Y (@XV4Y) May 19, 2012 at 09:32 · ·

Hi Gerd, Oscar,

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.

73,
Yan.

 k3ng May 20, 2012 at 02:07 · ·

Yan, if you can install a serial port sniffer on your computer and capture
the data going between N1MM and the keyer and send it to me, I may be
able to track down the problem. 73 Goody
 nanokeyer May 20, 2012 at 20:53 · ·

Yan,

please do as Goody suggests. A good free serial port sniffer that I also use
is this one:

http://www.serial-port-monitor.com/

I was running the keyer during a contest today for around one hour and
made around 40 QSOs. I never experienced any problems with choppy
CW in Winkeyer mode and N1MM logger with Goody‘s code.

Could it be that you use the simple transistor keying and you are suffering
some HF feedback from your radio into the keyer?

Maybe you can try some RF chokes or ferrites on the keying line and/or
optical isolation of the keying line?

Oscar DJ0MY

 XV4Y (@XV4Y) May 22, 2012 at 00:38 · ·

Hi,

Yes, I will try to make some captures later, with both the old code and the
newer one you just released.
I am not keying the TRX yet, just testing with the tone output.

Thanks for your help.


73,
Yan.

90. SM0FPR May 15, 2012 at 14:48 · ·

Hi !

Yes Great job.. I‘m using the ―ardu-keyer‖ to control my ordinary winkeyer via
WKRemote. Works great.
Get two of these and you can sit in the ―soffa‖ and make QSOs …
Yan ! You don‘t need the electrolytic cap at all. I‘m using a 100 ohm resistor only, works
lika a charm.

73′s

Mats

o XV4Y (@XV4Y) May 19, 2012 at 09:33 · ·

With 100ohm only it was not working here, resetting from time to time…

91. DD4DA May 16, 2012 at 15:20 · ·

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

92. DD4DA May 16, 2012 at 15:29 · ·

@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.

vy 73 de Gerd

o k3ng May 17, 2012 at 01:05 · ·

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.
 DD4DA May 17, 2012 at 07:48 · ·

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.

93. DD4DA May 17, 2012 at 15:38 · ·

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:

#ifndef FEATURE_POTENTIOMETER
wpm = initial_speed_wpm; // setup current wpm to default wpm if poti not installed.
#endif

#ifdef FEATURE_POTENTIOMETER
pinMode (potentiometer, INPUT;
pot_wpm_low_value = initial_pot_wpm_low_value;
pot_wpm_high_value = initial_pot_wpm_high_val;
last_pot_wpm_read = pot_value_wpm (); // read the Poti value
wpm = last_pot_wpm_read ; // <<<<< actual speed will set to poti value
pot_activated = 1;
#endif

The function "int read_settings_from_eeprom()" needs to be repaced with the following


code:
————— snippy ———————————————————————————
——————-

int read_settings_from_eeprom ()
{
if (EEPROM.read (0) == eeprom_magic_number) // returns 0 if EEPROM had VALID
settings, returns 1 if EEPROM needs initialized
{
paddle_mode = EEPROM.read (EEPROM_paddle_mode);
keyer_mode = EEPROM.read (EEPROM_keyer_mode);
sidetone_mode = EEPROM.read (EEPROM_sidetone_mode);
hz_sidetone = word (EEPROM.read (EEPROM_hz_sidetone_high), EEPROM.read
(EEPROM_hz_sidetone_low));
dah_to_dit_ratio = word (EEPROM.read (EEPROM_dah_to_dit_ratio_high),
EEPROM.read (EEPROM_dah_to_dit_ratio_low));
length_wordspace = EEPROM.read (EEPROM_length_wordspace);

#ifdef FEATURE_POTENTIOMETER // if a Poti is installed, use the analog value from


the ADC
pot_activated = EEPROM.read (EEPROM_potentiometer_activated); // is the Poti
activated ????
if (pot_activated != 1) // if a Poti is activated, CW speed value will read from Poti ADC
{
wpm = word (EEPROM.read (EEPROM_wpm_high), EEPROM.read
(EEPROM_wpm_low));
}
#else // If the Poti is not installed, use the EEPROM value for CW-Speed setup
wpm = word (EEPROM.read (EEPROM_wpm_high), EEPROM.read
(EEPROM_wpm_low));
#endif

#ifdef FEATURE_AUTOSPACE
autospace_active = EEPROM.read (EEPROM_autospace_active);
#endif
config_dirty = 0;
return 0;
}
else
{
return 1; // Magic number is wrong – nothing is readed from eeprom – return error code 1
}
}

——————— SNIPPY —————————————————————————


—————————-
if the poti is installed and active, the poti value ist used to initialisized – otherwise, the
eeprom value will use to set the speed.

vy 73 de Gerd, DD4DA

o k3ng May 20, 2012 at 02:10 · ·

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.

 Gerd DD4DA May 20, 2012 at 10:31 · ·

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.

94. leselaster May 20, 2012 at 11:20 · ·

I will repeat myself: ―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. ‖ http://ladyada.net/make/rgblcdshield/index.html In the meantime I looked at the
libraries (https://github.com/adafruit/Adafruit-RGB-LCD-Shield-Library) and it looks
promising.

Hajo

o k3ng May 20, 2012 at 11:36 · ·

I like it. I‘m buying one.


95. k3ng May 21, 2012 at 22:48 · ·

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.

Enjoy.

o XV4Y (@XV4Y) May 22, 2012 at 08:34 · ·

Compiling but not running ok here.


Whatever option I define it goes to what seems an infinite loop of starts up (doing
boop than the beginning of the HI).

Yan.

 k3ng May 22, 2012 at 11:46 · ·

It sounds like you have a hardware problem. Do you have another Arduino
board you can try?

 XV4Y (@XV4Y) May 23, 2012 at 00:34 · ·

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…

Thanks,
Yan.

 XV4Y (@XV4Y) May 23, 2012 at 07:21 · ·


Well, now even with the old version it does not work well. I‘ve tried to
use the arduino unplugged or powered from batteries without success. I
hope my board is not toasted…

 nanokeyer May 25, 2012 at 15:48 · ·

Hi Yan,

I just heard you one hour ago on 15m CW from my mobile station (539
here) and called you a few times UP 2-3….but the EU wall was too
difficult to break from my mobile station, hi hi!

I indeed think that something is wrong with your Arduino Nano. I have
ordered in total around 10 Nanos from different vendors from China
spread over several months the past half year….

Out of those 10 there was one erratic with symptomps like yours…..not
responding properly, chopping the audio output etc. I got it replaced by the
vendor….

Otherwise never experienced any problems. Just give it a try on a different


one.

73 de Oscar DJ0MY

96. leselaster May 22, 2012 at 13:24 · ·

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.

Hajo

o leselaster May 22, 2012 at 17:40 · ·

Today the RGB Shield arrived: http://hajos-


kontrapunkte.blogspot.de/2012/05/searching-for-colors-take-arduino-rgb.html ,
but the main problem could not be solved. Also with the new libraries from
Adafruit there was not enough memory in the Arduino Uno left to push the code
into memory. But now I have only the two pins from I2C bus in use and the rest is
free for other tasks.

Hajo

97. Pingback: Possible Ham Radio Arduino Applications » Jeff Karney·

98. nanokeyer May 26, 2012 at 14:41 · ·

Currently working some casual S&P QSOs during this weekends CQ WPX CW 2012 and
using the latest K3NG code revision in ―Winkeyer 2″ mode connected via USB with the
N1MM logger and my Kenwood TS-590.

See a short snapshot video here:

Unfortunately I have no time to participate the full 48h, so just a few hours must keep me
happy…

73, Oscar DJ0MY

o k3ng May 27, 2012 at 14:38 · ·

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.

99. DD4DA Gerd May 28, 2012 at 15:26 · ·

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 ?
o k3ng June 1, 2012 at 23:38 · ·

There is a schematic of the Adafruit I2C RGB display here:


https://github.com/adafruit/Adafruit-RGB-LCD-
shield/blob/master/adafruit_rgblcdshield.sch . It uses 4 bit display mode.

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.

100. RZ9HK June 5, 2012 at 02:20 · ·

Hi Anthony, would you let me permission to translate some of your articles to make it
available for Russian ―segment‖ of WWW? Sure your copyright will not be affected.
Thanks and 73, Victor

o k3ng June 5, 2012 at 02:28 · ·

Yes, absolutely! That would be great. Thanks and 73!

 RZ9HK June 5, 2012 at 03:38 · ·

Thanks and good luck in further development! 73!

101. Hajo June 17, 2012 at 11:36 · ·

@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

o k3ng June 17, 2012 at 12:56 · ·

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.

102. Ron McCurdy July 1, 2012 at 16:50 · ·

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.

o k3ng July 1, 2012 at 17:32 · ·

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 .

103. Ron McCurdy July 1, 2012 at 18:01 · ·

Thanks! I knew it was something simple…and I just didn‘t see it. :)

104. DD4DA, Gerd July 2, 2012 at 17:22 · ·

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.
o k3ng July 3, 2012 at 20:55 · ·

Not that I have lots of spare time, but should I give Visual Studio a try? I assume
it does emulation of hardware?

 DD4DA July 3, 2012 at 21:18 · ·

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

105. Ron McCurdy July 2, 2012 at 17:51 · ·

Thanks a bunch!!

o dd4da July 3, 2012 at 05:55 · ·

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.

106. Ron McCurdy July 3, 2012 at 12:57 · ·


Yes, I‘m using a Atmega2560 and maybe even try a 328P. So, I‘ll be careful of that or
watch for your updates. Thanks, again!

o DD4DA July 3, 2012 at 20:52 · ·

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.!!!!

vy 73 de DD4DA, Gerd

107. Ron McCurdy July 3, 2012 at 21:07 · ·

From what you are telling me, I‘ll stick with the 2560 and maybe just use the Arduino
1.0.1. I‘m a newbie at this, so, I don‘t want to get in over my head!

Ron

108. Ron McCurdy July 3, 2012 at 21:09 · ·

Visual Studio 6.0 does have limited Arduino support. There is nothing much for the
ATmega2560.

Ron

o DD4DA July 3, 2012 at 21:33 · ·

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

109. Ron McCurdy July 3, 2012 at 21:29 · ·

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.

o DD4DA July 3, 2012 at 21:35 · ·

checkout the fuse settings

110. N9KR Bob July 4, 2012 at 21:34 · ·

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.

73, Bob N9KR


o k3ng July 4, 2012 at 22:46 · ·

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.

Anyway, thanks again. Dit dit. 73 Goody

 Bob N9KR July 4, 2012 at 23:33 · ·

Sounds great – on both fronts. On the relay switched tuner – I agree —


I‘ve been looking for a couple years & have found nothing published. You
da‘ man! I‘ll stay tuned. Thanks again.

 DD4DA, Gerd July 5, 2012 at 14:58 · ·

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.

vy 73 de DD4DA, Gerd

o Art Boyars December 14, 2012 at 01:08 · ·

Bob,

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

111. k3ng July 10, 2012 at 00:29 · ·

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.

o DD4DA, Gerd July 10, 2012 at 20:42 · ·

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.

112. ACLamb July 29, 2012 at 23:58 · ·

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

o k3ng July 30, 2012 at 00:12 · ·

Hi Archie. Have you uncommented the following line towards the top of the code:

#include

73
Goody

 ACLamb July 30, 2012 at 00:19 · ·

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.
Thanks for the help!!
Archie / KX5X

 k3ng July 30, 2012 at 00:23 · ·

Did you create a \libraries\ directory within your sketchbook directory,


and then within that a \PS2Keyboard\ directory?

113. ACLamb July 30, 2012 at 00:32 · ·

Goody,
The following is what I did(exactly) :
my sketchbook is here:
C:\Users\gpalamb\Documents\Arduino\advkeyer
PS2Keyboard dir:
C:\Users\gpalamb\Documents\Arduino\advkeyer\PS2Keyboard
lines un-commented:
#include
#define FEATURE_PS2_KEYBOARD
PS2Keyboard keyboard;

error message:
compiler stops at the last statement and says
‗PS2Keyboard‘ does not name a type

I‘m not sure but I‘m guessing its where I put the subdir. Is it in the rite place?

Thanks
Archie / KX5X

o ACLamb July 30, 2012 at 00:34 · ·

we crossed each other –


to answer your question – NO. I‘ll try that

Thanks!!

Archie

 k3ng July 30, 2012 at 00:36 · ·


Roger that. Yea, I‘m thinking you need to put the files in this directory:

C:\Users\gpalamb\Documents\Arduino\libraries\PS2Keyboard\

 ACLamb July 30, 2012 at 01:02 · ·

This is getting really frustrating. (I‘m frustrated with me – I know its


something (relatively) simple in the set up).

putting the library in my sketchbook directory didn‘t help. I ended up


putting it in the ‗Libraries‘ subdir in my arduino setup and the compile at
least went further.

The compile stopped at line 1343: the error was ‗duplicate case value‘
—> case PS2_SCROLL : // Prosign next two characters
ps2_prosign_flag = 1;
#ifdef FEATURE_DISPLAY
#ifdef OPTION_MORE_DISPLAY_MSGS
lcd_center_print_timed(―Prosign‖, 0, default_display_msg_delay);
#endif
#endif
break;

I‘m gonna walk away for tonite – I‘m too frustrated to see much at all.

I‘ll come back fresh and let you know if I have questions then. Thanks
Goody!

I really like your design – its exactly what I need / want!

73!

Archie / KX5X

114. ACLamb July 30, 2012 at 13:25 · ·

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.)

Thanks Goody

Archie / KX5X

o k3ng July 31, 2012 at 02:14 · ·

That‘s very strange. Could you email your .ino file and the PS2 library files
you‘re using to anthony dot good at gmail dot com?

 ACLamb July 31, 2012 at 12:37 · ·

on its way!
Thanks! – sorry for being such a noob / pita

Archie / KX5X

 k3ng August 1, 2012 at 00:36 · ·

No worries. I sent you a private email. I think I figured it out. Let me


know.

115. Owen July 31, 2012 at 22:41 · ·


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.

Owen

o k3ng August 1, 2012 at 00:35 · ·

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.

73
Goody

 Owen August 1, 2012 at 00:50 · ·

G‘day,
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.

Thanks
Owen

 Owen August 1, 2012 at 01:26 · ·

OK, I have found a Pro328 16MHz 5V board, and verified that I can
compile either CLI or Winkey (with or w/o 2) and it fits in the board. (My
compile error was due to wrong board selected.)

So, I will give this a whirl, might try Winkey(2) as I am using HRD to
control the radio on the other port.

Owen

 k3ng August 1, 2012 at 02:27 · ·

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.

 DD4DA August 1, 2012 at 06:30 · ·

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.

vy 73 de DD4DA, Gerd

116. Owen August 1, 2012 at 08:38 · ·

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!!!

Thanks
Owen

o Owen August 2, 2012 at 04:05 · ·

I have always had a concern that the Arduino boot loader might be falsely trapped
by serial traffic during the initial timeout, and I think I saw mention of
workarounds above.

A workaround I mentioned was to not use a bootloader.

However, I have downloaded the bootloader source and compiled it with


WATCHDOG_MODS defined, which prevents the bootloader kicking in on a
power up.

I have loaded the new bootloader, and reloaded the keyer just fine, and it works
ok with HRD in Winkeyer2 mode.

So, I may get the smaller 328 Pro-mini board to try out.

Owen

 DD4DA, Gerd August 4, 2012 at 08:49 · ·

Does your are finished with your build yet ?

o DD4DA, Gerd August 3, 2012 at 06:29 · ·

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

 Owen August 3, 2012 at 07:33 · ·


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.

Cheers, Owen (VK1OD).

117. DD4DA, Gerd August 3, 2012 at 06:49 · ·

@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

118. nanokeyer August 3, 2012 at 10:38 · ·

Hi Folks,

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…

73 de Oscar DJ0MY

119. Owen August 5, 2012 at 00:43 · ·

Gerd, I am not sure what you are asking me.

I have built and tested a prototype using a Pro 5V/16MHz board with custom bootloader,
RS232 TTL module, and FET KEY/PTT drivers, and it works fine.

I am awaiting parts for a final job, and that will take a few weeks.

Owen
o Owen August 27, 2012 at 11:32 · ·

Some delay in getting parts, Sparkfun messed up my order. Anyway, so


Metaboards arrived in the mail today, so they will be ideal for the job,

The project is basically a functional replacement for an RS232 Winkey (which are
now unavailable, but I am sure not as much fun as this project).

I have commenced documenting the project at


http://vk1od.net/module/K3ngKeyer/index.htm … commenced is the key word! I
do expect to put the PCB together tomorrow and should have it working by end of
day.

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?

Owen

120. zenographie August 23, 2012 at 17:48 · ·

Hi

Tnks for this nice Arduino hack… on a Mega board, there is still plenty of ram and I/O to
do other things :- ))))

We have written a small Wiki page dedicated to French Ham/hackers who intend to build
their own shield

http://wiki.electrolab.fr/Projets:Perso:2012:ArduiKeyer

Kicad‘s files will be online at the end of this month (August 2012). We also have patched
the PS2Keyboard.ccp to deal with localized keyboard (I‘ll be glad to send it to you if you
find any interest)

73′
Marc f6itu

o k3ng August 26, 2012 at 13:36 · ·

Hello Marc,
Nice Wiki page! It‘s great to see my code in action. Please send me the link to the
patched PS2 library and I‘ll link to it from here.

Merci et 73
Goody

 zenographie August 26, 2012 at 14:10 · ·

Many thanks for these kind words :-)

you can link (or upload the file)at

http://wiki.electrolab.fr/File:PS2Keyboard.cpp

If I find the time to do it, I‘ll send you the ―dit dah‖ table of you ―main‖ to
add diacritical letters (we use some in French, like the ―e‖ letter with
accents).

BCNU
73′
Marc f6itu

 k3ng August 26, 2012 at 16:46 · ·

I‘d be happy to add the additional characters. I took four years of French
in high school but unfortunately I forgot most of it. One of these days I‘m
going to learn it again.

121. Pingback: DL7BJ - Keyer-Elektronik für Morsetasten·

122. Marius September 23, 2012 at 07:04 · ·

Nice project. I am running it on an Arduino UNO. See more at http://www.lb3hc.net Tnx


es 73

o k3ng September 23, 2012 at 14:42 · ·

Hello Marius. I don‘t see it on the website you linked to. Is there a page that it is
on?
123. Mike September 23, 2012 at 14:15 · ·

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.

o k3ng September 23, 2012 at 14:32 · ·

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 )?

73
Goody
K3NG

o k3ng September 23, 2012 at 14:40 · ·

Also, what version of N1MM are you using?

124. Mike September 23, 2012 at 15:00 · ·

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):

// compile time features and options – comment or uncomment to add or delete features
// FEATURES add more bytes to the compiled binary, OPTIONS change code behavior
#define FEATURE_SERIAL
//#define FEATURE_COMMAND_LINE_INTERFACE // this requires
FEATURE_SERIAL
#define FEATURE_COMMAND_BUTTONS // this is now required for the regular
buttons and command mode (added in version 2012061601)
#define FEATURE_SAY_HI
#define FEATURE_MEMORIES
#define FEATURE_MEMORY_MACROS
#define FEATURE_WINKEY_EMULATION // this requires FEATURE_SERIAL –
disabling Automatic Software Reset is recommended (see documentation)
//#define OPTION_WINKEY_2_SUPPORT // requires
FEATURE_WINKEY_EMULATION
//#define FEATURE_BEACON
//#define FEATURE_CALLSIGN_RECEIVE_PRACTICE
#define FEATURE_POTENTIOMETER // do not enable unless you have a
potentiometer connected, otherwise noise will falsely trigger wpm changes
//#define FEATURE_SERIAL_HELP
//#define FEATURE_HELL
//#define FEATURE_PS2_KEYBOARD // also uncomment PS2Keyboard line below
and PS2Keyboard.h include at the top (requires FEATURE_SERIAL)
//#define FEATURE_DEAD_OP_WATCHDOG
//#define FEATURE_AUTOSPACE
//#define FEATURE_FARNSWORTH
//#define FEATURE_DL2SBA_BANKSWITCH // Switch memory banks feature as
described here:
http://dl2sba.com/index.php?option=com_content&view=article&id=131:nanokeyer&cat
id=15:shack&Itemid=27#english
//#define FEATURE_DISPLAY // LCD display support (include one of the hardware
options below)
//#define FEATURE_LCD_4BIT // classic LCD display using 4 I/O lines
//#define FEATURE_LCD_I2C // I2C LCD display using MCP23017 at addr 0×20
(Adafruit)
//#define FEATURE_CW_DECODER

#define OPTION_SUPPRESS_SERIAL_BOOT_MSG
//#define OPTION_INCLUDE_PTT_TAIL_FOR_MANUAL_SENDING
//#define OPTION_CLI_WINKEY_AUTOSWITCH
#define OPTION_SERIAL_PORT_DEFAULT_WINKEY_EMULATION // this will
make Winkey emulation be the default at boot up; hold command button down at boot up
to activate CLI mode
#define OPTION_WINKEY_DISCARD_BYTES_AT_STARTUP // if ASR is not
disabled, you may need this to discard errant serial port bytes at startup
//#define
OPTION_WINKEY_STRICT_EEPROM_WRITES_MAY_WEAR_OUT_EEPROM //
with this activated the unit will write non-volatile settings to EEPROM when set by
Winkey commands
//#define OPTION_WINKEY_SEND_WORDSPACE_AT_END_OF_BUFFER
//#define OPTION_WINKEY_EXTENDED_COMMANDS // in development
//#define OPTION_REVERSE_BUTTON_ORDER // This is mainly for the DJ0MY
NanoKeyer http://nanokeyer.wordpress.com/
#define OPTION_PROG_MEM_TRIM_TRAILING_SPACES // trim trailing spaces
from memory when programming in command mode
#define OPTION_DIT_PADDLE_NO_SEND_ON_MEM_RPT
//#define OPTION_MORE_DISPLAY_MSGS // additional optional display messages –
comment out to save memory
#define OPTION_N1MM_WINKEY_TAB_BUG_WORKAROUND // enable this to
ignore the TAB key in the Send CW window (this breaks SO2R functionality in N1MM)
//#define OPTION_WATCHDOG_TIMER

o k3ng September 23, 2012 at 15:22 · ·

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.

The N1MM TAB bug workaround probably won‘t affect this issue. Note that the
TAB bug workaround breaks SO2R operation in N1MM.

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. :-)

125. Mike September 23, 2012 at 18:18 · ·

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?
o nanokeyer September 23, 2012 at 20:41 · ·

Hi Mike,

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.

73 de Oscar DJ0MY

 Mike September 24, 2012 at 17:44 · ·

Excellent. Tnx for the pointer. I work on a smaller version with a Arduino
Mini Pro (Mega 328).

126. Mike September 23, 2012 at 18:21 · ·

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 … :) )

o k3ng September 23, 2012 at 19:18 · ·

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.

127. Mike September 24, 2012 at 17:43 · ·


OK, found it now. Will switch to a non UNO based board. This way I will get the keyer
smaller as well. I think ASR was the issue. Thanks.

o nanokeyer September 24, 2012 at 19:20 · ·

Mike,

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

128. N8VSI - Scottkuma September 25, 2012 at 00:51 · ·

Oscar: What case do you use for your builds? I have one of your Rev C kits, and would
love to have a nice enclosure / case for it. Would love any input that you have!

Thanks.

o nanokeyer September 29, 2012 at 08:37 · ·

Hi Scott,

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.

73 de Oscar DJ0MY

 N8VSI - Scottkuma October 17, 2012 at 16:13 · ·

I‘ll have to check at Fry‘s electronics when I get an afternoon to head over
there…

Thanks!

129. Pingback: LB3HC's hightech blog » Arduino Based CW keyer / FTDI based CAT
interface·

130. N8VSI - Scottkuma October 17, 2012 at 16:12 · ·

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.

o nanokeyer October 17, 2012 at 19:17 · ·

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?

o k3ng October 17, 2012 at 22:52 · ·

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.

131. nanokeyer October 17, 2012 at 19:17 · ·

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?

Oscar

132. Owen October 17, 2012 at 22:46 · ·

Some further testing…

I wrote a little script in EZGPIB to send 0×00 0×04 ‗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 will try another scripting environment.

Owen

133. Owen October 17, 2012 at 23:03 · ·

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.

134. k3ng October 17, 2012 at 23:37 · ·

Updated code posted. Enjoy.


135. Pingback: Nouveau Firmware pour le nanoKeyer | Actu-Radioamateur Nouveau
Firmware pour le nanoKeyer | L'actualité radioamateur, et nouvelle technologie…·

136. Owen October 25, 2012 at 03:36 · ·

Anthony, I have hacked a Winkeyer buffer management / flow control scheme for your
consideration.

Let me know how I can get it to you.

Owen

137. Hajo October 26, 2012 at 15:56 · ·

Oh Dear,

the code has grown (well done)… and I need to dive into it again.

At least I got an Arduino Mega and connected it with the Adafruit RGB LCD shield and
it worked. There is just one annoying thing and I don‘t find the relevant code:

The terminal window is constantly adding a new line so that the text vanishes and
the LCD-Display is showing in short intervals on line 1 text which could not be read for
it changes so fast.

Any idea where to tweak the lines.

Thanks for the good work.

o k3ng October 27, 2012 at 00:52 · ·

Hello Hajo. Do you have these lines set this way:

#define lcd_columns 16
#define lcd_rows 2

 Hajo October 27, 2012 at 15:24 · ·

This was your default line and I did not change it.
I have not attached the hardware, so this may be the problem.
 Hajo October 27, 2012 at 15:40 · ·

After I filled the memory, the LCD is stable with 19 wpm. ;-)

138. k3ng October 27, 2012 at 00:16 · ·

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

139. Mikael Landing October 27, 2012 at 07:23 · ·

Hi, thanks for a very nice program.

I am using a Uno r3 board and trying to load the ―K3NG_Arduino_Keyer_2012101701″


version.

It works fine without any modifications to the code.

Now I have also added the ps2 keyboard by following the instructions above
(uncommenting some lines).

The result is however that I now get ―Sketch is too big‖ message.when trying to upload.

Is this normal and is there a work around?

73 de SM5LYM

140. Jordi Roca November 6, 2012 at 19:22 · ·

Hi,
Could anyone let me know know if this firmware could it work in an Arduino Due board
based on the Atmel SAM3X8E ARM Cortex-M3?
Many thanks in advance
Jordi Roca

?CPU? SAM3X8EARM?Cortex-M3 CPU?


o k3ng November 9, 2012 at 12:17 · ·

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

o DD4DA December 14, 2012 at 12:53 · ·

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.

141. dd4da November 10, 2012 at 17:46 · ·

Just wanna say good bye – i Don‘t wanna register me at social media networks for just to
write some comments.
vy 73 de Gerd, DD4DA

o k3ng November 10, 2012 at 18:23 · ·

Sorry, Gerd. It‘s getting to be difficult to manage the comments here in


WordPress. But please correspond with me at anthony dot good at gmail dot com.
73 Goody

142. Ondra OK1CDJ December 10, 2012 at 13:54 · ·

Hello all, we offer HW KIT for this GREAT project.. See http://www.hamshop.cz/open-
cw-keyer-c27/open-cw-keyer-i196/

143. DD4DA December 11, 2012 at 09:26 · ·

Nice hardware work – uses Optocoupler instead 2N2222.


144. Jordi Roca December 18, 2012 at 10:41 · ·

Many thanks DD4DA for the information, at this moment i‘m playing with freescale K
series and for this reason my interest in Arduino cortex M3, I will check the ATMega32

o DD4DA December 19, 2012 at 22:30 · ·

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.

vy 73 de Gerhard, DD4DA

145. DD4DA December 19, 2012 at 22:20 · ·

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
146. Jordi Roca December 27, 2012 at 17:05 · ·

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.

147. DD4DA December 27, 2012 at 20:52 · ·

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

148. Tom January 8, 2013 at 06:15 · ·

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
149. Marcin January 13, 2013 at 15:36 · ·

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.

o k3ng January 14, 2013 at 00:33 · ·


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.

4. That is a good idea as well. I will put that on the list.

73!
Goody
K3NG

150. DD4DA January 25, 2013 at 23:51 · ·

@Marcin:

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.

151. Marcin SP5IOU March 22, 2013 at 14:50 · ·

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.

73′s Marcin SP5IOU

152. DD4DA March 22, 2013 at 18:35 · ·

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

153. DD4DA March 22, 2013 at 22:36 · ·

Hiya Marcin,

the code is now ported and available at Sourceforge.net.


vy 73 de Gerhhard, DD4DA

Have fun

154. Jordi March 23, 2013 at 13:04 · ·

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
155. Gerhard March 23, 2013 at 17:34 · ·

Hi Jordi, it‘s sounds very interessting into your keyer design. What does it mean with the
various VCC supplies? Does it need that for operation ?
Would you send me the schematics?

156. Jordi March 24, 2013 at 11:26 · ·

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.

157. DL1AKP April 22, 2013 at 09:40 · ·

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.

73, Andy, DL1AKP

o radioartisan April 23, 2013 at 01:09 · ·


Hi Andy,

Thanks for your question. This can be implemented in code. I think I see a way to
do it and I will put this on the list for development. I may be able to add this
feature in the next week or so.

73
Goody
K3NG

 radioartisan April 26, 2013 at 02:42 · ·

Hi Andy,

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?

73
Goody

 DL1AKP April 30, 2013 at 18:34 · ·

Hi Goody, I left the percentage at 33% default.


Do you know the timing and meaning of this value?

73, Andy

158. DD4DA April 23, 2013 at 20:50 · ·

Hiya Andi,

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.
o DL1AKP April 30, 2013 at 18:32 · ·

The OPENKEYER project keyer is very similar. But seems not be maintained any
longer…

159. DL1AKP April 30, 2013 at 18:31 · ·

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.

73, Andy

o radioartisan May 1, 2013 at 00:08 · ·

Hi Andy,

I have posted beta code here:


https://sourceforge.net/projects/k3ngarduinocwke/files/development/ . This
implements a basic CMOS Super Keyer Timing setting that can be set at compile
time. I‘m going to later make it that you can configure the setting at run time
using a command line interface command or a command mode command.

To enable the feature, uncomment this line:

#define FEATURE_CMOS_SUPER_KEYER_IAMBIC_B_TIMING

To configure the setting, change this line:


#define cmos_super_keyer_iambic_b_timing_percent 0

The setting can be from 0 to 100.

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 :-)

73
Goody
K3NG

 radioartisan May 1, 2013 at 00:09 · ·

I should add that this CMOS Super Keyer setting only takes effect if
you‘re in iambic B mode. It has no affect in iambic A or Ultimatic modes.

 DL1AKP May 1, 2013 at 07:38 · ·

Hi Goody,

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.
73, Andy.

 DL1AKP May 1, 2013 at 14:55 · ·

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

 radioartisan May 2, 2013 at 01:02 · ·

Andy, what errors did you get?

160. nanokeyer May 1, 2013 at 15:57 · ·

Hi 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….

73 de Oscar DJ0MY

o DL1AKP May 1, 2013 at 17:04 · ·

Many thanks Oscar. Will try it this way.


73, Andy

o radioartisan May 2, 2013 at 01:18 · ·

Hi Oscar. I see an error in my instructions. I will fix. Thanks


161. DL1AKP May 2, 2013 at 11:37 · ·

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

162. Morten May 11, 2013 at 13:21 · ·

Great Arduino project – love it! Question: has anyone attempted to add capacitve touch
capabilities (for touch enabled paddles) like in
http://www.robotmotion.gr/robotmotion/Projects/Entries/2011/12/1_Iambic_keyer_with_
Arduino.html ? I would love to understand the current codebase and try to add these
capabilities if no one lease has done it so far. Just checking…
Cheers
Morten
VK1JAM

163. radioartisan May 11, 2013 at 15:20 · ·

I‘m not aware of anyone attempting it, but the technique looks pretty simple. Do you
know how well it works in a high RF environment?

164. Marcin SP5IOU May 11, 2013 at 18:45 · ·

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.

Cheers.
Marcin SP5IOU

o Marcin SP5IOU May 11, 2013 at 18:50 · ·

Oooh sorry. I didn‘t notice that question related to capacitve touch.


Yes I RF could be a problem, however there are some working projects of touch
paddles on the web.
165. ok4bx May 18, 2013 at 06:42 · ·

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.

73, Tomas ok4bx

166. radioartisan May 18, 2013 at 11:29 · ·

Hi Tomas. The command buttons will do this if you don‘t have +5 volts on the button
line because the Arduino thinks there is a button depression and it‘s waiting for it to
complete. 73 Goody

o ok4bx May 18, 2013 at 13:18 · ·

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

 radioartisan May 21, 2013 at 03:48 · ·

Thanks for the suggestion. I‘ve updated the code and it will be in the next
release. Thanks and 73!

167. K1GW May 25, 2013 at 20:49 · ·

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

o radioartisan July 11, 2013 at 22:06 · ·

If you hit the dit paddle it stops and does not send a dit, it just stops.
168. DL1AKP May 26, 2013 at 14:40 · ·

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!!

o radioartisan May 26, 2013 at 15:38 · ·

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.

 DD4DA May 26, 2013 at 17:51 · ·

There is a nice arduino Project availabe that implements a menu that


supports a couple of display sizes an called PHI-2.

http://liudr.wordpress.com/libraries/phi-menu/

It‘s amazing and easy in usage.

vy 73 de Gerhard, DD4DA

o radioartisan May 27, 2013 at 12:00 · ·

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.

169. Jordi May 27, 2013 at 10:25 · ·


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.

o radioartisan May 27, 2013 at 11:40 · ·

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.

170. Jordi May 27, 2013 at 11:56 · ·

Thanks Goody, I will change the potentiometer by the encoder in my main board, at this
moment is possible yet because I have not closed the PCB desing.

171. Jordi May 27, 2013 at 16:29 · ·

Would you consider interesting to add with the encoder a Rotary Encoder LED Ring to
visualize de encoder position?

172. radioartisan May 27, 2013 at 21:40 · ·

I would consider that for a feature. What would it take to interface with it? The challenge
may be finding enough I/O pins.

173. Jordi May 28, 2013 at 08:24 · ·

I have choosed the Mayhew Labs rotary encoder LED ring that use the TLC5925
interface (www.mayhewlabs.com/products/rotary-encoder-led-ring) plus an Alps encoder
EC11K1524402 operating life of 100k cicles.
I have in my board the K ports not used, K ports are ADC and too I/O with selectable
Pull-Up. I have distributed, for components distribution reasons as follow:-
Arduino Mega2560 board
Pin9 => ENCDR_OE
Pin10=> ENCDR_LE
Pin11=> ENCDR_CLK
Pin12=> ENCDR_SDI
Pin13=> ENCDR_A
Pin14=> ENCDR_B
Pin15=> ENCDR_SW

o radioartisan May 30, 2013 at 21:24 · ·

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 :-)

 Jordi May 31, 2013 at 19:11 · ·

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

174. DD4DA May 28, 2013 at 09:39 · ·

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.

vy 73 de Gerhard, DD4DA

175. Jordi May 28, 2013 at 12:11 · ·

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

176. DD4DA June 1, 2013 at 16:28 · ·

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?

vy 73 de Gerhard, DD4DA

o Jordi June 1, 2013 at 19:42 · ·

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.

vy 73
Jordi

o radioartisan June 3, 2013 at 00:19 · ·

>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.

177. Jordi June 1, 2013 at 19:54 · ·

In my last post there is a mistake the K3NG antenna tuner design used in my design, is
for the frequency counter, excuse me.
vy 73
Jordi

o radioartisan June 3, 2013 at 00:36 · ·

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.

178. DD4DA June 2, 2013 at 09:06 · ·

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.

vy 73 de Gerhard, DD4DA

179. DL1AKP June 2, 2013 at 09:11 · ·

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.

o Glen Whitehouse June 2, 2013 at 17:26 · ·

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‖ >

 radioartisan June 3, 2013 at 00:20 · ·

I don‘t intend on putting an SWR meter within the keyer project. That‘s
quite a bit of scope creep :-)

o dd4da June 30, 2013 at 16:10 · ·

@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

180. Guenther Hutter June 2, 2013 at 16:18 · ·

Have you ever thought about impementing the paddles as capacitive keys ? … or are
there any known issues with that ?
It should be possible with this library:

http://playground.arduino.cc/Code/CapacitiveSensor

o radioartisan June 2, 2013 at 20:41 · ·

One other amateur asked about capacitive paddle inputs in the past. I‘m not really
keen to the idea as I think RF would cause problems, but I‘ll put it on the feature
request list.

 Guenther Hutter June 2, 2013 at 20:50 · ·

Ah okay, i understand. I was just courious about this, because it seems to


be a good feature.
best regards

 DL1AKP June 3, 2013 at 15:20 · ·

I have had a few sensor keys with capacitive input. It allways produced
problems with power exceeding 100W out. It works well on low power
levels, but I think will be hard with full legal limit power.

181. DD4DA June 3, 2013 at 15:41 · ·

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.

182. José Ricardo Ahumada June 30, 2013 at 14:35 · ·

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

o radioartisan June 30, 2013 at 14:38 · ·

Hello José. I‘m not sure what you mean by ―instructions‖. Do you mean you‘re
trying to combine the library files in the main .ino file?

 José Ricardo Ahumada June 30, 2013 at 15:32 · ·

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

 José Ricardo Ahumada June 30, 2013 at 15:43 · ·

What happened with Windows Explorer is that the lines do not drop
editing .. everything is one thing .. could not properly edit the *. ino, but
already solved with Google Chrome

183. Peter Putnam July 16, 2013 at 03:05 · ·

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.

o radioartisan July 16, 2013 at 03:11 · ·

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.

73
Goody
K3NG

184. Peter Putnam July 16, 2013 at 03:38 · ·

Goody,
The compiled code size is about 18K in both cases. Features are minimal and identical:
Command Buttons, Say Hi, Potentiometer, and Memories. I tweaked the pins to be: Left
= 2, Right = 3, Sidetone = 4, TxKey1 = 9, TxKey2 = 0, Pot = A0
73,
Peter

o radioartisan July 16, 2013 at 11:35 · ·

Try the latest unstable code:


http://sourceforge.net/projects/k3ngarduinocwke/files/development/K3NG_Ardui
no_Keyer_2013061101UNSTABLE.ino/download

If that doesn‘t work, please send me your ino files to anthony dot good at gmail
dot com.

185. Peter Putnam July 23, 2013 at 22:26 · ·

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.
73,
Peter
NI6E

discrete components

Comments are closed.

Blog at WordPress.com. | The Oxygen Theme.


Follow

Follow “Radio Artisan”

Get every new post delivered to your Inbox.

Join 101 other followers

Build a website with WordPress.com

Potrebbero piacerti anche