Best way to operate CW

1,814 views
Skip to first unread message

Mathis Schmieder

unread,
Feb 3, 2020, 2:07:11 AM2/3/20
to Hermes-Lite
Dear Group,

Sorry if this question seems dumb, out of place or has been answered hundreds of times, but I couldn't find a definitive answer. What is the intended/best way to do CW with the HL2? Is it possible to "just" connect a keyer to the stereo jack to get the FPGA to create the baseband signal, or does it have to be created by the SDR software?

Thanks & vy 73,
Mathis, DB9MAT

Matthew

unread,
Feb 3, 2020, 2:38:02 PM2/3/20
to Hermes-Lite
Yes, connecting a straight key or output from a keyer to the HL2 front jack works fine. There is no sidetone as such. Quisk and SparkSDR (I'm sure other SDR software can too) listen to the transmitted signal (with latency), I find this usable up to around 12-14 wpm.

For remote CW, SparkSDR with experimental features turned on has some good support for keyboard CW. I believe there are plans for interfacing a key/paddle to a PC, some gateware changes are needed and SDR software will need to support this. Watch this space.

73 Matthew M5EVT.

Steve Haynal

unread,
Feb 5, 2020, 12:22:20 AM2/5/20
to Hermes-Lite
Hi Mathis,

Currently a straight key or keyer connected to the tip of the front panel connector is the recommended CW method. There is work underway. I'd like a method that works remotely and therefore can also work locally. Check out these keyers:


73,

Steve
kf7o

Ronald Nicholson

unread,
Feb 5, 2020, 2:08:32 PM2/5/20
to Hermes-Lite
The scheme I'm currently working on is to have a Raspberry Pi intercept the UDP data stream to the Hermes Lite and insert a keyed waveform.  

A key (paddle or straight) can be read directly from the Raspberry Pi's digital GPIO pins, which provides the lowest possible latency without using the Hermes front panel. Much lower than MIDI or USB latency.  Plus there is the option of having the Pi insert computer generated CW macros as well, and also possibly generating a side-tone (with an audio output hat and speaker connected to the Pi) .  

Also note that this network UDP intercept method will work either locally or remotely.  Adds slightly to the receive latency, but greatly shortens the programmatic output latency.

Ron
N6YWU

Don Solberg

unread,
Feb 5, 2020, 7:02:14 PM2/5/20
to Hermes-Lite
Another very good keyer is the K1EL WinKeyer https://www.hamcrafters2.com/WKUSBX.html

I hooked one up today to my HL2 to try and work TI9A. I hooked up both the key line and PTT.  The WinKeyer has a configurable PTT delay and PTT hang time when the keying is completed. I adjusted the PTT delay to make sure that my amplifier was ready for input.  It worked very well at 30 wpm.

I was using saved messages from a keyboard, but it also supports using paddles and provides an internal speaker for sidetone.

73,

Don
K9AQ

Christian

unread,
Feb 6, 2020, 6:16:19 AM2/6/20
to herme...@googlegroups.com
Hi all,

Yes this keyer seems the reference (For N1MM, Log4OM,....). Do you know
if it's possible to build this type of keyer with the firmware available
here <https://www.hamcrafters2.com/WinKeyer_31.html> ? The schema
<https://www.hamcrafters2.com/files/WKUSB_LITE.pdf> of the interface
could be very simple : Only one PIC with some extra components
<https://www.hamcrafters2.com/WKlite.html>.
73s Christian F8GHE


On 06/02/2020 01:02, Don Solberg wrote:
> Another very good keyer is the K1EL WinKeyer
> https://www.hamcrafters2.com/WKUSBX.html
>
> I hooked one up today to my HL2 to try and work TI9A. I hooked up both
> the key line and PTT.  The WinKeyer has a configurable PTT delay and
> PTT hang time when the keying is completed. I adjusted the PTT delay
> to make sure that my amplifier was ready for input.  It worked very
> well at 30 wpm.
>
> I was using saved messages from a keyboard, but it also supports using
> paddles and provides an internal speaker for sidetone.
>
> 73,
>
> Don
> K9AQ
>
> On Tuesday, February 4, 2020 at 11:22:20 PM UTC-6, Steve Haynal wrote:
>
> Hi Mathis,
>
> Currently a straight key or keyer connected to the tip of the
> front panel connector is the recommended CW method. There is work
> underway. I'd like a method that works remotely and therefore can
> also work locally. Check out these keyers:
>
> https://blog.radioartisan.com/arduino-cw-keyer/
> <https://blog.radioartisan.com/arduino-cw-keyer/>
> https://www.aliexpress.com/item/33012008913.html
> --
> You received this message because you are subscribed to the Google
> Groups "Hermes-Lite" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hermes-lite...@googlegroups.com
> <mailto:hermes-lite...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hermes-lite/ffac9ae3-2b47-4e81-a8d8-410106442ad7%40googlegroups.com
> <https://groups.google.com/d/msgid/hermes-lite/ffac9ae3-2b47-4e81-a8d8-410106442ad7%40googlegroups.com?utm_medium=email&utm_source=footer>.

Don Solberg

unread,
Feb 6, 2020, 8:39:51 AM2/6/20
to Hermes-Lite
Christian,

The PIC comes pre-programmed so it should be fairly easy to build your own keyer.  But why bother, he offers low cost kits https://www.hamcrafters2.com/K16keyer.html

73,

Don
K9AQ

Christian

unread,
Feb 8, 2020, 8:44:42 AM2/8/20
to herme...@googlegroups.com
Don,

Ok, but these low cost KIT K16 does not integrate all the functionality
of the High End Kits like WKmini or WKusb. In particular the serial port
for interfacing with a PC.

These 2 families of PIC are used :

* Low cost with 7 legs PIC 12F1840
* High End with 14 legs PIC 16F888 and I/F FT232

Max

unread,
Apr 13, 2020, 4:54:00 PM4/13/20
to Hermes-Lite
Does anyone by now have any updates or experiences on operating CW with HL2? I guess my main question is therefore, operate using key jack on front panel, or some other method via the PC? I am guessing via the PC is the technically preferred method? If so, how? Audio tone via USB/LSB or other method?

Hope this is not a stupid question, but is it possible to use mono 3.5mm jack in the front panel KEY/PTT socket, or does this result in PTT being permanently activated? Was not sure if PTT triggers on earth or change of state? I have an old very basic Iambic keyer (G3KHZ board), no memories so my requirements are very basic. It has single circuit output, key up/key down..... hence the "mono-jack" question, but I could be persuaded to build a new keyer, perhaps the Nano keyer kit. Prefer to use what I've got to hand though.

My preferred SDR software is SDR Console. Is anyone else using this to operate CW and if so, any preferred methods? What to do about side-tone or perhaps monitoring TX live using heavily de-gained receiver? Is this method even practical? I have always preferred love monitor of the TX signal via the RX instead of sidetone but perhaps that is not possible or practical with SDR or there may be some limitation of the HL2 in this regard? 

Latency issues for both direct keying and PC keying? I am not a fast operator so I guess latency possibly not  a big issue for lower speed senders like me (up to 20 wpm)?

Any tips or thoughts greatly appreciated as information on operating CW in HL2 seems a little thin, unless I missed it. Yes, I did read the thread about keyboards/keyers, but it is the actual practical operation of the HL2 for this mode I am interested in, not the keyer device itself.

73

Max



On Monday, 3 February 2020 07:07:11 UTC, Mathis Schmieder wrote:

Matthew

unread,
Apr 14, 2020, 4:21:38 AM4/14/20
to Hermes-Lite
Hi,

I've never used SDR Console so can't comment on any of your questions about that. I have used SparkSDR and Quisk for CW operation with a keyer (and straight key) plugged into the CN4 jack on my HL2.

A few comments:

- You should be able to test the tip/ring behaviour of CN4. In SparkSDR, PowerSDR (perhaps Quisk too) you can set the hardware managed CW hang time. Set the delay to 1 second. Short the ring to ground (I always have a pair of tweezers on my bench for such things!). If you have a 1 second delay before a relay click, you have an answer to your question. With tweezers and listening to the relay, you should be able to figure out tip and ring behaviour on CN4. I think it would be easier to make a new 3.5 mm cable than build a new keyer!

- I believe some people are using Windows software external to SDR software to perhaps achieve what you might want? I haven't tried this, but it might give you some ideas to experiment with? https://groups.google.com/d/msg/hermes-lite/uCaBcsMyQO4/URuEUwnyBAAJ

- Quisk and SparkSDR let you monitor you transmitted signal, but there is latency. I found this affected my ability to send above about 15 wpm.

- I've not used this feature, but with PowerSDR, you can key the HL2 from a PC serial port. I don't know how you hear the sidetone for this. I think you would have to use duplex mode in the software. But this would suffer latency because you are hearing the latency from key down -> packet sent to HL2 - TX -> Rx packet sent to HL2. At speeds higher than about 12-15 wpm, I find this affects me.

- Spark SDR has MIDI based keying, sidetone is produced in the PC and doesn't have to "make the trip" via the radio and back. I have tested this and at 30 wpm I can't "feel" the latency. I commented on this here, https://groups.google.com/d/msg/hermes-lite/Cq7dyiBru6U/2B6PKeXSBwAJ. This is, in my opinion, the best way forwards for CW with SDR.

You will need to buy a suitable microcontroller board (I used an Arduino Leonardo, Pro Micro Arduino is much cheaper but is essentially the same), then upload this firmware: https://github.com/ahopper/sparkey. Perhaps you can persaude the SDR Console author to add MIDI keying (and sidetone in the PC) if it doesn't already have it?

Enjoy your experimenting and perhaps report back with your findings. With a github account (free to setup) I believe anyone can add a note to the wiki for things like this. I appreciate a lot of good info is scattered in threads on this group.

73 Matthew M5EVT

Matthew

unread,
Apr 14, 2020, 4:25:36 AM4/14/20
to Hermes-Lite
I forgot to add, before starting any experiments, I recommend getting the latest gateware on your HL2, see https://groups.google.com/d/msg/hermes-lite/MqTytyhsPlM/z3ixVF1BAQAJ

73 Matthew M5EVT.

Max

unread,
Apr 14, 2020, 4:41:15 AM4/14/20
to Hermes-Lite
Hi Matthew

Many thanks for coming back. All very useful information. From your comments the Midi keying route with sidetone does sound very interesting. I think Simon G4ELI (SDRC author) may be across this group anyway so maybe he will comment if he gets time to read. I will also mention on the SDRC IO Group discussion.

73

Max



On Tuesday, 14 April 2020 09:21:38 UTC+1, Matthew wrote:

James Ahlstrom

unread,
Apr 14, 2020, 7:56:10 AM4/14/20
to Hermes-Lite
Hello Max,

Regarding the mono plug, I think you should just replace it with a stereo plug. The mono wire goes to the tip. Or you could wire a stereo plug to mono jack adapter and leave the ring unconnected. Or you could buy a short stereo jack to stereo plug cable, cut it open and break the ring wire.

The HL2 can generate excellent CW from its hardware key jack. But sidetone is a problem. Although Quisk can generate a sidetone, the latency is too large at 20 wpm. Monitoring the received audio will not work on any SDR because of latency. Alan of Spark fame is using MIDI to generate a sidetone. I am working on a solution too. A simple solution is to attach a local audio oscillator to the key jack with diodes to isolate the signals.

This group is at work on a way to operate CW from an HL2 located remotely. The problem is reading the key presses from the PC and maintaining the accuracy of CW timing at the remote HL2.

Jim
N2ADR

Don Solberg

unread,
Apr 14, 2020, 8:41:22 AM4/14/20
to Hermes-Lite
Max,

I didn't see your question about anyone having any experience operating CW on HL2 until today.  

I have used the HL2 to operate high speed (30+ WPM) on DX pileups.  I have used both AFSK CW with MRP40 and running audio through the PowerSDRmXPS audio chain, and also using a K1EL WinKeyer.  MRP40 works well but there is a significant amount of latency in the audio chain.  When I tried using it I was using MME audio drivers.  I have since upgraded to a Behringer UMC202HD soundcard, which supports ASIO drivers.  This now gives me a lot less latency but I haven't tested it with MRP40.

The WinKeyer works perfectly, in addition to keying the HL2, it also provides a PTT output and audio sidetone.

73,

Don K9AQ

Alan Hopper

unread,
Apr 14, 2020, 8:54:10 AM4/14/20
to Hermes-Lite
Hi Max and all,
I've just scribbled some documentation of the current state of cw in spark here https://groups.google.com/d/msg/sparksdr/iWb5npsepnQ/om8quSl7CgAJ I think it is now fairly useable both with a straight key or keyer  plugged into the radio or via midi but would really like to get some more feedback on it.
73 Alan M0NNB

Max

unread,
Apr 14, 2020, 11:01:18 AM4/14/20
to Hermes-Lite
Hi Jim, Don and Alan

Many thanks for all comments. All very useful and interesting. The midi/sidetone route sounds perhaps the best route to go. Also Don, you mention MRP40. I am not really too interested in morse readers HOWEVER I am pretty rusty after many years lay-off so I was planning on running reader in the background as "belt and braces" to make up for my deficiencies. I was not aware of it and just downloaded and gave a quick trial.... that is a very impressive decoder!

Regarding the main question, it seems then that the midi route with sidetone may be the most technically proficient way to go at the moment to ovecome latency issues.

Jim....... you mention the group working on a remote solution. Any hints as to which direction that is coming from? Midi or something else (or can't say yet maybe?!).

73

Max

Alan Hopper

unread,
Apr 14, 2020, 11:30:56 AM4/14/20
to Hermes-Lite
Hi Max,
if you want perfect sidetone, Jim's suggestion of an audio oscillator connected to the key or a keyer with sidetone is probably best. I think the sidetone in Spark is probably getting good enough for average use, just to be clear the midi is used to connect the key to the pc, the sidetone is generated on the pc and mixed with the other radio audio.  If you are sitting next to the radio, plugging the key directly in to it only delays the sidetone by a few ms vs midi so might be the easiest thing to try first.
73 Alan M0NNB

Max

unread,
Apr 14, 2020, 11:56:52 AM4/14/20
to Hermes-Lite
OK thanks Alan. Noted. So midi from keyer to PC just results in the lowest latency? I think I got it.

73

Max

Don Solberg

unread,
Apr 14, 2020, 1:04:22 PM4/14/20
to Hermes-Lite
Max

The decoder in MRP40 is awesome.  For keying you can use audio, which is what MRP40 recommends, or you can interface it to a Winkeyer, which is what I am doing.

The best CW decoder that I have found is CW skimmer.  For DX pileups this is what I use.  I am a fast typer so I use a keyboard to a Winkeyer.  

73,

Don
K9AQ

James Ahlstrom

unread,
Apr 15, 2020, 8:05:58 AM4/15/20
to Hermes-Lite
Hello Max,

Regarding remote HL2 CW, Alan is working on a MIDI solution and I am working on two approaches I am publishing today. I am not sure what will be adopted by the group. I think it is best if we arrive at one solution so people can use various SDR software with whatever hardware they have chosen.

Jim
N2ADR

James Ahlstrom

unread,
Apr 15, 2020, 8:40:56 AM4/15/20
to Hermes-Lite
Hello Max,

I am not convinced yet that MIDI can generate a fast enough sidetone. There are many sidetone oscillators out there. Here is one which uses a free running oscillator and an analog switch for high speed.

Jim
N2ADR

Max

unread,
Apr 15, 2020, 10:18:37 AM4/15/20
to Hermes-Lite
Many thanks Jim. Both posts noted. Yes, I am beginning to realise that the sidetone seems the most practical proposition but I am watching all developments with great interest.

73

Max

James Ahlstrom

unread,
Apr 15, 2020, 10:44:21 AM4/15/20
to Hermes-Lite
Hello Group,

I have been working on how to connect a key to a PC and use it to key the HermesLite2. I finally finished my testing. The results are of general interest so I wrote a paper and put it on my web page.

My focus is on high speed and high quality CW operations including contesting. These CW operators will already have a keyer, paddles and a whole software infrastructure. The keyer probably connects to the PC via USB to support keyboard CW and to quickly change parameters. They may have CW decoders and contest logging software attached. I don't have the skill necessary to reproduce all this on a PC. Look at all the options available in the K1EL WinKeyer. There are many Arduino keyers, loggers and decoders out there, and they all have their adherents. I want Quisk to work with all of this without getting in the way.

If the HermesLite2 is located at the operator's position, I think the problem is solved and nothing more is required. The HL2 can produce excellent CW from its key jack. The HL2 does not produce a sidetone, but most keyers will have a built-in sidetone anyway. If they don't, an external oscillator and the circuit in Figure 3 in the above paper will work well. I have not tested this http://www.morsex.com/misc/ttone.htm but it looks good on paper. It uses a free running oscillator and an analog switch to eliminate oscillator startup delays. I think that even for casual CW operation this is the preferred approach.

The situation changes if the HL2 is located remotely, and that is the real focus of the above paper. As soon as Alan and others measure MIDI and other approaches we can sort out how to do remote CW.

Jim
N2ADR

Pete Ferrand

unread,
Apr 15, 2020, 1:25:55 PM4/15/20
to Hermes-Lite


My primary interest here has been cw, and most of the solutions here seem complex. My interest is to use a standard key, bug, or paddles to key a local HL2. I was very disappointed when I found I couldn't use the same PowerSDR setup for cw as I have with SDRs for the last dozen years under Windows. PowerSDR in the HL2/mrx version didn't accept the normal serial port inputs for keying. 

Don't try to put a mono plug into the HL2's TRS keying connector, many times that will damage the connector. Using the key input to the HL2 works well but on the scope the keying looks a little harder than I like, but I haven't done a thorough check for clicks on all bands. It also now correctly switches PowerSDR and SDR-Console. Using the t/r input to the HL2 also works well, and I have that connected to the station t/r switch for other modes, and for non-semi QSK operation.

Sidetone has never been an issue for me. I use a conventional keyer (AEA MM3) for all the transmitters in the station and like most keyers it has a built in sidetone - why would I need anything else? It's been working for the rigs since the 1980's. That way every transmitter in the station has the same sidetone characteristics. 

Pete, WB2QLL

Alan Hopper

unread,
Apr 15, 2020, 3:41:39 PM4/15/20
to Hermes-Lite
Hi Jim,
interesting stuff. I wonder if your windows results are caused by the machine running with the default power saving low resolution clock, the windows call timeBeginPeriod(1) might help here or using one of the higher thread priorities like 'Pro Audio' with AvSetMmThreadCharacteristics.  I'll try and measure the midi latency/ jitter over a longer time over the few days. A rough estimate puts it at <2ms as the delay I measured  including audio output would not have been possible if it were any longer given the audio buffer sizes used.  I agree that side tone from the keyer is always going to be the closest to perfect, generating good sidetone in the pc is a fun challenge and may be good enough and simpler for some uses e.g. a straight key used slowly (me at the moment:)).  One advantage of sidetone from the pc is the audio is all coming from the same place so headphone use is simpler, I did think of adding an audio mixer into the interface box so direct keyer sidetone can be mixed with the radio audio and sent to headphones.

73 Alan M0NNB  

Matthew

unread,
Apr 15, 2020, 3:55:09 PM4/15/20
to Hermes-Lite
Pete,

For the past few months gateware has had CWX mode enabled. Gatware marked stable with this enabled can be found here:


With this gateware you should be able to key a serial port in PowerSDR with CWX. If this doesn't work and you are certain PowerSDR is configured correctly for the HL2, perhaps raise an issue here:


As far as I'm aware, I'm the only person that has been using CWX on the HL2(?) and it has been working for me for over 200 qsos now.

I think Jim and Steve both worked on the CW rise time in gateware and I've not noticed any problems in my on air CW operation with the HL2 and looking at waveforms on a scope. The beauty of a project like this is a healthy quantity of testers. Please do report back if you find any clicks with the rise time on any bands.

Personally, I would echo Jim's comments that keying the HL2 from CN4 is near perfect for me.

73 Matthew M5EVT.



73 Matthew M5EVT.

Pete Ferrand

unread,
Apr 15, 2020, 10:00:57 PM4/15/20
to Hermes-Lite
Hi Matthew, thanks for the response. I've used CWX and it will key the HL2 nicely with the macros, but I wasn't able to get it to respond at all to the serial port. I'll try it again in a few days.

Pete

Matthew

unread,
Apr 16, 2020, 6:04:11 AM4/16/20
to Hermes-Lite
I don't have a Windows machine so can only run PowerSDR using Wine in Linux. Unfortunately, in a quick test I can't get the serial ports to work properly in Wine so I can't be much help (like you, keyboard macros work via the CWX window). The fact that CWX via macros works gives me a strong suspicion this is not a bug with the HL2 and the problem will lie in Windows/PowerSDR. Perhaps some other Windows+CW users can comment?

73 Matthew M5EVT.

James Ahlstrom

unread,
Apr 17, 2020, 8:30:14 AM4/17/20
to Hermes-Lite
Hello Alan,

Thanks for the pointers to Windows software. I will try again on Windows when I get a chance.

Do you know if Windows WaitCommEvent() is supposed to work with a USB serial adapter?

I have not decided whether to release this code or not. I don't want to be in the position that a user must buy one sort of hardware for Quisk and a different hardware for Spark. I look forward to your MIDI measurements.

Jim
N2ADR

Matthew

unread,
Apr 17, 2020, 8:36:46 AM4/17/20
to Hermes-Lite
Jim,

I'm not sure if you have seen my post regarding measuring the MIDI latency using SparkSDR in Linux https://groups.google.com/d/msg/hermes-lite/At-Olx59LBA/vlMEt8ADCgAJ

It would be good to get a cross check on these measurements.

73 Matthew M5EVT.

James Ahlstrom

unread,
Apr 18, 2020, 8:27:50 AM4/18/20
to Hermes-Lite
Hello Matthew,

Yes, thanks for the link. The 12 msec seems very good. But 60 wpm Morse has a dit length of 20 msec. If the 12 msec is constant, it is just a short delay and may be OK even for high speed CW. If it is variable, not so much.

I added a sidetone sound latency test to my paper. With an oscilloscope connected to the key and the other channel connected to the sound output, the delay is less than a couple hundred microseconds. This is unsurprising for a microcontroller.

Jim
N2ADR

Alan Hopper

unread,
Apr 19, 2020, 6:59:28 AM4/19/20
to Hermes-Lite
Hello Jim,
I've just tried something similar to your first serial test, I simply echo back the midi message to the arduino from spark and pulse an output bit when a message is recieved. With a scope on the key and the output the delay was between 0.4 and 0.6 ms over 100 or so goes. This was on a 9 year old sandy bridge I5 on windows. I totally agree with you about having the same hardware for all software. I do favour midi as it was designed for low latency and there are cross platform libaries for it (plus I have already implemented it :) ), but powersdr already uses serial and you appear to favour it so if it can be made to work well on all platforms I could be tempted.
I don't know about WaitCommEvent() with usb devices, it might be worth looking at the powersdr source to see how serial is used as it appears to work well enough there.

This test also confirmed that sending midi back the the arduino works so could be used to set parameters on the interface.

73 Alan M0NNB

Alan Hopper

unread,
Apr 19, 2020, 11:33:43 AM4/19/20
to Hermes-Lite
Hello again Jim,
I like you idea of sending a time stamped serial packet more than using cts/dsr, some comms libaries don't appear to give easy access to these pins and I'm not sure if usb arduinos can emulate them.
There are a number of Auduino projects that do midi over serial and use things like this to inject into the computers midi https://projectgus.github.io/hairless-midiserial/ . The source code for this is interesting and appears to try various driver level tweaks to minimise serial latency, my feeling is midi avoids having to go this far to get good performance.

I have been asked to add direct serial input to Spark to avoid hairless for homemade serial controllers with knobs and buttons etc.  This could be reused for serial cw.   I wonder if using the same fake midi protocol would make sense if we use serial for cw, the pro micro I'm using is quite happy sending serial and midi.

For people already with a favourite keyer a simple interface with sidetone makes a lot of sense.  The down side is you probably end up with both the keyer and the interface plugged into the pc. I would like to end up with just one box and cable and am hoping we can convince someone to add midi or your protocol to an existing keyer like https://github.com/k3ng/k3ng_cw_keyer .

For my own use I was planning to build a couple of knobs and a few switches into my interface for tuning etc.

73 Alan M0NNB  

James Ahlstrom

unread,
Apr 19, 2020, 3:20:49 PM4/19/20
to Hermes-Lite
Hello Alan,

I will need a couple of days to digest your comments, as I am having trouble with my time stamps. I need to play the CW time stamps some tens of milliseconds behind real time. But I am having trouble with clock rate differences between the PC and the MCU.

I am using the Arduino API so I can be portable across multiple MCUs. But the Arduino Serial interface only supports read/write data, not control lines like CTS. For CTS I will use a generic USB to Serial adapter, but generate the same time stamps the MCU would generate. If we go with MIDI, then the USB-Serial will generate MIDI messages.

Jim
N2ADR

James Ahlstrom

unread,
Apr 21, 2020, 5:27:07 PM4/21/20
to Hermes-Lite
Hello Alan,

I think I now have about 4E-1 of a clue about MIDI. It looks like your Arduino code emulates a real MIDI device, so no serial2midi software is required. So it can send MIDI NoteOn/NoteOff messages to the PC. But what are you using as a software synthesizer? Something has to generate the PCM data to be played. And what decides the "instrument" that is playing? Somehow you need to decide to play a piano, violin or sine wave.

Was the 12 msec MIDI time that was reported measured from key down to speaker output for the sidetone, and not the RF out from the HL2?

Jim
N2ADR

Alan Hopper

unread,
Apr 22, 2020, 2:43:14 AM4/22/20
to Hermes-Lite
Hi Jim,
I'm purely using midi for low latency input, the sidetone is generated in software directly in the spark portaudio callback to avoid all but the system audio buffer. On windows the time from key down to pc speaker out was < 7ms https://groups.google.com/d/msg/hermes-lite/Cq7dyiBru6U/9YpgQ7kIFwAJ, the 12 ms was recorded by Matthew on linux and I assume was the same.

Using a midi instrument to play the sidetone is interesting and might be worth a try but configuration and ui to select device and instrument put me off. ( not sure anyone would want to hear my cw played on a strad though :))

I'll remeasure all the various latencies again as gateware and software have both been tweaked.

73 Alan M0NNB

Matthew

unread,
Apr 22, 2020, 3:36:46 AM4/22/20
to Hermes-Lite
Yes, my results were from key down to PC speaker output using SparkSDR in Linux with PulseAudio (no clever PulseAudio daemon settings).

73 Matthew M5EVT.

James Ahlstrom

unread,
Apr 22, 2020, 8:04:41 AM4/22/20
to Hermes-Lite
Hello Alan,

If I have this right, we are in this position. To use MIDI, we start with a microcontroller that appears to the PC as a real MIDI device. A serial device followed by a serial to MIDI converter will not work because (1) the PC will not provide fast processing to the serial port, and (2) if the serial port is fast enough we can use it as a switch and we don't need MIDI.

The microcontroller generates MIDI note on/off messages in response to the CW key. These would normally go to a sound synthesizer to generate musical sounds, but here we route them to an internal synthesize that generates a sidetone and sends it to the sound card. So MIDI is only used as a switch; or in MIDI-speak, only the sequencer is used.

I presume the MIDI messages in Windows are retrieved with MidiInProc, and there is something similar in Linux.

So we now have three switches, MIDI, CTS/DSR and my time-stamped messages from my microcontroller. There is probably a way of merging some of these. My problem is that I need a way to quickly start a sidetone on a sound card. My latency is currently too high no matter what kind of switch is used.

Jim
N2ADR

Alan Hopper

unread,
Apr 22, 2020, 5:48:01 PM4/22/20
to Hermes-Lite
Hi Jim,
I'm using managed-midi https://github.com/atsushieno/managed-midi from c#, there are rtmidi https://www.music.mcgill.ca/~gary/rtmidi/ and portmidi http://portmedia.sourceforge.net/portmidi/ which both have c apis and are cross platform.

73 Alan M0NNB

James Ahlstrom

unread,
Apr 23, 2020, 11:47:50 AM4/23/20
to Hermes-Lite
Thanks Alan. I almost solved my problem with time stamps. But I can not get prompt sidetone output yet. It is so much easier to have an external sidetone attached to the keyer.

Jim
N2ADR

Matthew

unread,
Apr 23, 2020, 12:25:00 PM4/23/20
to Hermes-Lite
Hi Jim,

Are you using alsa or Pulseaudio to try and get a prompt sidetone? I've fumbled my way to a point where I think I know some of the params to achieve low latency from both alsa pcm_writei and Pulseaudio pa_simple_write. However, I am certainly not claiming to be an expert. If you want to discuss, drop me an email.

73 Matthew M5EVT.

James Ahlstrom

unread,
Apr 24, 2020, 7:50:00 AM4/24/20
to Hermes-Lite
Hello Matthew,

I support four sound systems: alsa, pulseaudio, portaudio and directx. So I am trying to find a scheme for each. Or better yet, a scheme that works on all. It is early times still, so let me work on this a bit more.

Jim
N2ADR

Steve Haynal

unread,
Apr 24, 2020, 9:23:52 PM4/24/20
to Hermes-Lite
Hi Max,

You've seen many suggestions already on this list. I and several others are interested in doing CW slightly differently and support remote CW through the PC. This way it doesn't matter if your HL2 is in the same room or another. This is a bit of a fun challenge and work in progress. CWX and other keyboard-based CW operation has also been mentioned. Also, as mentioned, many people plug a key or keyer into CN4 and ground the tip to produce CW. Other CW operators like to use one of JI1UDD's forks. With an add on board you get back the audio and keyer that was in the original Hermes, but have only 2 receivers, must use older gateware and must have your HL2 right in front of you. Frankly, having a fork of the HL2 gateware is a sore spot with me, and in the past I have offered to help anyone with interest and Verilog expertise integrate these changes back into the main gateware by making the main gateware more amenable. That offer still stands.

73,

Steve
kf7o



On Monday, April 13, 2020 at 1:54:00 PM UTC-7, Max wrote:
Does anyone by now have any updates or experiences on operating CW with HL2? I guess my main question is therefore, operate using key jack on front panel, or some other method via the PC? I am guessing via the PC is the technically preferred method? If so, how? Audio tone via USB/LSB or other method?

Hope this is not a stupid question, but is it possible to use mono 3.5mm jack in the front panel KEY/PTT socket, or does this result in PTT being permanently activated? Was not sure if PTT triggers on earth or change of state? I have an old very basic Iambic keyer (G3KHZ board), no memories so my requirements are very basic. It has single circuit output, key up/key down..... hence the "mono-jack" question, but I could be persuaded to build a new keyer, perhaps the Nano keyer kit. Prefer to use what I've got to hand though.

My preferred SDR software is SDR Console. Is anyone else using this to operate CW and if so, any preferred methods? What to do about side-tone or perhaps monitoring TX live using heavily de-gained receiver? Is this method even practical? I have always preferred love monitor of the TX signal via the RX instead of sidetone but perhaps that is not possible or practical with SDR or there may be some limitation of the HL2 in this regard? 

Latency issues for both direct keying and PC keying? I am not a fast operator so I guess latency possibly not  a big issue for lower speed senders like me (up to 20 wpm)?

Any tips or thoughts greatly appreciated as information on operating CW in HL2 seems a little thin, unless I missed it. Yes, I did read the thread about keyboards/keyers, but it is the actual practical operation of the HL2 for this mode I am interested in, not the keyer device itself.

73

Max



On Monday, 3 February 2020 07:07:11 UTC, Mathis Schmieder wrote:
Dear Group,

Sorry if this question seems dumb, out of place or has been answered hundreds of times, but I couldn't find a definitive answer. What is the intended/best way to do CW with the HL2? Is it possible to "just" connect a keyer to the stereo jack to get the FPGA to create the baseband signal, or does it have to be created by the SDR software?

Thanks & vy 73,
Mathis, DB9MAT

Steve Haynal

unread,
Apr 24, 2020, 9:24:56 PM4/24/20
to Hermes-Lite
Hi Alan, Jim and Matthew,

It is great to read about your progress and thoughts. Sorry I haven't participated. Thanks for your efforts.

73,

Steve
kf7o

James Ahlstrom

unread,
Apr 25, 2020, 10:16:28 AM4/25/20
to Hermes-Lite
Hello Matthew,

I have started with ALSA and now have some working code. But I am not happy with it yet. I would be grateful for any help. If you want to discuss off-line please send me your email address. Mine is jahlstr and I am on gmail com.

Jim
N2ADR

Matthew

unread,
Apr 25, 2020, 12:36:50 PM4/25/20
to Hermes-Lite
Whilst I am usually in favour of keeping shared knowledge on group for all to learn, I think in this instance a discussion about alsa structs is probably best done offline. Email sent.

73 Matthew M5EVT.

Max

unread,
Apr 25, 2020, 7:13:27 PM4/25/20
to Hermes-Lite
Hi Steve

Many thanks for the comments. Yes, all points noted. Personally I do not want to deviate from stock gateware so I won't be going down the HL2 Plus route. I fully understand your vision of HL2 being primarily a remote radio. In fact, for the first time I am actually considering remote operation so I would also find a functioning remote PC solution would be great.

I actually already have what I think is a very promising solution (not using the onboard KEY jack) by feeding MRP40 CW decoder/keyboard program into the excellent SDR Console (Windows prog) so this mode is audio tones from MRP40 to the audio input of SDRC in SSB mode of course. SDRC has TX audio input monitor so with this set up this provides a perfect side-tone solution. Only very small issue here is the slight frequency readout error of carrier frequency by using the SSB method, but not a deal breaker and this will always apply using this method.

What I really want is to get manual keyer input also working and for this it has been suggested to add Morse Keyer 4.3 tone keyer program with paddles connected to serial port. I plan to mix the audio output from the two programs (MRP40 and Morse Keyer) by using the excellent Voicemeeter virtual audio mixer and the input to SDRC audio input:

I now have serial to USB cable so just need to find a few minutes to solder it up to the keyer and try it out. This may work well for me as for manual sending I am certainly very unlikely to ever need more than 30 wpm, and at the moment much less, so I am hopeful this will all be a workable situation for me at least.. So far there do not seem to be any significant latency issues at all with MRP40>Voicemeeter>SDRC at about 35 wpm (monitored on separate analogue receiver) so will be interesting to see what happens with serial input from keyer. I am expecting it to work fine.

I should have it running shortly and I will report back if anyone is interested.

Best

Max

Joe LB1HI

unread,
Apr 25, 2020, 8:12:19 PM4/25/20
to Hermes-Lite
Hi group,
It's nice to hear that work is underway on remote real CW.

73, Jozef

Alan Hopper

unread,
Apr 28, 2020, 5:09:39 AM4/28/20
to Hermes-Lite
Hi Group,
 Just a couple of pics of my army surplus key upgraded to midi output with a pro micro Arduino clone. I have discovered these boards come in a couple of sizes, this is the samller one with a micro usb connector.

P1010715.JPG

P1010716.JPG

73 Alan M0NNB



 

James Ahlstrom

unread,
Apr 28, 2020, 11:24:43 AM4/28/20
to Hermes-Lite
Hello Alan, Matthew and Group,

Just a short update. I have working software for reading CTS or time-stamped data from a keyed microcontroller. But my sidetone latency is too large to be useful. So I am working on my sidetone. Matthew has kindly agreed to help. For the key, I am using the HL2 with a directly connected key. I want to have the directly connect key version working first. I would be curious to know what others are seeing for sidetone latency for this case.

Jim
N2ADR

Max

unread,
Apr 28, 2020, 7:06:02 PM4/28/20
to Hermes-Lite
Just to report back....... this solution (audio tone to mic input of SDR program in SSB mode) most certainly does not work, even when using audio input monitor on SDRC as a sidetone....... the audio latency is just too high at "normal" sending speeds, as I guess many on here probably already knew but were too polite to say! My error for suggesting.

Works passably well for just keyboard sending of course (maybe not at super high contest speeds, but that's not my thing) but my ultimate wish is to be able to switch seemlessly between keyboard CW from something like MRP40 and manual keyer with remote operation.

So it is back to square one for me. Best solution so far is manual keyer into HL2 key jack and I have been trialling Spark SDR with the new sidetone feature. That does work very well so well done Alan for the nicely implemented sidetone in latest preview version of Spark.

73

Max

Matthew

unread,
Apr 30, 2020, 2:15:29 PM4/30/20
to Hermes-Lite
I have finally got round to implementing MIDI in linHPSDR. Thankfully all the hard work has been done for piHPSDR. Also, it turns out the effort with unixcw have proved beneficial in terms of optimising audio buffer sizes. On my bench tests, using Alan's sparkey code in an Arduino I see 12 ms latency from key down to PC sidetone. With CWX and the optimised HL2 buffers, the latency from key down to RF out is remarkably low (by ear - I didn't measure this). Hats off to Steve for the gateware to accommodate this remote CW operation, hats off to Alan for demonstrating this is perfectly possible using MIDI. To my mind, this is the near perfect method for remote CW.

Unixcw has an iambic keyer built in so with a couple of lines of code an iambic keyer in software is perfectly possible if you connect the dit and dah as MIDI signals.

I would encourage anyone struggling with remote CW to buy a simple microcontroller board to run Alan's sparkey code and try it with SparkSDR (or linHPSDR in a day or so).

73 Matthew M5EVT

Steve Haynal

unread,
May 1, 2020, 1:08:23 AM5/1/20
to Hermes-Lite
Hi Matthew and Alan,

Thank you very much for this work. The 12ms sounds great. Also, thank you Alan for your Arduino sparkey code for CW key-to-MIDI conversion. This is something I always thought would be useful and now I can just go and grab your code! I hope to try it out soon.

73,

Steve
kf7o

Alan Hopper

unread,
May 2, 2020, 5:26:01 AM5/2/20
to Hermes-Lite
Hi Matthew,
I've been pondering where it is best to have the keyer code, I'm tempted to have it in the arduino as the response can be faultless and local sidetone is possible, this has the downside of needing settings like speed to be sent to it from the pc but that is easy over midi, we would just need to define a protocol ( just a map of midi notes to functions) for all software to use.  This is obviously irellevant to those that want to plug an existing keyer in.

I've made myself a combined touch paddle and straight key -  the 3p key.

P1010721.JPG

73 Alan M0NNB

si...@sdr-radio.com

unread,
May 6, 2020, 2:16:00 AM5/6/20
to Hermes-Lite

Hi,

 

I’m late to the party having been attending to other issues. I think sidetone really must come from the keying device, K1EL, Arduino, whatever. A latency of even a few ms can cause issues for some people, a well-written Windows program using WASAPI could run a dedicated output device in kernel mode with a latency of 3ms but that’s a nasty solution. Gamers complain about a ms, 10ms is almost a lifetime!

 

I’m now getting back into CW after a break of almost 40 years, I used to send / receive at 50 wpm and want to get that speed back if the brain still allows.

 

There are gaming headsets which will accept two inputs – USB and 3.5mm, that or a simple 3.5mm mixer taking input from HL2 and keyer will probably be my solution. I’m yet to settle on an Arduino project but will soon do this.

 

Simon Brown, G4ELI

https://www.sdr-radio.com

Jonas Sanamon

unread,
May 6, 2020, 4:26:53 AM5/6/20
to si...@sdr-radio.com, Hermes-Lite
Hi,

I'm using a Arctis Steel Series 7 wireless gaming headset as my radio headset, and am very happy with it. 
It has a line in connector on the wireless transmitter (but I have not used it) in addition to the USB connection, with USB 2 separate sound adapters appear on the PC, one intended for chat and one for game sound.  There is a "fader" wheel on the headset which allows adjustment/mixing between chat/game sound and that should be useful for adjusting sidetone level.  Good battery life too, I charge it overnight perhaps once a week.

Best Regards
Jonas - SM4VEY


--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hermes-lite/0afa01d6236d%24cd5eae30%24681c0a90%24%40sdr-radio.com.

Joe LB1HI

unread,
May 6, 2020, 7:10:04 AM5/6/20
to Hermes-Lite
For local CW work there are many different solutions and keyers to choose from. Solutions having their own side tone monitor. But a good remote solution is needed, as described by Steve. And this is the right direction. This is a desirable advanced function we are looking for.

73, Jozef

Alan Hopper

unread,
May 8, 2020, 7:31:49 AM5/8/20
to Hermes-Lite
Hi Group,
I've just re run some latency tests with gateware 71p1

This is with my dev version of spark on windows, the sidetone latency is about 5ms better than the released version.
This image is with midi key input showing sidetone and rf latency of around 5ms this is with the radio starting in receive with pa off and rf measured on the low power output.

midi-lowpower.png


This is the same setup as above but triggered from the jack on the radio. The sidetone is delayed and the rf advanced by the latency on the udp connection.

cwjack-lowpower.png

This is the same as the first but with the pa on and ptt already engaged before sending. rf measured on high power output

midi-pa-txon.png

This is the same as above but with the radio in rx when keyed, I don't think I saw this long delay when I last tested, not sure if this is firmware, my radio or my memory.

midi-pa-coldstart.png


The released version of spark has the same latency from key to rf but sidetone latency is around 12ms which is similar to that measured by Matthew on linux and appears useable at least for 20-30 wpm. I have not yet tried controlling the hl2 udp buffer size.

 73 Alan M0NNB

Steve Haynal

unread,
May 9, 2020, 6:36:21 PM5/9/20
to Hermes-Lite
Hi Alan,

Your key to sidetone latency is looking very good! Just to add some perspective, the speed of sound is ~343 m/s so 5 ms is 1.7m. Using headphones with your setup is roughly equivalent to sitting 1.7m away from a speaker. A standard equation for the time of a morse code dit in seconds is 60/(50*wpm). At 40wpm a dit is 30ms. Using your setup, the sound starts only 17% from the time the dit was keyed and overlaps 83% of the time. Also, the human ability to learn to deal with small sound latencies is good. Consider an organist playing a pipe organ in a cathedral. He is at least 7m or 20ms away from most pipes, yet still learns to play ahead. Just like most modern musicians who use keyboards connected to computers, I regularly use "Virtual Synthesis Technology" for music where a music keyboard sends a midi note event to a computer, and then the computer must synthesize the sound in near real time. (An interesting VST example is PianoTeq where the computer simulates a complete physical model of historic pianos or harpsicords, and is not simply playing back recorded samples.) Obviously, this would not be popular if latencies were prohibitive or annoying. In my setup, I can set the latency to 2.7ms up to 20ms or more. I have a hard time noticing latencies less than 10ms. From 10ms to 20ms I start noticing latencies but everything still feels very usable. Given the current pandemic, I recently skimmed a paper about playing music together over the internet. That research concluded that at about 20ms or less, the latencies are tolerable to make this possible and enjoyable. Only the drummers cared about lower latencies... Anyway, for sound I think your 5ms is great, and anything under 20ms should be very usable with just a little bit of learning.

For the picture with delayed RF output, what was the TX buffer latency set to? Is it consistently late like that?

73,

Steve
kf7o

Alan Hopper

unread,
May 10, 2020, 4:01:46 AM5/10/20
to Hermes-Lite
Hi Steve,
the delayed tx with pa on  initial tx is fairly consistent, as I said I don't remember this from previous tests, I'll try and find the time to try with older gateware or another HL2. I'm just using the default buffer settings. All values probably have a jitter of approx 2.5ms because of the audio and udp buffer sizes, I just haven't pressed the key enough to see the full range of jitter. 
I think we can conclude that remote cw with the HL2 is entirely possible and useable sidetone can be generated a number of ways, for the very fast or super critical, sidetone from the keyer or keyer interface is probably best, for the rest sidetone from the pc should be slightly neater setup.
I am also trying to reduce the received audio latency, I don't believe this will ever compete with sidetone but an interesting challenge to see if it can be made more useable for cw and will improve other modes.

I'm interested to hear about your music research, my wife is a violinist and I've been working on some software to allow her band to practise and record remotely, if you know of anything that works, that would save me a load of work. My approach involves fixed size buffering to keep constant latency and then attempts to make the inevitable dropouts as painless as possible.
73 Alan M0NNB

Reid Campbell

unread,
May 10, 2020, 6:15:49 AM5/10/20
to herme...@googlegroups.com
Hi Steve,

I was looking through the spec on the modem chip and noticed a comment
about a programmable LPF on the input. It also stated that it could be
turned off giving an input BW of over 50Mhz. Those planning on
experimenting with undersampling will be looking to turning this filter
off. I didn't see anything in the protocol wiki about control of this
filter. Can it be controlled?

Sorry if this has been talked about before, I just don't remember a
discussion on it.

Cheers

Reid
Gi8TME/Mi0BOT

Alan Hopper

unread,
May 10, 2020, 6:43:00 AM5/10/20
to Hermes-Lite
Hi Reid,
there is currently nothing in the gateware/protocol to change this. It is easy to set in a custom gateware build but mods are needed to the HL2 to bypass the lpf on the board. I tried this on the HL1 and could decode wspr on 6m and listen to broadcast fm with reasonable fidelity. Spark still has the code I used then which automatically tunes correctly and flips usb/lsb in the odd and even images.  
I guess it would not be hard to add a switch to the gateware, there just has not been any interest in this lately.
There was a suggestion to make a board to down convert and then inject into a quiet (or filtered) part of the spectrum so multiple bands could be used at once. Undersampling tx was also made to work.

73 Alan M0NNB
ps. your posts seem to get appended to the wrong threads.

Reid Campbell

unread,
May 10, 2020, 10:51:04 AM5/10/20
to herme...@googlegroups.com
Hi Alan,


On 10/05/2020 11:42, 'Alan Hopper' via Hermes-Lite wrote:
Hi Reid,
there is currently nothing in the gateware/protocol to change this. It is easy to set in a custom gateware build but mods are needed to the HL2 to bypass the lpf on the board. I tried this on the HL1 and could decode wspr on 6m and listen to broadcast fm with reasonable fidelity. Spark still has the code I used then which automatically tunes correctly and flips usb/lsb in the odd and even images. 

I have studied this a little and there is a connector between boards input LPF and the chip for injecting an external signal in. It would be good to have control of the chip's internal LPF defined for future functionality.

I guess it would not be hard to add a switch to the gateware, there just has not been any interest in this lately.
There was a suggestion to make a board to down convert and then inject into a quiet (or filtered) part of the spectrum so multiple bands could be used at once. Undersampling tx was also made to work.

I suggested the possible of injecting a transverter's IF in the 35MHz region. One of the problems is dipelexing a 2-30MHz signal with a 35MHz signal, they are to close. Another possibility is having a transverter with an IF at 45Mhz and then undersample it to appear at about 31Mhz, based on fs/2 = 38.4. The diplexing of 2-30Mhz with 45MHz should be easier.

So we can take this a wee bit further - "The Three Transverters". The HL2 has a spare programmable frequency generator which I think can go to near 200 MHz. Use this as the local osc for the transverter. Using solid state RF switches, switch 3 different front ends to the mixer and 3 drivers from the mixer with appropriate filters. Have separate RX/Tx mixers and you could go duplex, allowing PS.

So now you 6, 4 and 2 Metres as one of your 4 rx slices. OK, it may not be top notch as the phase noise of the LO may not be top spec but the HL2 is not top shelf itself in performance but sure wins on price/performance.

I haven't really looked to closely at this and could be full of holes like 45MHz being to close 50MHz to transvert down. Or what about all them harmonics/mixer products.

Comments?

Cheers

Reid
Gi8TME/Mi0BOT


73 Alan M0NNB
ps. your posts seem to get appended to the wrong threads.

On Sunday, May 10, 2020 at 11:15:49 AM UTC+1, Reid Campbell wrote:
Hi Steve,

I was looking through the spec on the modem chip and noticed a comment
about a programmable LPF on the input. It also stated that it could be
turned off giving an input BW of over 50Mhz. Those planning on
experimenting with undersampling will be looking to turning this filter
off. I didn't see anything in the protocol wiki about control of this
filter. Can it be controlled?

Sorry if this has been talked about before, I just don't remember a
discussion on it.

Cheers

Reid
Gi8TME/Mi0BOT
--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.

James Ahlstrom

unread,
May 10, 2020, 11:56:55 AM5/10/20
to Hermes-Lite
Hello Alan,

Your latencies are truly excellent. I have been unable to go below about 25 msec. But for the case of the key connected to the HL2, is MIDI involved at all? I thought the low latency was the result of the computer recognizing that a MIDI device must be treated specially and provided with low latency sound. With the key connected to the HL2 there seems to be no role for MIDI.

Jim
N2ADR

Alan Hopper

unread,
May 10, 2020, 12:26:10 PM5/10/20
to Hermes-Lite
Hi Jim,
yep midi is not used for the case of the key connected to the HL2. The sound for both midi connected key and HL2 key is generated in the audio callback that is also used for rx audio. I'm still using portaudio but had to tweak(bodge) the wasapi part to get low latency without going to exclusive mode (https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/low-latency-audio). On linux portaudio appears to be fairly good with default settings.

On another note I was going to try bluetooth midi today and check the latency with the ESP32 module, that went wrong as I found I had actually bought a ESP8266 (no bluetooth) by mistake, easy to do on ebay if you are mean and click on the cheapest :)

