Updated 2013-05-01
This is an Arduino based CW (Morse Code) keyer similar my original PIC keyer, but with more features and flexibility. The code can be used with a full blown Arduino board or the microcontroller chip can be programmed with an Arduino board 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 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.
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”)
- PS2 Keyboard Interface for CW keyboard operation without a computer
- Optional PTT outputs with configurable lead, tail, and hang times
- Optional LCD Display – Classic 4 bit mode or Adafruit I2C RGB 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
- 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
- Logging and Contest Program Interfacing via K1EL Winkey 1.0 and 2.0 interface protocol emulation
- “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 / NEW! )
- Rotary Encoder Speed Control
- Sleep Mode
On the Development Roadmap
- Enhanced LCD Menu System
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.)
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.
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
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
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.
(Does anyone use Ultimatic these days?)
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
\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.
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.
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 Keyboard Interface
A common PC keyboard (PS2) can be interfaced with the keyer to create a computerless CW keyboard. Here’s what you need to do:
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 lines in the K3NG Arduino Keyer code:
#include <PS2Keyboard.h>
#define FEATURE_PS2_KEYBOARD PS2
Keyboard keyboard;
3. Connect up a PS2 keyboard to your Arduino. Details on the pinouts of a PS2 keyboard connector can be found here.
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…
Myself and others have experienced issues using just the USB +5V to power the Arduino and 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.
Note that the 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.
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.
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.
This functionality is intended to interface to logging and contest programs and is not intended to be a K1EL Winkey replacement. This keyer is not a Winkeyer and 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. 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 using one rig it should be fine.
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.
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, or the Adafruit LCD I2C RGB shield.
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. Enable the appropriate libraries in the code.
For a 4 bit LCD Display, uncomment this line:
#include <LiquidCrystal.h>
For the Adafruit I2C display uncomment these lines:
#include <Wire.h>
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>
2. Uncomment this line (this applies to both types of displays):
#define FEATURE_DISPLAY
3. Uncomment one of the lines below, depending on your display type:
#define FEATURE_LCD_4BIT
or
#define FEATURE_LCD_I2C
4. 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.
5. Uncomment one of the following lines depending on the display:
LiquidCrystal lcd(lcd_rs, lcd_enable, lcd_d4, lcd_d5, lcd_d6, lcd_d7);
or
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
6. 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
7. 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 these lines:
#include <avr/sleep.h>
#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.
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.
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
Although comments are enabled down below, the preferred way to get support for this project is to post a message on Radio Artisan group. Please note it’s sometimes difficult for me to answer direct emails in a timely manner due to work, family, etc. and I may wait to answer questions on the group in hopes others may be able to lend assistance. While I like helping others, I have limited time, and time spent supporting the code takes away from time to make more code and features.
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.
That being said, conversely 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.
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 is writing a chronicle of his Arduino project using this code.
Gerd, DD4DA, maintains a port of the keyer code for the AVR Studio 6 IDE.
Hamshop.cz offers an ATMega328 based keyer kit with the Arduino bootloader that runs this 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.
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 can be downloaded on SourceForge. (I no longer post new code here on WordPress.)
Modified PS2Keyboard Library Files (Required for PS2 Keyboard Feature Only)
Code History
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
Acknowledgments
Oscar, DJ0MY – testing, especially for the Winkey interface protocol emulation, and ideas
Chris, K4FH – testing, ideas, code, and feedback
Chis, W0ANM – testing and feedback
Dietmar, DL2SBA – feedback and code and hardware extensions
Gerd, DD4DA – code tips, bug fixes, ideas, and feedback
Marcin, SP5IOU – code, testing, ideas, and feedback
…and numerous others….
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.



