Blank Frank's RS232 - Lowe HF-225 interface

First Issue 14/10/2001


If you have access to a Lowe HF-225 shortwave receiver, then you might be interested in this page. If you don't, then you'd probably be better off leaving now. What follows is a project I completed some time ago, which allows the Lowe HF-225 to be controlled from a PC, or other device with an available RS232 port. The Rx has an input for a remote keypad, and, consequently, was begging for me to hook my PC up to it. I don't feel the need to spell out the advantages, since you obviously understand or you wouldn't have found this page. In summary though, the combination of hardware and software presented here allows me to select frequencies using mouse clicks, configure preset frequency buttons , log significant events and scan up and down through the frequency range using predetermined step sizes and rates. The only features of the Rx which can be controlled by this system are those which you could access through the keypad - i.e. you can't switch between CW and USB, control volume or whatever by remote control.

When I say the project was completed, I mean that the hardware and micro firmware was worked out and frozen, but the PC side of things is still a work-in-progress - I wrote a simple front-end in VB6 which does what I want, but the help system doesn't exist, the documentation is whatever I include on this page, and there are concessions to user-friendliness which I simply haven't made (yet, if ever). If you haven't lost interest already, and feel you want to go on, be prepared to do some soldering and make sure you have, or have access to, equipment for programming 12C508/9s, which are 8-pin members of the PIC family of micros (you can actually build your own programmer from info available various places online, but I leave that to you plus search engines to sort out). This page includes schematics, PIC object code and the executable and sort of source (in text format, so you can roll your own version) of my VB6 (Win95/95) application, plus enough information on the interface to allow you to write your own application to operate the interface from your platform of choice.

I don't know if this circuit will work unchanged with other Lowe receivers (notably the HF-150) since I have nothing to test it with. Anyway, the usual disclaimers apply. It works for me and you're welcome to have a bash, but I take no responsibility for any damage etc. The project is entirely my own work, done in intellectually sterile conditions, with no awareness of anything else which may or may not attempt to do the same thing, whether a commercial product or a personal project. I did it to satisfy a personal need, and thought it might be worth sharing with the world at large - but it's on a sort of take it or leave it deal. I have another version which actually does the same thing with litle more than an optocoupler, but it plays havoc with various aspects of PC real-time timing, and I have not released it because most people probably want to continue to use their PCs for other things at the same time. It was an interesting challenge though, and gave me a testbed for working out the signal fundamentals which were completely lacking from any documentation on the Rx that I had available.