73 Alan M0NNB

Max

unread,
May 10, 2020, 12:27:16 PM5/10/20
to Hermes-Lite
Hi folks

Just posting on this thread in case anyone is set to monitor this specific one, especially as it's this discussion that prompted me to request this from Simon Brown, but over the last few days Simon has managed to program CW with sidetone to a test build of SDR Console for use with key into HL2 front panel Key/PTT jack. He has done a great job and the sidetone has very low latency. I've tested sending up to about 30-35 wpm and I don't have any issues at all. I can't key much faster than this with an iambic keyer. No doubt there are others on here that can and could perhaps give it a more rigorous testing?

If anyone would like to trial the test build please see my other thread on this group that I posted earlier today for more details.

73

Max


si...@sdr-radio.com

unread,
May 10, 2020, 1:54:33 PM5/10/20
to Steve Haynal, Hermes-Lite

Steve,

 

Very good point about speed of sound. I use speakers with an external USB soundcard on my development system and do notice the added latency.

 

Simon Brown, G4ELI

https://www.sdr-radio.com

 

Steve Haynal

unread,
May 10, 2020, 8:29:57 PM5/10/20
to Hermes-Lite
Hi Reid,

Currently, the AD9866 LPF is off in the HL2 gateware. We've been relying on the external LPF. At one time I had some worries that the internal LPF might be contributing to some distortion, but now doubt that was the case. You can access the LPF directly from software via the SPI interface at address 0x3b: https://github.com/softerhardware/Hermes-Lite2/wiki/Protocol. This allows you to change any AD9866 internal register from software. The AD9866 register initial values are set by gateware to differ from the defaults as follows:

 
  initarray[6] = {1'b1,8'h54}; // Address 0x06, Disable clkout2
  initarray[7] = {1'b1,8'h30}; // Address 0x07, Initiate DC offset calibration and disable RX filter
  initarray[11] = {1'b1,((FAST_LNA == 1) ? 8'h04 : 8'h00)}; // Address 0x0b, Enable RxPGA update via Tx[5:0]
  initarray[12] = {1'b1,8'h43}; // Address 0x0c, TX twos complement and interpolation factor
  initarray[13] = {1'b1,8'h03}; // Address 0x0d, RX twos complement
  initarray[14] = {1'b1,8'h81}; // Address 0x0e, Enable/Disable IAMP
  initarray[16] = {1'b1,8'h80}; // Address 0x10, Select TX gain
  initarray[17] = {1'b1,8'h00}; // Address 0x11, Select TX gain
  initarray[18] = {1'b1,8'h00}; // Address 0x12,
 

That is an interesting idea to use the spare output of the Versa5 for the LO of a transverter. The spare output has been tested and there is code in Quisk. It comes down to setting up the Versa5 internal registers properly via the I2C port, and is again entirely configurable via software. Unlike SPI which just supports writes, the I2C interfaces in the gateware support reads and writes. Examples of that are in Quisk too.

  def VersaOut2(self, divisor): # Use the VersaClock output 2 with a floating point divisor
    div = int(divisor * 2**24 + 0.1)
    intgr = div >> 24
    frac = (div & 0xFFFFFF) << 2
    self.WriteVersa5(0x62,0x3b) # Clock2 CMOS1 output, 3.3V
    self.WriteVersa5(0x2c,0x00) # Disable aux output on clock 1
    self.WriteVersa5(0x31,0x81) # Use divider for clock2
    # Integer portion
    self.WriteVersa5(0x3d, intgr >> 4)
    self.WriteVersa5(0x3e, intgr << 4)
    # Fractional portion
    self.WriteVersa5(0x32,frac >> 24) # [29:22]
    self.WriteVersa5(0x33,frac >> 16) # [21:14]
    self.WriteVersa5(0x34,frac >>  8) # [13:6]
    self.WriteVersa5(0x35,(frac & 0xFF)<<2) # [5:0] and disable ss
    self.WriteVersa5(0x63,0x01) # Enable clock2
  # Thanks to Steve Haynal for VersaClock code:
  def WriteVersa5(self,addr,data):
    data = data & 0x0ff
    addr = addr & 0x0ff
    ## i2caddr is 7 bits, no read write
    ## Bit 8 is set to indicate stop to HL2
    ## i2caddr = 0x80 | (0xd4 >> 1) ## ea
    self.pc2hermeslitewritequeue[0:5] = 0x7c,0x06,0xea,addr,data
    self.WriteQueue(1)


73,

Steve
kf7o


To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite+unsubscribe@googlegroups.com.

Reid Campbell

unread,
May 11, 2020, 3:12:32 AM5/11/20
to herme...@googlegroups.com
Hi Steve,

OK, on the LPF. That explains why the experiments on undersampling worked with good results. I'll look into SPI and I2C support for the future.

Cheers

Reid
Gi8TME/Mi0BOT
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hermes-lite/25c897b3-95a2-4014-9a3d-803622f22c4d%40googlegroups.com.

Alan Hopper

unread,
May 11, 2020, 3:21:32 AM5/11/20
to Hermes-Lite
Hi Reid,
sorry I misled you on the lpf stuff, a bad memory day, I had forgotten all about the i2c stuff and that it was you that suggested the down converter stuff.
73 Alan M0NNB
To unsubscribe from this group and stop receiving emails from it, send an email to herme...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to herme...@googlegroups.com.

Max

unread,
May 20, 2020, 12:46:59 PM5/20/20
to Hermes-Lite
Just a quick note in case anyone missed it (it's in the "9 receiver thread") that Steve's gateware 71p2 now allows PTT (ring) on front panel jack for use to manually trigger CW operation. This means that for those that prefer it HL2 can be placed in manual TX using footswitch, and simultaneously key to the tip of the connector will key the TX with CW while the ring is grounded. Prior to this grounding the PTT ring prevented keying via the tip of the jack.

I've confirmed it works nicely for my HL2.

Thanks Steve!

73

Max

Steve Haynal

unread,
May 20, 2020, 6:01:22 PM5/20/20
to Hermes-Lite
Hi Max,

Thanks for testing this. Sorry I forgot to update your thread about this.

73,

Steve
kf7o

Pete Ferrand

unread,
May 20, 2020, 6:36:19 PM5/20/20
to Hermes-Lite
I'm a bit confused. On github under 20200516_71p2 Release the first entry says "Receive only hl2b5up_9rx release". 

Yet the fourth and fifth entry below it refer to (welcome!) changes in the way cw is transmitted. What is the point of changing the cw transmit operation in a receive only release?

Thanks.
Pete
WB2QLL

Steve Haynal

unread,
May 20, 2020, 7:29:09 PM5/20/20
to Hermes-Lite
Hi Pete,

There are two gateware variants released as 20200516_71p2: hl2b5up_9rx and hl2b5up_main. See the subdirectories present at:

The "main" variant does support TX. Sorry for the confusion.

73,

Steve
kf7o

Pete Ferrand

unread,
May 20, 2020, 7:48:40 PM5/20/20
to Hermes-Lite
Great, Steve, thanks.

Max

unread,
May 21, 2020, 9:20:34 AM5/21/20
to Hermes-Lite
No problem at all Steve. Thanks again for the mod.

73

Max

James Ahlstrom

unread,
May 22, 2020, 8:01:04 AM5/22/20
to Hermes-Lite
Hello Max and Group,

This is an important point so I added information about CN4 to the FAQ section of the Wiki. Please  check it for accuracy. I think it will help new users.

Jim
N2ADR

Max

unread,
May 22, 2020, 9:25:03 AM5/22/20
to Hermes-Lite
Thanks James. I am sure that people will find that helpful.

73

Max

James Ahlstrom

unread,
Jun 6, 2020, 10:28:46 AM6/6/20
to Hermes-Lite
Hello Group,

I have been working on a new sound system for Quisk, and it is now fast enough to test. I added the test results to my paper at http://james.ahlstrom.name/serialports/index.html. Page forward to the bottom. I hope to release a new Quisk with the new sound in a week or so.

The main conclusion is that serial port CTS is as fast as a key directly connected to the HL2. Also, sound cards can vary in speed. My motherboard sound is almost twice as fast as my USB sound. No surprise to the MIDI crowd who are always talking about various cards and ASIO drivers.

Jim
N2ADR

Graeme Jury

unread,
Jun 6, 2020, 7:18:35 PM6/6/20
to Hermes-Lite
Hello Jim and Group,

Congratulations on a sound and well documented research Jim. This work will be a go to standard for developers of any PC console. The bit at the end about the MIDI input is a bit of a can of worms as at present it is not a big feature of SDR consoles but it is gaining some prominence and works really well. As you point out Hamlib offers the same functionality but to my mind the advantage of MIDI is that you can make a simple map of your MIDI device be it a Behringer, Hercules or home brew pro-micro or teensy controller to drive every control or keying function that your radio provides.

Alan has commented that serial MIDI did not seem to have much latency difference to USB MIDI and I suspect not too different from the DTR/CTS/DSR latencies that you have identified. The location of the various delays is a big aid and I wonder if a polling time of less than 5 mSec has an effect on the rest of the performance of the radio as it seems to be a big advantage to poll at 5 mSec vs 10 mSec and perhaps 2 mSec if there are no other penalties could be worth a try.

I think that there is a danger that the SDR world will be trying to implement MIDI with no common standard although a mapping file (or interface in the radio as in SparkSDR) will largely circumvent this. The big problem to overcome is not how long the RF takes after a key press but how long the sidetone in the speaker/headphones takes. The fastest is a local sidetone oscillator but most CW operators that I know use headphones and a lot of them are noise cancelling and you just can't hear the keyer sidetone so your effort to get sidetone on the radio audio output is the ultimate goal.

73, Graeme ZL2APV

Steve Haynal

unread,
Jun 7, 2020, 2:34:52 AM6/7/20
to Hermes-Lite
Hi Jim,

Thanks for all your work on this. An initial skim looks very promising and thorough. I will have to read it in more detail after all the festivities of my son's high school graduation complete this weekend. I will also add a link to the document from the wiki.

73,

Steve
kf7o

James Ahlstrom

unread,
Jun 7, 2020, 8:40:04 AM6/7/20
to Hermes-Lite
Hello Graeme,

Thanks for your comments. You always take the effort to test new ideas and software and I appreciate it.

Regarding reducing the poll time below 5 msec, as the poll time is reduced the frequency of underruns increases. An underrun means the sound card ran out of samples to play because Quisk did not  provide them fast enough. This depends on the speed of Quisk, but also on the speed of the computer and its sound system. But lets be realistic. A "dit" at 60 wpm is 20 msec. We will probably have code to de-bounce the key contacts which adds maybe 7 msec delay, and the rise time of the CW signal is on the order of 5 msec. An external sidetone oscillator will always be better, and can easily have a built-in mixer for headphones.  In my mind, the real issue from a software standpoint is whether MIDI can key faster than CTS. I plan to test this when I get MIDI going. If MIDI is not faster then why are we asking users to buy and program a microcontroller as a MIDI device?

Although it is true that you can map radio controls to MIDI, Quisk already provides Hamlib rig2 control, XML-RPC for FlDigi and emulation of the FlexRadio ZZ commands. All these are different and all purport to support these mappings. As someone once said, the nice thing about standards is that there are so many. I think the chance of a standard MIDI mapping are slim.

I plan to add MIDI to Quisk, but I don't see the advantage. You need to program a microcontroller to use MIDI. But you could program the micrcontroller to send Hamlib or ZZ commands just as easily. Actually more easily, because you don't have to deal with a MIDI library, just the usual serial port, a device already built in. And MIDI commands are designed to control instruments, while Hamlib and ZZ commands are designed to control radios. But I could be wrong, and I won't really know until I get MIDI going.

Jim
N2ADR

F5NPV Amateur Radio

unread,
Jun 7, 2020, 9:55:49 AM6/7/20
to Hermes-Lite


Hello Guys,

I am using Hermes lite with a Raspberry PI 3B+ and Quisk

According Hermes lite and CW capabilities , i am using 2 Method:


1) Locally with a homebrew K3NG keyer which is usefull since this keyer is providing Winkey and hamlib capabilities. I am not using Quisk Sidetone since there is significant lag especially if you are using Iambic capabilities . For automatic CQ and memory management i am using a Midi controller from Hercules . The K3NG keyer is plug directly to CN4 and so far it is working very well. since the 71P1 firmware. 
Here a video for the MIDI capabilities and features : https://youtu.be/xAHs_7X6CX0 
With the midi controller i am  controlling almost all my rig , rotator , Quisk , Hamllib etc etc .... very usefull dashboard
all details in my QRZ.COM  : https://www.qrz.com/db/F5NPV

2) For remote CW capabilities and Hermes lite , i am using a tiny software developped by IW7DMH with the raspberry Pi , gpio and Nmap capabilities.
you can find details regarding the software (Windows) here :  https://iw7dmh.jimdofree.com/utilities-for-remote-operations/sw-keyer-for-remote-operations/
Here a video for more details : https://youtu.be/MDRA8T2AY0E and my QRZ.com
I am using this solution with my other SDR transceiver and my UBITX. it is straight forward but so far working very well .  I did some test through Internet and looks very promising .