Pingback: Welcome « Radio Artisan·
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
Excellent! Can’t wait to try it out..
73, Chris
Can you put the source in a zip file. I can’t copy/paste the source correctly.
Thanks!
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
Great project. Looking forward for the first experimental Winkeyer emulation mode :-) 73 de DJ0MY
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
If I were to run this as a USB-only keyboard keyer – apart from not connecting all the other paddles and paraphernalia – you wouldn’t see any problems running this just as a cut-down keyboard only device?
You can’t connect just a keyboard to it (you still need a computer with a terminal program connecting to the COM port), but yes, it will function fine without a paddle as all the commands needed to control it are available in the command line interface.
If you’re looking to just connect up a keyboard directly to the Arduino (computer), I can probably have that functionality in the code in pretty short order. Let me know if that’s what you’re looking for and work something up :-)
73
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
Hi Anthony, is there any progress on the Winkeyer “emulation” – are you still intending to work on it?
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.
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
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
Art,
I would like to see how you mounted yours. Looking for ideas for mine too.
73,
Chris k4fh
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
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
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
I’ve got this bread boarded. Have you laid out a PCB yet?
73,
Chris k4fh
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.
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
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
WOW!!!
Awsome work you have done!
TNX es 73 de SM0RVV
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
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
Darn. I think I’ve been playing with the 07/18 code. There are many differences between what is above and what I have.
New code posted. Note that the modified PS2Keyboard library files are posted here now, instead of just the code modifications. The modifications to add support for CTRL key combinations were getting too extensive to just list the changes.
I’ve not plugged in my power supply in the UNO so this may be relieved. Everytime in Linux the port is opened it resets the Arduino. I’ve got WINKEYER mode set to default and I had to not say HI when using CWType. Could be related to timing and WINE but if it did say HI CWType would error that there was no response.
I’ve almost got my enclosure complete and it looks good. I only had room for 5 buttons. Paid $2 for the case at a hamfest. Plastic so I hope this does not cause issues with lack of shielding. So far I’m able to TX at 20w in my shack.
Chris
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,
The modified .h and .cpp files are above, right below the main code….
How could I’ve miss that !? Tnx, 73
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. :-)
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
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
Oscar, that makes total sense…. Thanks for the reply!
Cheers,
Chris
Updated code posted. This code introduces analog line multiplexed buttons, so now up to 16 buttons (maybe more) are supported. This is to free up some pins for the upcoming LCD functionality and also provide more buttons for LCD display “soft keys”. Memory repeat can now be done without a memory macros (CLI: \! , PS2 Keyboard: ALT-Fx , or button hold + left paddle).
If you want to continue to use the old buttons (one button per pin) uncomment #define FEATURE_LEGACY_BUTTONS . I don’t know how long I’ll continue to keep the old code in there.
Wow, where are you finding the program space on the chip? Have you upgraded?
I have purchased about $50 worth of goodies from Evil Mad Scientist. I’m going to build one out on one of their proto PCBs and then put it in an enclosure. I use CWType with winkey support but after reading a Winkey vs cwdaemon email on QRP-L I’m debating about modifying the circuit to support RTS keying. This would make the AVR chip functionally worthless but I’m thinking more on the lines of the RTS in the circuit being an option and not standard. The RTS line would key TX1. Of course it could be used on a digital input pin and then the AVR could key. Like a pass thru.
Chris
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…
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
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
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.
I must be lucky; I got 29962 bytes to work on my Duemilanove.
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.
There is a bug. If you have an ISP programmer you can program a new version of optiboot that fixes this bug.
Ah, yes, it was Chris who told me. Thanks, Chris. One of these days I have to download that and try it.
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
Are you powering this via USB or the coaxial jack? Does this occur when connected to a rig or just when using it “dry”? The D2 and D5 lines shouldn’t be able to load down the power supply as they’re just being pulled up with internal pullup resistors, probably on the order of 1K or more. Do you indeed see the V+ line getting loaded down with a voltmeter?
I am powering via a DC coaxial check using power off the USB bus. What I have seen a voltage drop after this occurs. So far with the 1Ks I can’t seem to recreate this. I will also try with a straight key. I could also have a chip issue since this is one I built from the ground up. I can easily order another chip and program it.
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
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.
Is should probably send pic of my enclosed keyer
http://www.k4fh.com/keyer-enclosed.png
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
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”.
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
The reset problem was because I was using a Duemilanove. When I swapped in an Uno, all has been sweetness and light.
Hi Anthony, I’ve had two reports that my Hellschreiber output is illegible using your keyer. Both were used mid-QSO with experienced Hellschreiber operators. I thought at first it was the capacitor in the keyer circuit, but replacing that with a tiny ceramic made no difference. I’d be happy to help out testing, ‘cos I’ve intrigued several people with the idea of a Hellschreiber keyer.
How are you keying the transmitter? Are you using the sidetone output going into the audio input of the rig (in SSB mode) or using the CW key line with the transmitter in CW mode? I could see where the squarewave output might not play well. Did the people who provided the reception reports take a screen shot of what the received signal looked like?
I’m using the CW key line with the transmitter in CW mode. I got no screen shots from the contacts, but descriptions like slanted, smeared, timing off, and illegible. I had to switch back to Fldigi’s SSB Hellschreiber mode to maintain a conversation. I’ll try a screen shot request next time; there’s a QRO operator in Louisiana with whom I’ve traded screenshots before, and I can ask again.
Sounds like a timing issue. I had to play with the timing a bit to get it to display correctly for me. For some reason the original values I calculated for the code didn’t work. I’m not sure why.
If you fire up your Hell program and use your computer microphone to copy the hellschreiber from the keyer sidetone output, you should be able to see what it looks like and adjust the timing. Change the number in this line in the transmit_hell_pixel function:
delayMicroseconds(4025);
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
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?
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.
Anyone using CQRLog with this? I’m having some issues getting it to see it.
Do you have ASR (automatic software reset) disabled? I had problems with HRD and ASR activated. Does the keyer send random / errant characters upon connection? That tends to point to ASR screwing things up.
I 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.
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
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″
http://www.k4fh.com/keyer-enclosed.png
73,
Chris k4fh
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.
I need to modify the code to do the boop_beep via LED. I have no sidetone.
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
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.
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
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.
Hi Goody, *PLEASE* *PLEASE* work with Steve K1EL to incorporate your keyer in his new OpenQRP.org kit. I just finished my Beta kit and it is simply a wonderful rig. *BUT* It really needs the WinKey style keying with features and adjustments that you have created. Please contact Steve and work out some schedule for incorporating your amazing new code in his Arduino.
thank you,
72/73 de Ken N9VV
I’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.
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
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
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).
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:
http://imageshack.us/photo/my-images/853/20111021100028hdr.jpg
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
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!
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
Oscar, thanks for posting an answer! I was on vacation the past few days and away from blogging…. 73
Thanks for the great answer! I had to hook it all up to a multimeter, and was immediately able to see what you meant.
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
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
Nice work!!! I’m so pleased to see my firmware running on your work of art :-)
Cool little project. Anyidea When boards etc will be available?
Dean, N7XG
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
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
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
Just wondering, should the resistors for the button selection be connected to ground at the bottom end?
Regards, Joop PG4I
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.
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!
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.
Updated code posted with minor updates for compiling on the new Arduino 1.0.
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…
Pingback: Arduino : un manipulateur CW complet | Les chroniques hertziennes par XV4Y·
????
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
That’s not normal. What version of Arduino software are you using (click Help – About Arduino)?
“warning: extra tokens at end of #endif directive”
is resoned by the macro name that added the “#endif” directive. I.E.
#ifdef NAME
…
#endif NAME <– this is not allowed. Remove NAME that followed the #endif directive.
"warning: comparison between signed and unsigned integer".
A forced type casting should solve that message. The compiler does'nt know what kinda type of Variale (integer or unsigned integer) should be used.
warning: only initialized variables can be placed into program.
The compiler/linker must know how many memory should reserved in ROM section because a variable in ROM code area is not "variable". The compiler and linker will determine the memory consumption of the variable. This is impossible if the variable is declared but not initialized. The start address is known, but the end address of the variable is unknown at compilation time. So this is just a warning. I don#t understand why the copiler response with this warning in this case. I will try to fix them later but does'nt matters further.
The GNU-Compiler don't like uninitialized variables. Most of the messages are resoned by this circumstance, but this is a code cleaning task, not more. N3KG wrote a nice formated and clean code. Many thanks to him to made this avaliable for all.That's not to be taken for granted.
vy 73 de Gerd, DD4DA
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.
The warnings are not so important – it looks just a little bit better at compilation time – not more.
vy 73
My Arduino install must be corrupt. I downloaded and installed the Arduino software again on a clean Windows 2000 virtual machine under VirtualPC 2007 and your sketch compiles perfectly without warnings. Sorry to bother you. (I keep these VirtualPC images just for such testing purposes.)
Now I’m off to see if I can get the circuit to simulate under Proteus VSM.
OK, I have my problem sorted out. It *is* your code throwing all those warnings from the compiler. In Arduino v1.0 go to File–>Preferences, and check the “Show Verbose Output During Compilation”. You’ll see all the compiler warnings the Arduino IDE has been suppressing. In my book, “Non-Verbose Mode” does NOT imply “suppress all pre-processor/compiler/linker warnings”! The IDE has the “Show Verbose Output During Compilation” unchecked by default. (So as not to intimidate the noobs with a bunch of scary compiler output, I suppose.) Anyway, you now know there is minor code clean-up to be done. Thanks for making your project available. I found my clone Duemilanove and will give your Sketch a spin tomorrow on real hardware.
FYI, others have had issues with the IDE in this regards, see: http://code.google.com/p/arduino/issues/detail?id=664
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!!
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?
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)
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.
Pingback: nanoKeyer « Radio Artisan·
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!!!!
Hello! Yes, R1, R2, R3, R5, and R6 are all in ohms. All the capacitors are microfarads (uF).
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?
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!!!!!
The capacitor types aren’t critical, however typically the 100 uF cap is electrolytic, and the .01 uF caps are disc ceramic. All switches are momentary and normally open. Linear would be a better choice for the pot, though it’s not critical.
Have been using this for about a month on a large breadboard, and I LOVE it!
However, I really want to put this onto a circuit board & into a box…but I lack the skills to do that at this point. Oscar – how is that board working for you? Any possibility of posting the eagle files, or similar?
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
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….)
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
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
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
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
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.
Updated code posted. Command mode memory programming wordspace detection was improved and I added a feature to trim trailing spaces. I also updated the page with an explanation of the analog button settings.
Hi Anthony,
I like your code. It is an excellent piece of software. Thank you for sharing with us.
I combine it with an Arduino Pro Mini (very small) and a P3 touch keyer electronic. This gives me a very effective small keyer with a maximum of features at a minimum of investment.
Thank you your great work.
Sincerely
Karl-Heinz
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
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&catid=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
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
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
Hi there,
I’ve updated the nanoKeyer posts so they contain now also English text :-)
Dietmar, DL2SBA
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).
Hi Goody
yes for sure – please integrate it in the development stream.
Great piece of software – thanks!
Dietmar, DL2SBA
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
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
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
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
@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
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
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
@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
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
@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
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
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
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
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
Very cool!
I’m Waiting for the continuation of this project
73 !
Pingback: The nanoKeyer is an Arduino Nano based CW Contest Keyer ‹ SPARKY's Blog·
@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
Hello Gerd. Which version of code are you using? I fixed the issues you mention in the last code version I posted. (Thanks to your advice, I now run my compiler in verbose mode so I see these warnings, unlike before when I just saw fatal errors.)
I use “2012032502″ actualy
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
Have now checked the fixes – you fix them in the latest release vom 04/2012.
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
Unfortunately I’m not experiencing the error here. Are you sure you’re doing enough spacing between the P and the number?
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
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
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.
Great job you’ve done. Thanks for sharing it with the community. In order to disable the auto-reset, you also can just add a resistor (100-300 ohm) from +5V to RESET and an electrolytic cap (at least 10µF) between GND and RESET.
73,
Yan.
An external /RESET hardware is not needed in this keyer design because the ATmega MPU support POR internaly.The scound method is to use the Brown-Out detection fuse, that’s also power level triggered and resets the mcu if the level is reached that’s programmed in the BOD-Fuse bits.
vy 73 de Gerd
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
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.
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
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
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.
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
With 100ohm only it was not working here, resetting from time to time…
VIN Pin usage in Keyer software design. Take care about the Pin usage !!
The purpose of the VIN Pin is to put the extern stabilized voltage reference into the build-in ADC of MPU. In the case of Arduino-Environment, the developer don’t setup the adc’s voltage reference to internal because in this mode, the intern generated voltage will be available at the VIN Pin of the MPU. The reference voltage level is lower that VCC 5V+. If you put the pin to VCC 5V+ or GND, the internal resistor will failquite soon and the ADC will unusable. There is a notice in the arduino adc support source code that will describe why you should take care about that VIN pin in every design.
vy 73 de Gerd, DD4DA
@K3NG:
Does you plan to use the LCD ?? I am in testing an 24char 2 Lines lcd. The usage of the /RW line of the display to read the busy-flag instead a fix time delay,is recommended. I will put the characters in line 0 out and the did-dash combination in line 1. This looks fun.
vy 73 de Gerd
I was going to add LCD support but it hasn’t been high on my priority list and no one has really expressed interest in it. An LCD uses a lot of I/O lines. If there are I2C LCD displays, I was thinking one of those might be easier to use and leave I/O lines available for the PS2 keyboard and multiple transmitter lines.
An LCD is quite helpfull in combination of the PS2 Keyboard usage. OK, you need near a full I/O port avaliable to use the classic HD44780 display. But the avalibility of I/O Pins should not be the limit. If you need more that 32kbyte flash memory, you got them because all of the ATmega’s with more that 32 kbyte will ave enought of i/o pins. i.e. m664 or m1284p. I have build one pcb thats support a full configuration and need 78kbyte flash mem.The HELL support consume much of them. If you wanna save some pin’s i can imagine that the 44780 display can used with a8-bit shift register – you need just 3 Pin’s – i don’t prefere this – the cpu load will raise. I will do some test with the lcd stuff and the support routines and will write you my experiences.
Every time i restart the keyer, the keyer speed is set on default speed – even the Poti has moved on different speed. If you move the poti just a tick. the keyer speed is changed to the poti value. Unfortunatly, after a restart of the keyer, you must move the poti to get the tuned speed. To fix’em, it’s just a simple hack.
There are two fixes needs to do. In the Setup() function – the setup defaults will be loaded in a variable called wpm. wpm = initial_speed_wpm // setup current wpm to default wpm
This load the startup speed with the previously defined speed instead reading the poti value if this feature is enabled and activated.
I replaced the line with:
#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
Thanks for the tips, Gerd. I will incorporate into the next update which should be in a few days. I’m working on K1EL Winkey 2 support and I also have multiple TX lines in the code now. Instead of having to multiplex the one TX key line with the multiple PTT lines for multiple transmitters, you can have up to six TX key lines and the PTT lines can be totally disabled if they are not needed.
I think after this update I’m going to look into I2C LCD functionality.
The LCD support library of arduino is limited so i decide me to move to the lcd support libraries from peter flury. That’s just need to move to c++ / Arduino. The reason is that this routines are not reentrant.
If you wanna support I2C, try to use the TWI instead bitbang routines that ARDUNIO uses. An alternative for serial hd44780 support ist using an 8bit shift register. Check em out here: http://embedded-lab.com/blog/?p=30 . An Arduino support is written quite fast.Using SPI capabilities needs just some tests.
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
I like it. I’m buying one.
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.
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.
It sounds like you have a hardware problem. Do you have another Arduino board you can try?
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.
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…
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
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
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
Pingback: Possible Ham Radio Arduino Applications » Jeff Karney·
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
Last night I worked the contest casually using N1MM and the keyer in Winkey mode. It’s working quite well. I discovered one minor bug at startup if you don’t have the potentiometer feature activated. The logging program will have the wrong speed reported to it on start up, however the speed can be set by the program after that. I’ll have an update posted soon.
I have worked a couple of hours in WPX with the keyer in Winkey mode and N1MM logger. This works great – it was’nt required to use the backup keyer Winkey2. I will now move them into an enclosure for final using. I decide me to use the MCP23017 based LCD and Keys later. My 4bit interfaced LCD works pretty nice and i got a bunch of I/O pin’s left for options. I got some experiences with the IIC-Expander – i use 2 of them in my remote symmetric antenna coupler to switch the L,C and low/hi-Pass filter mode.
The MCP23017 is just a little bit tricky in programming but works great if the programmin work is done.
Is a schematic of the I2C-Display available ? Does they use 8 Bit or the 4 Bit Display mode? I/O Pins should not be problem – it’s support 1 x 16Bit or 2x8Bit Bank of I/O pins.
@K3NG: can you imagine to move the source code to sourceforge SVN system ?
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.
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
Yes, absolutely! That would be great. Thanks and 73!
Thanks and good luck in further development! 73!
@k3ng
Did you already try to connect the cw-keyer with the RGB-shield on an UNO or did you switch to the Mega Arduino. I tried it several times but without success. Compiling was not the problem but the upload was not possible due to the 28 KB restriction.
73 de Hajo
I have it connected to an Uno and it is working quite well. I have the display integrated with the command buttons and the PS2 keyboard functionality. If you go up on SourceForge ( https://sourceforge.net/projects/k3ngarduinocwke/files/ ) you’ll see a directory called “in development”. I dropped the latest code in there. I hope to get the documentation updated today or tomorrow with how to compile the LCD functionality, but for people like you who already know the code, it’s pretty easy.
You are correct about the RGB shield code taking a lot of memory. With the PS2 keyboard and RGB display libraries compiled in, I’m up to the limit of an Uno (with the standard boot loader).
Note that this code supports both the I2C RGB LCD and a standard LCD display in 4 bit mode.
I am using Atmel Visual Studio 6.0 and when I “Build” the solution, I get an error “EEPROM.h : No such file or directory.” Where can I find this file and other include files that I may need. I’m using the Arduino Duemilanova with Atmel 328P.
I’m not familiar with Atmel Visual Studio, but eeprom.h and the other standard libraries are included in the Arduino IDE directory structure (i.e. \arduino-1.0.1\libraries\EEPROM\ ). You can download the Arduino software here: http://arduino.cc/en/Main/Software .
Thanks! I knew it was something simple…and I just didn’t see it. :)
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.
Not that I have lots of spare time, but should I give Visual Studio a try? I assume it does emulation of hardware?
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
Thanks a bunch!!
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.
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!
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
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
Visual Studio 6.0 does have limited Arduino support. There is nothing much for the ATmega2560.
Ron
Arduino have limited support of everything. They use the GNU-Toolchain similar as AVR-Studio. I have added a 3party mapping file who supports the 2560. That’s the reason why you need to replace the mapping file to get the support of that kinda mcu. In normal circumstance, it’s enought to change the device in the Project properies. Ardunio developers decided that they uses just one file to map the mcu / Hardware platform. They does’nt resolve the macros of used mcu so you must replace the mapping file.
In Arduino environment, you need to somthing more if you wanna use a different hardware as they promote. I use a naked ATmega1284p for my keyer. This is not supported directly by Arduino.
You don’t have to do much more that just download the project from sourceforge and compile them.
I have predefined all you need. Just set the Pin-Out for your Pin’s – i don’t know what PIN you use for.vy 73 de DD4DA
I have the MarkII and it’s always worked great for me. I’ve tried direct USB to the Arduino and I always got an error message. And, no one seems to have the answer for the error message, so, I’ll stick with the AVRISP MarkII.
checkout the fuse settings
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
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
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.
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
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
I’m using the MCP23008. I like that ULN2803 chip for driving the relays. Thanks for the design idea.
I hadn’t thought about the possibility of doing asymmetrical tuning. Does your unit have current sensors on the two balanced line conductors? I thought of putting current sensors just to measure the current for fun.
I decided me to use an MCP23017 and ULN2803 for driving relays, because the other good available chip was an Phillips PCF8574(A) who’s drive current limit was 1mA each line.This is less than you need for just one LED. The ULN has a limit at 500mA each line, if you switch to GND (low-side). This should be enought fór 24V relay’s that i would recommend you to use. You must know that the Hi-Pass/Low-Pass switch needs min 4 relay’s and 2 needs to switch as tandem. You get a little bit more that the doubled current that’s needed to swich and “HOLD” a longer time.
If the antenna tuner is switched off, the relay’s should be release to bye-pass the load to the feeder line.
The problem that i have not solved is the tranformer who balanced and phase shift (180°) for the symmetric L-C lines. The available core materials does’nt works optimal from1.8Mhz to 30Mhz. I belive that the Guanella-BaLun is the best solution to do that job, but i did’nt checked them out, yet.
Mabye, i can imagine a construction of two balun tranformers – one for the lower bands, one for the higher bands. This is a project until the summer.
Hi guys,
I could use a little help, please. I went through and compiled code rev ’2012070201″ (w/Arduino 1.01) in several stages, progressively toward the feature set I wanted. First as downloaded – compiled fine. Second, I changed several values to get to my personal preferences (sidetone freq, etc – nothing major) – it compiled fine. Third, I tried to enable the PS2 keyboard (created sub-directory [PS2Keyboard] in my sketchbook directory, un-commented the include stmt, #define FEATURE_PS2_KEYBOARD, and PS2Keyboard keyboard; etc) when I try to compile this, it halts on the last stmt (PS2Keyboard keyboard;) and says:” ‘PS2Keyboard’ does not name a type”.
I have rechecked several times to make sure I have all the steps correct but its pretty simple (famous last words!). what else do I need to do or what have I done wrong?? All I’m trying to do at this stage is enable the PS2 KeyBD. Thanks!
Archie KX5X
Hi Archie. Have you uncommented the following line towards the top of the code:
#include
73
Goody
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
Did you create a \libraries\ directory within your sketchbook directory, and then within that a \PS2Keyboard\ directory?
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
we crossed each other –
to answer your question – NO. I’ll try that
Thanks!!
Archie
Roger that. Yea, I’m thinking you need to put the files in this directory:
C:\Users\gpalamb\Documents\Arduino\libraries\PS2Keyboard\
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
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
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?
on its way!
Thanks! – sorry for being such a noob / pita
Archie / KX5X
No worries. I sent you a private email. I think I figured it out. Let me know.
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
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
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
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
As far as I’m aware the Arduino code and hardware supplies only TxD and RxD. Unfortunately I’m not experienced in the AVR environment, but I can tell this is something I should explore in the future.
I think this keyer will work well for your application. As you surmise, it will send good CW regardless of network jitter. At 1200 baud it works flawlessly, however it should be noted that HRD has some minor bugs in the Winkey GUI. I’ve used the keyer with N1MM quite a bit with no problem.
If you’re primarily interested in interfacing with existing logging and contest software, K1EL Winkey emulation is the obvious choice. However, the CLI has more flexibility and is more extensible as it isn’t encumbered by the Winkey standard. But awhile ago I started to code an extension to the Winkey emulation where you could send a $ sign as an “escape” and send commands to the keyer. This could be used for controlling digital lines to control relays and do other things that the Winkey protocol wasn’t intended to do. Let me know if you have any interest in that.
It’s not an advantage to sepperate the CLI and WINKEY interface. You have more cables and more hardware that makes the keyer not cheaper and the wiring more complex. I like the On-Boot-Reset decision – Winkey or CLI. You should remember – this is a keyer electronic to doing morse code, not a general purpose MCU-Board that know’s morse code. This schould it be. Mybe expand the command set of Winkey to switch back to cli and extend the cli to switch to WINKEY – but, i don’t think that this is useful.
vy 73 de DD4DA, Gerd
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
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
Does your are finished with your build yet ?
I used a native ATmega1284p and a MAx232 for Winkey purposes. If USB is avalable only, that’s a job for a simple converter. This is cheaper than a single FTDI chip. I addition, i have replaced the PTT an keying transistors with a quad Opto-coupler like TIL196. The other parts are just socket for Plugs. It’s not required to buid a printed pcb. The used 1284p comes in DIP40. vy 73 de DD4DA, Gerd
Indeed Gerd, another option I am considering for this reduced function set (RS232/Winkeyer2/PTT+KEY) is to put a regulator, MAX232, Atmega328P and a couple of 2n7000 FETs as PTT and KEY switches, all on a piece of veroboard. I nearly did it this morning, but I couldn’t find any MAX232 in stock.
Cheers, Owen (VK1OD).
@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
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
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
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
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
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
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
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.
Pingback: DL7BJ - Keyer-Elektronik für Morsetasten·
Nice project. I am running it on an Arduino UNO. See more at http://www.lb3hc.net Tnx es 73
Hello Marius. I don’t see it on the website you linked to. Is there a page that it is on?
Hi I have an urgent problem. The keyer version K3NG_Arduino_Keyer_2012090501.ino works OK in Ham Radio Deluxe it seems. The board is an Arduino UNO. However in N1MM it sounds like it is reset. It sends “hi” several times when N1MM is started. It suddenly says “winkey not detected” even if I can send to it. Some times it sounds like it resets because it suddenly says “hi”. Do you know what can cause this? I need it for a dxpedition so its urgent. Hope you can help if you have experiences something similar.
Hi Mike. Do you have OPTION_WATCHDOG_TIMER activated? If so, deactivate it in the code and recompile. Do you have the Arduino Automatic Software Reset disabled (which is done by cutting a trace on the Uno PC board)? I highly recommend doing that. Does it make a difference if you deactivate Winkey 2 support( OPTION_WINKEY_2_SUPPORT )?
73
Goody
K3NG
Also, what version of N1MM are you using?
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&catid=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
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. :-)
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?
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
Excellent. Tnx for the pointer. I work on a smaller version with a Arduino Mini Pro (Mega 328).
By the way what is “ASR” and how do I turn it off? I would like to not do hardware mods as I use the board for other things and I dont have access to the reset button. (I have built it into a small chassis already … :) )
Search for “Automatic Software Reset” on this page and you’ll find the section on it above. Follow the link and you can read what it does. Cutting the trace labeled RESET-EN disables ASR. You could put a reset button on the chassis. I’ll email you a configured code file, but again, ASR is likely the problem.
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.
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
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.
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
I’ll have to check at Fry’s electronics when I get an afternoon to head over there…
Thanks!
Pingback: LB3HC's hightech blog » Arduino Based CW keyer / FTDI based CAT interface·
Has anyone had issues with their arduino (nano, in the nanokeyer kit from Oscar) locking up? I have a replicable lockup occurring when I change the sidetone frequency either above or below a certain amount.
I will be bringing this in to load a new version of the code onto it, but wanted to see if anyone’d run into this issue.
Never changed the sidetone in my keyer, since I mostly have it disabled anyway and listen to the radios own side tone…thats why I never experienced this behaviour.
Since you say it is replicable – can you tell at which sidetone frequency it starts to hang?
I’m not able to reproduce the bug with my Nanokeyer, however I may not be doing exactly the same steps or have the same features compiled. If you send me a more detailed process and a copy-and-paste of your features and options, I’ll see if I can reproduce it.
It most likely cannot be an ASR issue, because Owen’s board (according to the website schematic) does not make use of ASR feature. It is all manual reset.
So I assume the bootloader is activated manually and not via the RS232 port automatically, right?
Oscar
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
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.
Updated code posted. Enjoy.
Pingback: Nouveau Firmware pour le nanoKeyer | Actu-Radioamateur Nouveau Firmware pour le nanoKeyer | L'actualité radioamateur, et nouvelle technologie…·
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
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.
Hello Hajo. Do you have these lines set this way:
#define lcd_columns 16
#define lcd_rows 2
This was your default line and I did not change it.
I have not attached the hardware, so this may be the problem.
After I filled the memory, the LCD is stable with 19 wpm. ;-)
In order to accomodate the growth in interest, I am moving support for all my projects and all discussions to this Yahoo Group: http://groups.yahoo.com/group/radioartisan/ . The comments areas on the blog here will be disabled shortly. Thanks everyone for your support. 73 Goody
Hi, 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
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?
Hi Jordi. Unfortunately I can’t definitely answer your question as I don’t have a Due (yet), however I think it’s supposed to be code compatible with the Uno. Just a note – I’ve moved support and discussions to this Yahoo group: http://groups.yahoo.com/group/radioartisan/ . You may want to join over there and post your question. 73 Goody
The code could’nt run on an ARM based MPU like Cortex M3. The destinated platform is ATMEGA MPU based and need the ARDUNIO C++ derivated IDE. I could not see a quick way to port them.
In addition, that’s would be a waste of a nice and fast MPU.
MPU’s like ATMega32 and up will work fine.
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
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
Hello all, we offer HW KIT for this GREAT project.. See http://www.hamshop.cz/open-cw-keyer-c27/open-cw-keyer-i196/
Nice hardware work – uses Optocoupler instead 2N2222.
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
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
K3NG-Keyer in ATMEL-STUDIO 6.
I have uploaded the actually keyer source package with some minor fixes in the ps2keyboard interrupt code. I also fixed some minor bugs in Arduino 1.03 support code that handles the static strings in program flash. This is more a problem of the obsolete macro usage of Arduino IDE as the K3NG keyer code. Some minor fixes in the general enummeration of Pin-mapping code are included that be related by usage the ATMega1284P and ATMega664P processors. Some major design related bugs are still remain in the Arduino support code that will be fixed in the next few days. I will attempt to get in contact to th maintainer of Arduino IDE to get the fixed for all users. For all who uses the external INT0 or INT1 line, keep sense about the Falling/Raising edge who sould be triggered. This seems to be not work proper this time. This is reasoned by the older WINAVR Toolchain who is used by Ardunino. This is also used by the PS2Keaboard.Cpp (and h) file in the keyer Project.
vy 73 de Gerhard, DD4DA
Hi Gerhard, (DD4DA)
Excuse me for the delay in replay, I have been out, and many thanks for the information.
I have received my Due and I have tested some elemental programs and with the the Arduino libraries for easy code works OK, an other think is if you want to use other libraries. I’m playing with a freescale K60 cube and I have curiosity to see how the arduino due work. I’m an “old” electronic engineer that begins to play programing MCU and I would like to adapt the K3NG keying program to set the options by means of a touch screen LCD like the freescale cube unit. and other thing that I wan to do is add the hardware to key by , screen, cathode, or greed blocking I have drawn the schematic 2 years ago but I have been very busy and I have not finished the PCB.
Hiya dear Jordi,
congrads that youre doing the first steps with an K60-100? /120 ? Cube. This are ARM based Cortex-M4 MCU’s and this is running at 100Mhz clock. To port the Keyer on this hardware will not work without extensible modifications – they all reasoned by the timing and differents of variable Typ’s. The Arduino Environment will not help to solve all this hints you will get. In addition, i could not seen the advantage to use a 100Mhz MPU in a CW-Keyer. This MCU has power enought to drive an SDR with an 4096 Point FFT (or more).
For experimentals with MCU’s, i use the RealView ULINK2 JTAG Interface and the KEIL µVision 4 IDE with the GNU-ARM MDK Toolchain. All This works pretty nice. I use an ST SM32F4-Discovery Cortex-M Development Kit that quite cheap and fast. ($15.-) My experiences with the Arduino IDE is more bad as i expected before.
This is reasoned by the beta State of the ARM support of Ardunio. The Toolchain (GNU-CPP) is a litte bit older as the ARM-MDK from KEIL or ATMEL. Try to do some experiments with the Keil kit and send me your EMAIL address. I have some extensions for the KEIL IDE available, that will helps you at the beginning with the ARM Cortex MCU’s.
To get my EMAIL just look at qrz.com.
vy 73 de Gerhard, DD4DA
This is such a great project thanks so much. I was just getting ready to write keyed code for my Arduino when I found this project and it is 20 times more than I wanted… but now I want all of it. Thanks again
Great project Thank You.
I made it on ATMEGA evaluation board using ported software on Atmel Studio 6 on ATMEGA1284P processor, wth all the functions included.
Currently i am working on final hardware implementation: LCD display, PS2 Keyboard, USB connections, 9 memory buttons, 4 transmitters, for each separate kay and PTT output isolated by photomos relays.
I have just completed PCB’s design using Eagle.
Testing keyer on evaluation board I found some areas that could be better:
1. For multi Tx implementation it would be nice to have PTT / key delays timers set up independantly for each transmitter and possible to be changed by kayer commands. Currently key / ptt delays can be set only during compliation and are common for each transmitter.
I plan to connect IC-7000 (No delays needed), FT290RII ( just short delay) and…. Uniden 2020 (100ms leading and another 100ms trailing delay neccesary). Impossible to find compromise values for this set of radios.
2. Great feature is to entar macro into macro, however only first macro is transmitted. I.e: \p1 SP5IOU , \p2 CQ CQ DE \1 \1 \1 PSE K.
When I invoke memory 2 it will transmit: CQ CQ DE SP5IOU
Remaining content of memory 2 will not be transmitted.
3. When Autospace is ON, LCD displays kayed characters only when spaces between characters are long enough, even longer than just character space. Text is transmitted correctly, but not displayed or partially displayed on LCD display. When autospace is off – text is displayed correctly.
4. I prepared hardware to be possible to adjust LCD contrast and LCD light LED adjusted using commands, but it is not implemented in software. It would be nioce to have it controlled by PWM’s.
There just features mentioned as nice to have. But software is great and ready to use. I didn’t find anything better.
Great feature is K1EL Winkey emulation. I tried it with Ham Radio Deluxe – works fine toegether with own Adruino Keyer features.
Congratulations and many thanks for this great project.
When my hardware implementation will be ready and tested I plan to publish it for everybody.
Cortex implementation mentioned im post above is a great idea. I though also about it, Keyer with touchscreen display, virtual keyboard etc. I have such Kit.
Maybe for the next step.
Hello Marcin. Thanks for your email and compliments. Here are my thoughts on the items you mention:
1. This would be a good feature. I will add it to the list for development.
2. The macro to call another memory was intended to be a “jump” function whereby the keyer would jump from one memory to another and not return to the memory it was called from. But I will put on the feature request list what you are looking for. I’m not sure, however, how to prevent people from programming endless loops (i.e. memory #1 calls memory #2 and memory #2 calls memory #1).
3. Thanks for reporting that bug. I will put that on the list for investigation and repair.
4. That is a good idea as well. I will put that on the list.
73!
Goody
K3NG
@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.
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
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
Hiya Marcin,
the code is now ported and available at Sourceforge.net.
vy 73 de Gerhhard, DD4DA
Have fun
Hi to all,
first to all I want to thanks the collaboration, help and advises of K3NG (Goody) and DD4DA (Gerhard).
I’m finishing the hardware design for a new version of the K3NG Arduino keyer and I want to post it in order to know opinions and suggestions to add more features, improve or correct this non profit version.
Features:-
External 12 battery, or main AC supply.
Hi Voltage key operation 4200V. this feature will give the possibility to work with HI power tube TX, in grid, cathode or screen modes. The switch is a discrete IGBT opto-drived gate controlled that permits to key the TX fully isolated.
Wire Less key operation. By means of a tree channels IR receptor, could be possible to work in standard iambic mode or paddle squeeze. (I have designed too the TX module to adapt to the paddle ).
Possible use of 3.2″ LCD TFT + touch screen (for example SaintSmart) or the I2C model.
Contrast LCD potentiometer Control.
Capability of Headphone or Speaker with volume control pot.
All TX-RX signal optocoupled, allowing negative or positive keying.
Speed potentiometer control.
Key board entry.
6 or 12 memory selected by means of a miniature rotary switch.
Set-UP button control.
3 TX-RX outputs for standard TX an 1 for HV Tube TX.
And the fully features that the K3NG and collaborators have introduced until today, and I know.
Modular concept: This construction mode permits not only to assembly the modules that fits your today work mode exigences and after will give the possible updates for the future needs, it make possible too design or adapt a different CPU platform or any custom hardware module modification that the user wants, without to change the fully keyer.
Modular construction.
A base board to plug on:
CPU module for the version Mega 2560.
IGBT driver and protections (all the signals opto-isolated).
IR 3 channels receptor
The base board build in circuits:-
VCC supply -12, +12, +20, +3.3, +5 (+3.3 and 5 could be used of the Arduino board, but are preview for future CPU modules versions without VCC supplies).
Square to sine converter and audio amplifier (to use with earphones or speaker).
Signal decoder (new feature from K3NG).
Frequency Counter (new feature from K3NG)
Project situation:
At this moment the electronic design (schematics) are finished only waiting for a first test to adjust values and retouches the possible mistakes.
PCB design I have only finished pending to retouch (overlapping, angles out of greed etc. ) the IGBT driver and protection module.
I wait for your feedback.
When finished I will post the full information
Note the schematics are too big to be inserted, if there are any people that are interested in, please ask me and I will email it to you
Hi 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?
Hi Gerhard,
The IGBT driver could use a negative gate blocking, normally only used to drive IGBT modules but in a HV-Hpower tube keying I prefer use this driving mode. then for IGBT driving I need 5Vcc for entry logic, +15VCX for isolated logic and IGBT ON gate, -15VCX for IGBT OFF gate. The Inverting circuit to generate -VCX employ +20VCI. the 5V and 3.3V are for CPU and general keyer logic and the -12/+12 is used for UAF42 square to sine converter (head phone) and audio amplifier (speaker).
I immediately will email you the schematic.
Hi there,
a nice project!!! I like it. I am familiar with the IDIOMPRESS timing (or ETM9COG in DL).
Is this special timing implemented, or can it be?
There is an project, called OPEN keyer. There are 2 commands in it to controll the CMOS-SUPER-KEYER timing:
—————————-
BC – Cmos Super Keyer timing oN/oFf [N]
Query or set iambic mode B emulation of the Cmos Super Keyer III. This setting is only relevant if mode A is
turned off using command “AF”. See section “Keyer modes” for details.
BR – Cmos Super Keyer ratio [33]
This setting can be used to adjust the Cmos Super Keyer timing. This allows a continuous setting between 0%
(normal mode B) and 99% (similar to mode A).
——————————————————
Thanks for reading. Is something like this implemented in the code?
I am not familiar with programming, so please excuse my question.
73, Andy, DL1AKP
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
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
Hi Goody, I left the percentage at 33% default.
Do you know the timing and meaning of this value?
73, Andy
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.
The OPENKEYER project keyer is very similar. But seems not be maintained any longer…
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
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
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.
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.
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
Andy, what errors did you get?
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
Many thanks Oscar. Will try it this way.
73, Andy
Hi Oscar. I see an error in my instructions. I will fix. Thanks
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
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
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?
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
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.
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
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
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