2.5.1 Serial, Parallel and Sound Card Interfacing
- 2.5.1 Serial, Parallel and Sound Card Interfacing
- 1. Avoiding RFI and Other Common Interfacing Maladies (work in progress)
- 2. Ports Used for Interfacing
- 3. Radio interfacing
- 4. Interfacing for PTT and CW Keying
- 5. Via USB port
- 6. Additional Parallel Port Interfacing
- 7. Band decoder output
- 8. Bearing data
- 9. Sound card interfacing
- 10. Serial and Parallel port interfacing under Windows 2000/XP/Vista/Windows 7
- 11. Hooking up a Footswitch
1. Avoiding RFI and Other Common Interfacing Maladies (work in progress)
More often than not, reports of quirky, intermittent issues with radio control, CW and PTT interfacing, as well as hum and distortion in sound card audio, wind up being traced back to RFI - your own signal turning up where it doesn't belong. The following discussion is closely based on work done by Chuck Counselman, W1HIS. While it doesn't refer only or even specifically to N1MM Logger, it is good advice.
2. Ports Used for Interfacing
The program can interface with your radio using several ports from the computer. These ports are:
- Serial port - A serial port can send CW, control PTT or communicate with your radio; with some radios you may be able to do all three on one port. Hardware serial ports are rapidly disappearing from most computers, but if the computer has open PCI bus slots. inexpensive serial and serial/parallel port cards are available. Alternatively, USB-to-serial adapters may be used.
- Parallel port - Parallel (LPT) port interfacing is quite flexible. In addition to controlling CW and PTT, N1MM Logger uses the LPT port to control popular SO2R control boxes, and to send band information to a band decoder for automatic antenna or bandpass filter switching. Note that you will still need a virtual or hardware serial port for radio control.
- USB port - Most computers now have multiple USB ports. USB-to-serial adapters can be used to provide full serial port capabilities, but be aware that not all such adapters (or their drivers) work well with N1MM Logger or other programs writen in Visual BASIC. See USB Interface Devices for specifics. There are also many different interface devices available that use USB port control for a full gamut of capabilities. See the chapter Supported Hardware for more information.
- Sound card - N1MM Logger can use your computer's sound card to record your contest QSOs, and also to send stored audio messages to your transmitter in response to function key presses. For these purposes, it is best to find a computer or sound card that has separate microphone and line input jacks, as well as a line out jack. Some sound cards (particularly in laptops) now come with only two jacks, and the input jack is switchable between microphone and line levels. If this is the case, the obviously you will not be able to run your microphone through your sound card and record QSOs at the same time.
For CW the parallel and serial ports are assumed to have the default addresses shown in the list below. These addresses can be changed in the configurer to match your Windows setup.
These addresses used in Windows can be checked in 'Control Panel > System > Device Manager > Ports (COM & LPT) > (Choose a port) > Resources > Input Output Range'.
Nonstandard port addresses will not work for CW.
3. Radio interfacing
4. Interfacing for PTT and CW Keying
4.1. Choosing Your PTT Method
N1MM Logger offers multiple methods for controlling PTT on your radio. Unless you use VOX, or QSK on CW, you will need to select one of these methods, and your choice may vary depending on the mode you want to operate, your radio's capabilities and how you choose to use them, any existing interfaces or other PTT wiring done for use with other programs, and so on.
The available methods are:
- Hardware PTT - uses serial (COM) or parallel (LPT) ports. Software controls the state of individual lines on the port for PTT and CW (and in the case of the LPT port, additional SO2R-related functions.). This requires a driver (INPOUT32) - see Installing the Software for specifics. Works with USB-to-serial adapters, but will not work with USB-to-LPT adapters except for the Piexx SO2RXLAT.
- Software PTT - uses PTT (TX/RX) commands sent to the radio through the radio control port. For certain radios that incorporate a radio CODEC (effectively, a sound card inside the radio), if you wish to use it either for AFSK (digital modes) or as a voice keyer for SSB, you will need to use Software PTT. Check the Supported Radios section for your radio setup instructions. Software PTT is great with some radios, such as the TS-590, but with others, which require a longer delay between CAT commands, it will be slower than hardware or Winkey PTT. In the case of Icom radios, when a data collision is detected, the PTT may fail to actuate or hang in transmit, requiring an ESC to return to receiving. Also, please note that N1MM Logger cannot control a built-in DVK, as compared to a CODEC, because if the recorded message is not sent from the computer, the program cannot know when the recorded message has finished. Such DVKs must use VOX, for this reason.
- Winkeyer PTT - uses PTT provided by the Winkeyer USB series of CW keyers, but also works for SSB. If a port is set up to control a Winkeyer, and PTT is set as the Pin 5 function on the Winkeyer tab in the Configurer, PTT is automatically active on the real-panel jacks of the Winkeyer, and it needs only to be cabled to the appropriate jack on your radio. Winkeyer PTT is the most flexible of the PTT options, particularly on CW, because you can set the inter-character "Hang Time" separately from the end-of-message Tail Time. The settings are on on the Winkeyer tab in the Configurer. If you chose to use one of the other methods for PTT control, simply omit this cable.
- Digital Modes PTT - If using FSK, configure MMTTY to a COM port or EXTFSK for FSK keying, and also configure it for PTT on the same port. To use a radio CODEC for AFSK in digital modes, PTT must be handled by N1MM Logger using Software PTT (see above). For AFSK not using a built-in radio CODEC, use N1MM PTT options for other modes, or configure PTT in MMTTY. If you want to use the same COM port for PTT in digital and non-digital modes, then you must check "Digital" on that port in the Hardware tab of the Configurer, and configure MMTTY for PTT. This tells N1MM to close the port and hand it over to MMTTY when you switch to a digital mode.
For CW, if you have a Winkeyer, Winkeyer PTT is recommended, because it gives you the most flexibility in setting hang and tail time. If you do not have one, but have a serial or USB port, Hardware PTT is probably the simplest. You can do this with a simple transistor switch off the appropriate line of a serial port or a USB-to-serial adapter. CW and PTT can be handled on a single port, and with some radios it may even be possible to do radio control on that port as well if the radio does not need the RTS and DTR lines to be set in a particular way (since these lines are used for CW and PTT. Software PTT may work fine, depending on your radio, and has the advantage of not needing any additional cabling.
For SSB or digital modes, use any of the options above. Remember, if you are using your radio's audio CODEC, you will need to use Software PTT and omit COM or LPT hardware PTT control.
N1MM Logger does not and will not support this way of generating CW. There are a couple of reasons. First, on many transceivers, when they are in USB or LSB mode, you are precluded from using CW filters and other CW receiving aids. Second, sound-card CW is fraught with problems, including audio noise in your CW, RF interference to the CW tones, and the possibility of generating two or three separate CW signals due to audio harmonics. It's just a terrible idea!The simple interfaces described below are easily constructed at minimal cost with readily available components.
4.2. Parallel (LPT) Port
This is a typical simple interface
4.3. Serial (COM) Port
PTT output (RTS)
CW output (DTR)
4.4. Using a transistor
- Equivalents for the 2N2222 are 2N3904, BC547 or BC548.
- NB. It isn't a bad idea to add a 1 kOhm resistor from base to ground, also adding a shunt capacitor of 10 nF is highly recommended at the collector output to ground in order to prevent RF feedback to base and subsequent blocking.
4.5. Using an opto-Isolator (opto-coupler)
Some users prefer to use an opto-isolator rather than a transistor, in order to provide more protection for the serial port in the event of something going wrong downstream. In that case, however, two special considerations may apply:
- You may need to place a diode in series with the input of the opto-isolator, to protect it from negative voltage swings on a standard serial port. Check the specifications of the opto-isolator you use to determine whether this is necessary.
- Some opto-isolators may not pull their output "low" enough (close enough to zero volts) to switch PTT or CW on a given transceiver. In that case, appropriate "pull-down" measures must be applied.
5. Via USB port
Not all computers have serial ports anymore or not enough to control transceivers, packet, serial CW keying etc. In this case consider a USB to serial port adapter. Most of them do nicely control the radio. The problem with these interfaces is doing CW and/or PTT (and 5 bit codes). Test before or ask around if they work for radio control, CW or PTT control with your computer and radio! Also look first if drivers for your operating system are available.
With N1MM CW will work with native serial ports and with USB-to-serial adapters. For perfect CW not dependent on Windows processes the answer is Winkeyer by K1EL. CW transmitted as normal ASCII characters via the serial port. A USB/serial adapter will work fine with K1EL, because it is standard serial communications. Check the Winkeyer manual for more information.
In some cases PTT and CW keying may unexpectedly stop working when using a USB-to-serial converter. Check this Windows setting:
- Control Panel; System Icon,
- Hardware Device Manager Tab or button.
- Expand USB Serial Bus Controllers
- Highlight each USB Root Hub
- Double click for Properties settings, Power Management tab,
- Remove the check mark from 'Allow the computer to turn off this device to save power'.
- The box is checked by default in most cases.
- Reboot the computer
A table giving evaluations by N1MM users of various USB-to-serial converters is in the References Section. Another overview of serial- to-USB converters can be found at the RTTY contesting page by AA5AU at: http://www.rttycontesting.com
6. Additional Parallel Port Interfacing
If the type of CW port chosen is LPT1, LPT2 or LPT3, and a hardware LPT port is used, additional information will be present on the chosen parallel port. In configurer select for which Radio the output has to be given on the selected port (Radio 1 or Radio 2). The BCD data on the LPT is that of the current active radio/VFO. The band data is available on multiple LPT ports — Radio 1 on LPT1, Radio 2 on LPT2 and so on. USB-to-LPT converters are not supported.
|1||Return for PTT and CW output. This pin has limited sink capability, so you may need to buffer it|
|2||Band output (Least Significant Bit) set by Antenna tab in Configurer. This pin is also used to stop the message sent on the hardware DVK.|
|3||NA-compatible TX focus. - Radio 1/2 Pin 3 will go to a logic LOW level (0V) when Radio 1 has TX focus and to a logic HIGH level (5V) when Radio 2 has TX focus. (NB. LPT pin 3 is the complement of Pin 14). Set ONLY if no hardware DVK output is selected (msg# 1).|
|4||NA-compatible RX focus. LPT Pin 4 will go to a logic LOW level when Radio 1 has RX focus and to a logic HIGH level when Radio 2 has RX focus. Set ONLY if no hardware DVK output is selected (msg# 2).|
|5||(Shift+singlequote) to toggle for Stereo mono. LPT Pin 5 will go to a logic LOW level for mono audio and to a logic HIGH level for stereo audio. Set ONLY if no hardware DVK output is selected (msg# 3).|
|6||Set ONLY if no hardware DVK output is selected (msg# 4).|
|7||Band output set by Antenna tab in Configurer|
|8||Band output set by Antenna tab in Configurer|
|9||Band output (Most Significant Bit) set by Antenna tab in Configurer|
|14||Radio select A/B (transmit focus) for DX Doubler compatibility. LPT Pin 14 will go to a HIGH level when Radio 1 has TX focus and to a LOW level when Radio 2 has TX focus. (NB. LPT pin 14 is the complement of Pin 3)|
|15||Footswitch input port|
|16||PTT output, high = transmit mode|
|18-25||Return for Band output|
6.1. Diagnosing Parallel Port Problems
- MOSChip Semiconductors series MCS9900. This company is now owned by Asix Electronics Corporation,. and the very latest driver can be downloaded here. Specify PCIe Bridge for the product family. These chips are used in the SYBA SD-PEX10005 1 Port Parallel Card, available from the usual online sources.
- Oxford Semiconductor OX16PC952-954. This company's chips are used in several 1-port LPT cards, including the StarTech.com PEX1P, which also is widely available. Originally, they were thought to be incompatible with parallel port switching, but this does not appear to be the case (contact N4ZR for details).
1. Make sure you have the correct address specified in N1MM's Configurer. Typically, PCI-e add-in cards seem to have I/O addresses that are not the standard ones for a given port number. For example, built-in LPT1 ports typically have an address of 0378 for our purposes, which is the lower of the two I/O addresses given for the port in Device Manager. On the other hand, 3 different PCI-e cards tested all have fixed I/O addresses at D000 and D010, regardless of the LPT port number, and the correct address is the higher one - D010. When in doubt, try them both.
2. The first time you run N1MM Logger after a new installation, don't run it from a shortcut. Instead, go into the N1MM Logger directory, right-click on the executable (.exe) file, and select "Run as Administrator". It has been suggested that this step may be necessary in some cases, in order for the component that drives the parallel port to be registered properly, and it can't hurt.
K8UT discovered a nifty parallel port test utility at here. The crucial thing it does is totell you-- if it cannot find a port at a given address. It's freeware, and can be used with a voltmeter or something controlled by the LPT port (like a band decoder), with N1MM Logger settings put aside for the moment it will quickly establish whether the port is working properly.
6.2. External DVK Interfacing
When you select DVK on a parallel port, antenna selection via that port is disabled, because the DVK pins and the antenna pins on the LPT port overlap. Following is the table of pin-outs for external DVK control:
F1 pin 3
F2 pin 4
F3 pin 5
F4 pin 6
F5 pins 4 and 6
F6 pins 4 and 5
F7 pins 4, 5, and 6.
When F1-F7 are pressed, a 100 ms. pulse is sent to the relevant pins for external DVK control.
In order to record messages on an external DVK, you will need to connect your microphone to it directly, and follow the procedure outlined in the DVK manual; N1MM Logger support is limited to triggering the first 7 memories when the corresponding Function Key (F1-7) is pressed, and stopping stored message playback when the ESC key is pressed. Some external DVKs have as few as 4 memories, in which case only F1-F4 will trigger playback.
7. Band decoder output
Pins 9, 8, 7 and 2 can be set using the Antenna tab in Configurer. The output on the pins will follow the selected code which is being set up by the selected antenna.
7.1. Sample configs
To replicate the default Top-Ten Devices behavior, you would need to set up the Antenna tab in Configurer as shown above to the left|
It is possible to use more than one antenna per band with N1MM logger. With Alt+F9 it is possible to toggle between these antennas.
NB. Don't forget to add a space after the comma when more than one band is specified (e.g., 7, 3.8, not 7,3.8)
7.2. Sample Config > Antenna for two stacked antennas
You will need to make appropriate provision with a diode matrix on the output of your band decoder to select the appropriate antenna or antennas when a given code is sent from the program to the decoder. For example, if your band decoder outputs positive voltage and you use a tri-band beam with a single coax feedline, you will need diodes to sum the three signals from your band decoder into the one feedline.
8. Bearing data
Bearing data for rotator control is currently not available on the LPT port.
9. Sound card interfacing
9.1. Preferred method
It is better to run the mic through the sound card all the time. That way your audio sounds the same either recorded or live. It also lets you re-record cq's on the fly, something that is really needed for 40m and 80m split cqing. Check out "#1 - Zero or Single Card, One radio, No Sound Card SO2R " which can also be found with more examples in the SO2R section.
Select '1 - Single Card - One radio, No Sound Card SO2R' on the 'Audio' tab in the Configurer and setup the top part of this dialog.
The sound is centered rather than set to a radio channel.
9.2. Another possible soundcard interface.
This is NOT the preferred method any more!
- A 8:1000 ohms transformer should be used when the sound card speaker output is used to the radio microphone input.
- A 600:600 ohms (1:1) transformer should be used when the line output from the sound card is used to the radio microphone input.
10. Serial and Parallel port interfacing under Windows 2000/XP/Vista/Windows 7
Windows 2000, XP, Vista and Windows 7 require a special dll, INPOUT32, which will be installed automatically by N1MM Logger to use the parallel ports.
10.1. Everything on one COM port
By Uffe PA5DD.
Shared ports allow for example Radio control/PTT/PTT-interrupt/CW on just one COM port, which might be all you have on your laptop. It requires that you make a serial splitter or a common interface. There are some pitfalls though:
- Radio control communication is without hardware handshake (as you are using the hardware control pins for other purposes). This is not a problem as such, since hardware handshake is not used by your radio. True at least for ICOM & YAESU.
- Some interfaces wire RTS/CTS together to allow a PC set for hardware handshake to work properly. This link must be removed for port sharing, as it will generate a permanent PTT interrupt on the CTS pin. This will abort your messages as soon as you start them. Also DSR should not be connected to anything.
- In some radio control serial level converters the handshake signals are used as power supply. This is not possible if both RTS & DTR are used for CW/Other. You will have to provide power supply from somewhere else (I use the PS/2 mouse port). Note that in this case you only have to split out GND TXD RXD for the radio control.
10.2. I need more serial ports
By Didier KO4BB
Interrupts are the limiting factor to more than a handful of serial (com) ports. There are 2 ways to address that:
1) You want to use "standard" hardware using Windows "standard" com port model, and as long as the software will let you select IO port and IRQ, and as long as you don't need parallel printer or floppy (and as long as your video card does not use IRQs also), and if the program lets you share IRQs (for instance, you don't need an IRQ for a serial port used to drive the PTT line), (that's a lot of if's!!!) you can probably cram 4 to 6 com ports into a single PC. Note that you may still have problems if you try to run high bit rate on all the ports at once (that should not be a problem with radio control though). Please note that the "standard" PC setup (and Windows) supports 4 com ports with only 2 IRQs. Those who have tried know that you don't want to run high bit rate on COM 1 and COM 3 at the same time because they share the same IRQ.
2a) You do away with standard hardware, and then you can use specialty boards that have 4, 8 or even 16 ports. However, these boards use communication processors so they only need one IRQ from the PC but your software needs to be aware of and be able to communicate with that processor, either through custom software, or through a driver for your OS (Operating System i.e. Windows), or both. That's what ISPs use to gang a bunch of modems to support more than a couple phone lines/modems with each PC. While these may have high communication rate capabilities (because the communications processor uses FIFOs, small memory buffers that store incoming data until the PC is ready to take it), they also offer higher latency (response time) than a native port, not ideal for CW, although with a fast PC, most users have been satisfied with this setup.
2b) USB adapters fall in the category of non-standard hardware, but because USB is now built into the motherboard, the communication processor hardware is directly supported by the BIOS, and the OS has the proper drivers, so that has quickly become a standard. However, the USB standard was not designed to minimize latency, so a USB-serial adapter, while OK to talk to a radio via it's serial port, is not ideal to do things such as CW using bit twiddling. That should be reserved to native serial or parallel ports (motherboard or add-on card). USB adapters are probably a little worse (with regard to latency and CW capability) than custom communication processors described at 2a) because the USB adapters communicate with the PC through a serial link instead of being directly connected to the processor bus, so the bit twiddling has to be done though a serial link, which adds latency. In addition, since the USB port may be shared with other devices, accessing these other devices while sending CW would be a bad thing.
Bottom Line: There are excellent USB combination interfaces now available that can control one or more radios, key them with Winkeyer, and even provide soundcard facilities.
10.3. Renumber your serial ports
As you install new serial ports (serial or USB devices) Windows may arbitrarily assign COM port numbers to them that are outside the COM 1-8 range of the N1MM Logger configuration menu. Reassign the serial/USB port to a different number. Here's how:
- Right click "My Computer"
- Left click on "Manage"
- Left click on "Device Manager"
- Look in the right window and find + Ports (COM & LPT)
- Left click on the Plus sign
- Right click on the COM17 line
- Left click on the "Properties" selection
- Left click on the "Port Settings" tab
- Left click on the "Advanced" button
- Select the COM Port Number you want in the drop down menu
- Click on "OK" a bunch of times to back all the way out
- Your serial/USB port number will now appear as the number you chose
If you have more than one COM port, you can change them all by selecting each one in turn and going through this process.
73 de Bob - K0RC in MN
10.4. Exposing and Deleting Phantom Serial Ports
There may also be some invisible serial port number assignments on your PC. Here is how to have Device Manager expose and remove them:
- Click on the Start button and select All Programs > Accessories.
- In Windows XP, Click on Command Prompt; in Windows Vista, 7 or 8, Right-click on Command Prompt and select the Run as administrator menu item.
- Type set devmgr_show_nonpresent_devices=1 and hit the Enter key.
- Start Device Manager. There are many different ways to do this; one is to right-click on Computer (or My Computer), select Properties, and then click on Device Manager. Another is to find Device Manager in the Control Panel.
- In the Device Manager window, select the View > Show Hidden Devices menu item.
- Click on the + sign next to Ports to see the full list of COM ports that have been assigned in your computer.
- Highlight an unused port number you wish to remove from the list and then press the Delete key. Accept when asked to confirm and continue with any more port numbers that you wish to delete.
Thanks to KK1L and N7WY for this tip.
11. Hooking up a Footswitch
A footswitch can be hooked up to a serial and a parallel port. The footswitch program action is for both LPT and COM ports on switch closure.
11.1. Parallel port
If pin 14 is not used to switch radios using an external SO2R box (for example, by using the Pause key), then hooking up a footswitch to LPT1 can be done by connecting a 10k resistor from pin 14 to pin 15. Pin 14 is normally +5V and provides pull-up voltage for pin 15.. Then connect a normally open footswitch between pin 15 and pin 18 of LPT1. Closing the footswitch pulls pin 15 low and performs the function selected in the configurer.
If pin 14 is being used for Radio A/Radio B control of an external SO2R box, a 5V supply with a 10k series resistor can be used to provide the pull-up voltage for pin 15.
11.2. Serial port footswitch information (using the 9 pin connector numbers)
Connect a 10k resistor between pin 6 and pin 7. Set DTR, pin 4 to "Always On" and RTS, pin 7 to "Always Off". Connect the footswitch between pins 4 and pin 6.
The program action will be on footswitch closure. The footswitch wires can not be referenced or connected to ground.