i am currently setting up a blog in order to populate everything and provide more details escpecially regarding MIDI capabities and CW

73s 

F5NPV 


si...@sdr-radio.com

unread,
Jun 7, 2020, 11:07:15 AM6/7/20
to James Ahlstrom, Hermes-Lite

Hi Jim,

 

MIDI is quite easy to implement in Windows, response is as immediate (as can be), if you get stuck I can throw C++ code at you. There’s at least one small MIDI / Arduino (?) project I know of so paddles can interface to a PC and the iambic logic written in the PC rather than the HL2 firmware. Lots of cheap and decent quality MIDI devices are available.

 

Simon Brown, G4ELI

https://www.sdr-radio.com

 

--

You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.

To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hermes-lite/13e1d527-d4b9-4fad-8d76-969a646f4bbfo%40googlegroups.com.

Mario Illgen, DL3LSM

unread,
Jun 7, 2020, 11:22:24 AM6/7/20
to Hermes-Lite
Hi there,

it's an unrelated project but maybe there are some ideas for your discussion:


73, Mario DL3LSM

James Ahlstrom

unread,
Jun 7, 2020, 1:57:23 PM6/7/20
to Hermes-Lite
Hello Didier,

Wow, that some impressive work! I can now see the interest in MIDI. I will add it as soon as I can.

