HP Forums

Full Version: HP-41 > USB printer simulation (82143A)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hi all,

I've been working on a new project for the HP-41 in order to provide HP-41 <> USB connection.

As a first step I found the unidirectional coms between the HP-41 and the printer to be a good starting point before going further to bidirectional coms.

So far I've developed the module code to handle the 82143A printer ROM and Peripheral interface chip (Helios) in its basic format and transfer the bytes to be printed through the USB (serial interface) to a PC where a slightly modified terminal program shows the printing in a text window.

The USB cable is attached to a standard module shell containing a modified Clonix-like device. Is uses the same Prolific chip for the USB <> serial conversion as it's used in the USB programmer for the Clonix and NoV's module family, so ther'll be no need for further driver installation.

The module is also re-configurable using the same Clonix USB progammer to allow upgrading and/or repurposing for future bidirectional comms use.

Now it comes the difficult part (at least for me): Which platform to use when developing the PC side of the interface?

My programming skills are very limited when it comes to object oriented languages.

So far I've just built the small GUI for the ClonixConfig utility in Visual Basic under .NET; and some testing for this USB > HP41 adapter using Python 2.7(and Boa Constructor).

Further more, serial interfacing is not one of the most popular application nowadays so I've found fery few examples out there to learn from.

I assume that there must be some very good programmers in here, and would like to get advice on the preferred platform and (if possible) some examples of serial interface data handling. :-)

Ejoy your toys!

All the best from Caribbean Sea.

Diego.