A note of caution. You will realise from the schematic that the ground of the receiver (formerly floating if you haven't done anything to make it otherwise) is now tied in to the case ground of your PC, which - unless it is a laptop or similar - is tied to mains ground. This may not be what you want. It doesn't give me any problems, but might have intersting effects in thunder storms or whatever, as it provides a new low-resistance path to ground. You should really consider the use of an optocoupler between the PC and the interface (or between the interface and the Rx) or perhaps quick-blow low-value fuses in series with the two lines which connect to the RS232 port. The extra earth connection could also mess up any ground plane strategy you already have, but you will know a lot better than I do what the implications are - shortwave technology is a casual interest to me, not a passion.

The Schematic

here's the circuit, for what it's worth

Nothing much to say really. The resistor types are non-critical - I used metal film, 0.5W, 1%, but you can use whatever comes to hand. The code works fine as supplied in a 12C508. There are components which may seem superfluous (the crystal may be OTT), and others which might be added - optical isolation springs to mind - but I don't really care. If I started again from scratch, I might do it differently, but what I have works fine for me, and there is no commercial agenda to satisfy, so I'm not inclined to revisit it. You can make whatever changes you see fit, but, with respect, I don't wish to discuss changes or offer advice - I've more-or-less lost interest now I've got it working and moved on. The interface takes its power from the 2-wire HF-225 keypad port, and presents no significant load to the RS232 port, so it would be suitable for operation from a hand-held battery-powered device such as a PDA.

The code for the PIC, and the interface protocol

The hex ascii file for programming the PIC is k225.hex, and no, I do not give out the source code for the PIC. The way it works is you send it 5 ascii digits (you could simply type the numeric keys in a Terminal program) followed by a carriage return (Enter key). The carriage return is the trigger though - you can give it as few or as many digits as you want, but as soon as the PIC sees CR it then converts whatever numeric sequence it has into a key code sequence (actually the Clear key followed by 5 digit keys) in a format which is recognised by the receiver. The PIC maintains a pipeline buffer of the last five numbers received, and it presets all digits to zero for the next time after transmission to the HF-225, so you could give it less than five digits before the CR, and it will send five anyway, left-filled with zeros, or you can give it five or more, and it will use the last five it received. I prefer to give the interface exactly five digits always, padding with zeros from the left for frequencies that do not have five digits. The Rx does some processing of the data - it will not accept a five-digit sequence higher than 29999 for instance, so you should make sure you are asking it for something reasonable. To labour the point with an example - if you want 6080kHz, send it 06080(enter), and so on. The RS232 comms spec is 9600,N,8,1.

A picture of my completed interface in all its glory

here's my working version, front and rear views

The PC software, such as it is

screenshot of the my demo in action

This is a screenshot of my VB6 program in action. You can download the file here. Usual disclaimers apply, but in this case I include source so you can review it yourself and decide if it is safe to run if you don't trust me (who would?). What you get is the VB6 executable file win225.exe, a file for preset button values called buttons.txt, and the main source file of the project win225.frm. The program works with the interface as it stands, but is far from being a finished product. The Help and About options do nothing useful - there is no help except what you get below. I took it as far as I needed for personal use, and never got round to making it publication grade. You get win225.frm so that you can recompile it using whatever tools you have available and because I only supply the executable and not any of the runtime support files (which you may or may not already have on your system) - as with some of my other stuff, this is due to the excessive bandwidth load that a full distribution would place on my webspace account. The information on using the hardware interface in the section above should be sufficient to enable you to write your own decent application - as if it wasn't obvious, my attempt took no more than a few hours, and if you look in the project file you'll see lots of commented out bits and half-done things. I make no apology, because I just wanted to get something working quickly and wasn't interested in tidying it up at the time.

Installation instructions

1. Download the zip file, create a directory anywhere convenient and unzip win225.exe and buttons.txt into it.

2. Create a shortcut on your desktop to win225.exe.

3. Decide which COM port you are going to use for the interface and edit the shortcut properties to include the port number in the command line - for example, on my machine win225.exe lives in a subdirectory one level below root called hf225, and the COM port I use is COM 2, so my command line looks like C:\hf225\win225.exe 2. Simple, huh?

Program description, operation and controls

What follows is a mixed bag of information as it comes to mind. You should read it all before going any further, and preferably print out this page because it is your instruction book. I may even use it as the basis for a proper Help file from within the program at some distant point in the future.

In operation, win225.exe does not make use of the Registry or any files outside its own directory. It needs buttons.txt to be present in order to read in any button presets when it starts, and it can write your updated information back to this file when you exit the program. I have supplied buttons.txt almost empty - two of them are set just to give you something to start with. The program can also create a text file called mylog.txt if you ask it to - this is a log file to which records are appended as and when you see fit, at a click of the LOG IT button. Each record consists of the frequency, date, time and anything you type in the comment box, and its purpose is to allow you to review your findings etc at a later date by opening it in a text editor or importing it (it is a comma-delimited file) into your favourite spreadsheet, database or whatever. The above sums up all the file operations performed by the program.

All the program basically does is send the desired frequency to the interface once per second, but only if it has changed since the last time it sent it, while providing some convenient ways for you to select the frequency and preset some buttons (which are effectively memory buttons). I gave it 50 presets, but you could rewrite it to give you as few or as many as you want.

When you launch the program (by double-clicking the shortcut you made earlier), a small panel appears, which has a readout, two vertical sliders, a numeric input keypad, Up and Down buttons, a Stepsize slider and a button which says View All Controls. The readout shows you the current desired frequency, and attempts to imitate what you would actually see on the HF-225 in terms of leading zero suppression etc. The Up and Down buttons, when clicked, cause the frequency to step up or down by the number of kHz set by the Stepsize slider (this value is limited to the range 1 - 9 kHz. The keypad is click-operated, and lets you punch in the frequency you want (* is clear and # is enter). The lefthand vertical slider lets you sweep the entire frequency range from 30 to 29999 kHz, and the righthand one is for fine adjustment once you have set your target roughly using the lefthand one. The top and bottom arrows of the sliders give the final degree of control, down to the last kHz. You need to play with these to get a feel for it, but it should only take you a few seconds. It's much easier than spinning that wheel endlessly. When you push the View All Controls button, you get the window shown in the screenshot.

The full window gives you some other features, and you can always go back to the small one by clicking the button which now says View Simple Controls. You now have a Steptime slider, direction radio buttons, a button marked Auto, a Log It button, a comment box and 50 preset pushbuttons. Depending on whether you select the up or down radio button, when you click Auto, the frequency will step up or down by the value of the Stepsize slider, with time intervals set by the Steptime slider (range is 1 - 9 seconds). Auto in the meantime has changed to Stop, which you click to stop the auto ramping process. You will notice that the 50 buttons are numbered 1 - 50, except those which contain the @ sign. If you hover the mouse over the buttons, you will see a tooltip appear, which says Not Set on the numbered ones and gives you frequency, date, time and an optional comment over the ones with the @ sign. If you click a numbered one, nothing happens (because the button is Not Set) - if you click on one with the @ sign, the frequency will be set to the value of the button as shown in the tooltip. To set a button, first select the frequency you want (or whatever is currently on the display), optionally type some sort of comment (Station name, perhaps) into the comment box, hold down the shift key and click the button. To clear a button that has already been set, hold down the Ctrl key and click the button. To save your settings, use the File / Save Buttons and Exit option - if you don't do this and just Exit, you will not save new information and the program will start up with the same button settings it had the previous time. Finally, to use the log option at any time, just type something into the comment box and click Log It - the frequency, date, time and comment are added immediately to the log file, and there is no need to do anything else on exit.

There is nothing to stop you from having multiple instances of the program, each in its own directory with its own shortcut and button files, if you want lots of buttons - just be aware of potential issues if you try to run all of them at once using the same COM port. You can save button sets away by copying buttons.txt to another file or location - any of the normal obvious stuff, in fact.

That's all.

To uninstall the program, just delete win225.exe, buttons.txt and mylog.txt (and your directory and shortcut, if you want to be thorough).

Note that the program doesn't care if you have hardware attached or not, so you can play with it before you build anything, to see if you like it. Just make sure you assign an available COM port to it, otherwise it might clash with mice and other peripherals.

Let me know how you get on, but please be patient if you have questions. It will take me some time to guage the response to this project (if any) and possibly set up a FAQ section to the page.


View the other delights on my site
Copyright? Possibly .....