Jim
N2ADR

Rune Øye

unread,
Jun 7, 2020, 3:10:52 PM6/7/20
to James Ahlstrom, Hermes-Lite
Hi James.

Very interesting reading from you and all the others that have replied.  I have done some tests and where I have made a test sidetone oscillator that is  activated by my Winkey. I call the test oscillator for "Time 0" since it is fully up and running after 2-3ms.

image.png

My goal was to have sidetone in my headset together with sidetone sound (software) from the radio. I further connected sound out from the PC internal card and sound from my Test oscillator to a Behringer PowerPlay P1, all connected as in pictures below.

 
image.png



Below pictures show delay in sound from the computer speaker compared to the test oscillator. My two Ch scope probes connected before the Power Play P1
  
image.png


The 30ms difference in sound you can hear in the attached sound file. I send my  callsign and UP two times in left Ch, (test osc) then moving over to center and to right channel. I did this at 20WPM and 30WPM.


The human reaction from you pressing the Keyer until you hear the sidetone is ok with 30ms up to maybe 26WPM however, if you are a QRQ guy then you quickly run into trouble.

With my limited contest skills I am mostly happy around 27-28 WPM, quicker than that it gets messy with callsigns like II5SHI :)

73,
Rune

 

 
 

 

--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.

F5NPV Amateur Radio