Any platform that lets the client software run equally well on bot Windows and Linux/*BSD (and Mac)...

... and I would add: Yes please, I'm a buyer as long as I can make it run under Linux.


Edited: 15 Feb 2012, 2:29 p.m.

Here's a simple example for C# (.Net): Simple Serial

Microsoft Example for VB.Net

Sample Class for serial comms in VB.Net

Java example

The problem with Java is that there are two libraries available: RXTX and JavaComm, and none is available on all platforms (RXTX an Mac and Windows, JavaComm on Linux and Solaris). They are very closely related but not identical. You might want to include an interface library to bridge the gap and provide versions for the common platforms. If you want to go the Java route I may be able to dig deeper into the subject.

After some digging on the Net, it looks like RXTX is the way to start.

Hi Diego,

great thing again:-)

I may be a buyer if the PC-side code doesn't rely on any of the bulky and resource-wasting frameworks.

So please no .NET , and by no means Java!

Maybe Christoph Giesselink would be able to give some hints on using Visual Studio (w/o NET) ?

Regards

Ray

Raymond, without a framework you cannot build GUI software for multiple platforms. .NET is (almost) Windows only but it's readily available on Windows platforms so shouldn't be a problem if you are a Window user anyway.

Java is preinstalled on many platforms as well. Java programs are very easy to distribute because the programs themselves tend to be compact because the bulk of the code is already installed on the target platform. And you do not need to compile for different platforms, a huge advantage for developers. Java has another advantage: The error handling is superb compared to C. Have you ever compared a Java stack trace with a crash from an average Windows program?

QT may be a possibility.

Qt isn't seamless, either, you'll need the libraries on the target platform.

RXTX works fine on Linux.

Not the same, but what would it take to make an HPIL <> USB, but using the HP-IL protocol instead? That way the host computer could implement the HP-IL loop and by means of USB allowing the physical HP-41 to access it?

Hi Håkan, all

The HP-IL approach is already available thanks to J-F Garnier and his PIL-box; which exceeds by far the idea of the simple interface I'm building.

On the other hand, I'd like to keep both the memory and physical footprint as small as possible. Therefore plugging an 82160A HP-IL adapter + PIL-Box is above my target, and it would also fill page #7.

The final idea is to have a standard module with a USB cable, which can behave as a PRINTER, or transfer .ROM image page files to/from a PC and the RAM inside an HEPAX or NoV module... and, may be, allow text program files to be transferred to the HP-41 in a Wand-like fashion... (but this is for now just an idea).

The only things that have been tested so FAR are:

- Program printing in MAN mode and

- Page transfer *to* PC .ROM file.

Here it's how it looks like:

And a program list sample from the 82143A manual (page 23):

I've modified a Visual Basic serial demo program to produce the listing above.

Still a lot of work ahead, but I'm having lotta fun! ;-)

Thanks a lot for the hints and advice, seems I have many things to read before making a decision.

Best wishes from Dominican Republic.

Diego.

Looks great Diego ! - will you be selling these ?

Thanks
John

Hi Jhon,

I thanks for your kind words.

As you can see for the posts above, the project is still in a very early stage. So there will still be a while before I can think in a small production run.

If things run smooth enough may be it can be ready in six to eight weeks.

Cheers.

Diego.

IIRC, JavaComm was first and the community was unhappy with the availability on the various platforms. This was the starting point for RXTX. As RXTX is a GNU project, the necessary native drivers for other platforms can be provided by the community. So RXTX is definitely the way to go for serial communications in Java.

Java is not pre-installed on Windows, Microsoft doesn't include java in Windows since a long time. Hardware vendors might pre install it though. Anyway, My dell laptop didnt have it. On Mac it is currently pre-installed , but it will change in the future because Apple will not provide the Jdk anymore.

Hi, Diego, the man of great ideas!

You seem to know well VB6. If you're going to learn Java or other language to make this interface programm, you may take much more effort and may lost your goal.
Do it on VB6. Linux has a Windows emmulator, doesn't it? Windows runs well programs done in VB6... so, focus on your code ...

Just another idea - good or not!

Artur

I would first go with a command line interface written in C that can be easily compiled on all platform.

Please go with Python here as that runds well on both Windows, Linux, *BSD and Mac.

It needs to be installed on most platforms, though. Whatever the language and associated framework is, you will not find a solution that works out of the box on all relevant systems.

Put me down for at least one!!

Rick

No, and I would prefer a solution that in fact works on all systems rather than one that works only for one system out of the box.

I'm not convinced about the VB solution. JFG's original ILPer is written in VB. The Pilbox is connected over the integrated Serial-USB converter and the virtual COM port driver.

1) Connect ILPer (VB version) over the virtual COM port with the Pilbox

2) Unplug the Piolbox USB cable during connection open

3) Close Pilbox

-> ILPer crashed and ask if you want to send an error report to MS

This is a problem of MS VB serial implementation, and not a problem of the virtual COM port driver. I was not able to solve this problem, so this was one of more reasons to port JFG's VB program to C++.

Christoph

Edited: 16 Feb 2012, 5:18 p.m.

Quote:
I've modified a Visual Basic serial demo program to produce the listing above.

What about my HP82240B printer simulation at http://hp.giesselink.com/hp82240b.htm?

It has a serial mode with the baud rates 1200, 2400, 4800 and 9600 baud. In serial (COM port) mode you can select the printer type "HP-82240B" which starts with the Roman8 character set or "Serial Printer" type for the HP48 series which start with the ECMA94 character set at startup.

Has the 82143A printer a special character set?

Christoph

And it would only be a matter of making it all into a package (program + libraries) and deliver it as a full executable on the various platforms. Then one would of course prefer the framework with the smallest footprint.

Pascal has done this with the new Qt based WP 34S emulators. Qt seems to be viable choice.

Wow!

Must admit that I feel a bit overwhelmed by the quality, diversity and *amount* of your responses: Thank you all! :-)

As I said before I know I have a lot of work ahead but it start to seem pretty clear that I cannot face the task of satisfying all the possible platforms and/or environments.

Moreover, it will take me months (may be years) to get the required expertise in some of the propossed developing tools, to build a "reasonably acceptable" and functional interface.

As it seems that some of you (most all of you) has already got said expertise in one or several of these development/programming languages. And since the 82143A intereface implemented in my HP-41>USB device is *sooo* simple. I think I'd better publish the very few lines required to handle the data reception (remember it's unidirectional) and its presentation. So anyone interested can write a suitable GUI on his/her favourite environment (and hopefully share it with the rest of us).

I'll still have to debug a few things but probably the final release will go "out of the box" with a (hated by most) VB GUI. Well, although not expert in this either, I have some previous experience from the ClonixConfig, and since most of the potential users already have Clonix/NoV's... :-/

BTW the USB interface cable is built with the same chip (Prologic) as the one in the USB programmer for the Clonix/NoV family, so previous users of any of these modules won't require new drivers installation.

Just to point it out, this small gadget is not pretended for replacing the 82143A, basically it's just a tool for saving some paper, *much time*: it tooks 43 seconds to list the complete "PRPLOT" program (340 lines) and the need for the physical (and somehow bulky) printer. Also useful with HEPAX DISASM dumps! In fact it was this point which makes me think in this approach... the text box has been sized to accept the complete disassembled listing of a whole 4K page. ;-)

Of course it does not handle the "graphical" features of the 82143A, and I'm still working in the possibility of implementing the TRACE mode (only MANUAL mode for now), mostly due to CAT listings, (any interest?)

The character set of the 82143A is sort of a nightmare, I've done my best in replacing the most weird characters with the better looking from the UTF-8 set. A look-up table is in charge of replacing the 7 bit code with its "equivalent" unicode.

Again my wholehearted thaks for the "massive" and positive response, and my apologies for not satifiying many of your expectations.

All the best from Dominican Republic.

Diego.