unread,
Jun 7, 2020, 3:13:24 PM6/7/20
to Hermes-Lite
Thanks Jim , in fact initially i was planning to put my SDR TRX inside an enclosure with control and push button in the front panel and this is what i did with the RS-HFIQ but since i have also the Hermes lite i need to build another enclosure and i loose all the benefit of the size from the SDR TRX. in fact using a midi Controller is providing more features than expected and quickly i realized that i can control everything in the shack especially with the RPI since this device is able to provide a significant amount of I/O thanks to the GPIO.  The main limitation is in fact the number of pads, Jog and control provided by the Midi controller. More shortcut we have with Quisk will provide more features to be controlled with an external controller likely the MIDI one but not only i guess.

73s Didier

Graeme Jury

unread,
Jun 7, 2020, 7:39:55 PM6/7/20
to Hermes-Lite
Jim and thread participants,

A lot is coming out of this and Jim I was impressed that you picked up on the around 10 mSec delay due to key debounce. I have written a special debounce routine for my key input where I poll for 1 mSec and get 25 reads of the port in this time. If I get more than one change of state in this time I consider that the key has changed state and action it then apply the debounce routine which is an algorithm that takes consecutive reads every msec until I get 8 stable reads and then I allow polling of the key again so my maximum key latency is 1 mSec.

I guessed that with you stopping at 5 mSec poll time it would be for other reasons like causing the under runs. As has been shown - particularly by Didier's great work showing that there is more to MIDI than a fast key response and looking at the K3NG keyer based around an Arduino I think that it could be made to support MIDI as there is an atMega board with wifi and a programmable USB interface microprocessor available. I suspect that there will be a string of clever ideas coming out of all this.

Rune, you sure have got your teeth into this pretty quickly and thanks for your information and it is great to see that we have Simon's Windows expertise in the mix too and Mario I am using almost exactly the same as you for my keyer running linHPSDR at present but looking forward to using it on Quisk too.

73, Graeme ZL2APV



73, Graeme

James Ahlstrom

unread,
Jun 8, 2020, 6:32:12 AM6/8/20
to Hermes-Lite
Hello Graeme and Group,

Key de-bounce is an interesting problem. It would be good to poll the key at intervals less than 1 msec, but this is not possible on a PC. So I mix the de-bounce with the shaping of the rise time. I increase the RF output waveform when the key is closed and decrease it when the key is open. If there are bounces it adds wiggles to the waveform, but these are small. I am not sure how long it takes a switch to stop bouncing, but I believe a relay can bounce for about 5 msec. The transistor in a keyer won't bounce, but the keyer must have de-bounced the paddles elsewhere. I could add de-bounce to my CTS hex inverter circuit because the inverter has schmitt inputs, but I haven't done this. Interesting stuff.

Jim
N2ADR

Steve Haynal

unread,
Jun 13, 2020, 2:22:16 AM6/13/20
to Hermes-Lite
Hi Group,

I finally had a chance to read this thread in detail. Thanks for the discussion. To capture this discussion, other CW discussions, and relevant links, I've started to collect links under a CW Resources section on the Community Projects wiki page:

I've also added the videos from F5NPV to the Hermes-Lite YouTube Channel:

73,

Steve
kf7o

W. Jozef

unread,
Jun 30, 2020, 12:14:37 PM6/30/20
to Hermes-Lite
Hi group,
A simple solution to avoid the sound problem and use Fast Audio for CW side tone minimal delay in Quisk.
Reply all
Reply to author
Forward
0 new messages