The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

HP-71B - Understanding HP-IL Protocol
Message #1 Posted by Mike on 31 May 2006, 2:49 p.m.

Well, I'll be pouring over the books this weekend, trying to learn the ins and outs of the HP-IL protocol, at the chip level. I want to understand this at the microprocessor level; not higher language communications like with BASIC.

I was wondering... if one connects two HP-71B together, one being the controller and the other being the device, could one write a program using the FORTH Assembler (on the device side), that could read the HP-IL controller chip directly, bypassing the OS handling of the controller? I assume that's possible and might be an interesting way to learn the HP-IL interface.

Are the hardware addresses, for the HP-IL controller chip, documented somewhere, for the HP-IL module. I wold like to write such a program, to dump and handle the protocol of data coming across the HP-IL, as an exercize in understanding this protocol?

Anyone know?

Edited: 31 May 2006, 2:50 p.m.

      
Re: HP-71B - Understanding HP-IL Protocol
Message #2 Posted by Chris Roccati on 31 May 2006, 3:33 p.m.,
in response to message #1 by Mike

The documentation of the protocol itself, from the physical layer to the meaning of every single protocol packet is documented in the book "The HP-IL System: An Introductory Guide to the Hewlett-Packard Interface Loop"...

The actual hardware involved is only briefly mentioned in the book and there's no mention to specific implementations.

      
Re: HP-71B - Understanding HP-IL Protocol
Message #3 Posted by Garth Wilson on 31 May 2006, 3:47 p.m.,
in response to message #1 by Mike

The 71's HPIL internal design specifications volumes 1 & 2 total 950 pages, and are available on CD 5 from this website. The Forth/assembler IMS/IDS, with 528 pages, is also on CD 5. The three volumes of the 71's hardware internal design spec.s are on CD 7.

            
Got plenty of documentation
Message #4 Posted by Mike on 31 May 2006, 5:02 p.m.,
in response to message #3 by Garth Wilson

I have plenty of documentation on this, including "The HP-IL Interface Specification", the HP-71 HP-IL IDS (V1 and V2), and the actual controller chip specification "The HP-IL Integrated Circuit User's Manual", which was meant for hardware designers using HP-IL. It covers everything about the ILB3-0003, including all the register and bit level access, timing diagrams and state diagrams.

Like I said, I have a lot of reading to do this weekend. But I still wonder if an HP-71B program can access the controller chip, via program written with the FORTH Assembler, as well as specific register addresses for the controller.

Edited: 31 May 2006, 5:09 p.m.

                  
Re: Got plenty of documentation
Message #5 Posted by Garth Wilson on 31 May 2006, 6:39 p.m.,
in response to message #4 by Mike

Quote:
I still wonder if an HP-71B program can access the controller chip, via program written with the FORTH Assembler, as well as specific register addresses for the controller.
Since assembly and Forth give you control down to the metal, the answer would have to be yes.
                  
Re: Got plenty of documentation
Message #6 Posted by Eric Smith on 31 May 2006, 7:42 p.m.,
in response to message #4 by Mike

The HP-71B does NOT have direct register access to the 1LB3-equivalent HP-IL control chip. The HP-IL module contains a microcontroller which interacts with the HP-71B's Saturn processor via a "mailbox" which is memory-mapped in the latter's address space. The HP-71B provides relatively high-level commands, rather than the equivalent of reading and writing the 1LB3 registers.

From a functional point of view this is a good thing; the microcontroller in the HP-IL module handles all of the low-level details without much interaction from the main processor. However, if your desire is to understand how to program the 1LB3, studying the HP-71 HP-IL module won't help. Your best bet for learning to use the 1LB3 directly would be the 82973A ISA to HP-IL inteface card or equivalent, and a PC old enough to have ISA slots. Note that the HP-supplied software for the 82973A will not work correctly on most PCs using a 386, 486, Pentium, etc. However, this is due to poor design of the HP software, not any hardware problems with the card, and the card is perfectly capable of operating in those computers if you write your own software.

At one time it appeared that HP might make their microcontroller with integrated HP-IL interface available to third parties, but that never happened. The chip is related to the controller chip in the Thinkjet printer (even in most of the non-HP-IL Thinkjet printers).

Apparently it was a home-grown 8-bit microcontroller. Back in the early 1980s it wasn't as easy to buy an off-the-shelf microprocessor core that could be licensed for an ASIC.

Anyhow, the most important thing to understand when developing for HP-IL is the behavior of the many state machines in the HP-IL Interface Specification. The Kane and Harper book is a good introduction but does not provide the level of technical detail neceessary to develop a fully compliant device.

Note also that the 1LB3 implements portions of some of the lower level state machines itself. IIRC, it is involved in the Driver, Receiver, Source Handshake, and Acceptor Handshake functions. Thus the software state machines for these functions have to be rather different than what's described in the HP-IL specification, since the chip and the software have to work together to meet that specification. Pages 3-9 through 3-12 give flowcharts for the required D, R, SH, and AH state machines, and page 3-8 gives an example of a main control loop that invokes each individual state machine in turn.

You will also find the HP application note "Firmware Design for HP-IL Devices" to be useful. It provides pseudocode for some of the functions an HP-IL device needs to implement. It's on MoHPC CD3.

When implementing an HP-IL device, there may be some temptation to just "wing it" and write ad-hoc message processing code rather than strictly implementing the state machines. I would strongly urge any HP-IL developer to avoid that temptation, as that path leads to non-compliant devices that do not interoperate consistently, and in which it is very difficult to fix bugs.

                        
So, what documentation is best for this case?
Message #7 Posted by Mike on 31 May 2006, 7:52 p.m.,
in response to message #6 by Eric Smith

Quote:
The HP-IL module contains a microcontroller which interacts with the HP-71B's Saturn processor via a "mailbox" which is memory-mapped in the latter's address space. The HP-71B provides relatively high-level commands, rather than the equivalent of reading and writing the 1LB3 registers.

From a functional point of view this is a good thing; the microcontroller in the HP-IL module handles all of the low-level details without much interaction from the main processor.


This might be a good thing, as you say. Is this "mailbox" interface fully documented somewhere? HP-71B HP-IL IDS perhaps? Is the electrical interface to the HP-IL module documented in one of these documents?

But, with regards to the HP-IL module, I'd like to be able to interface it with a processor different from the HP-71B processor. I would like to interface the HP-IL module to another system and give it the memory access it needs for the mailbox. If the processor in the HP-IL module handles all the HP-IL commmands, what I need to know is the interface of the HP-IL module so that I can give it access to a "mailbox" in my design. Then, I'd also need to know the protocol or content values in this "mailbox". What document is best for understanding that?

Is this "mailbox" simply memory that the HP-IL module can access apart from any control or interference by the 71B? If so, the interface and message protocol, to this mailbox, should be all I need to understand, for my application. I could use my other micro to access that "mailbox" and obtain data across the HP-IL interface. [/quote]I want to do both, actually. I have a source for these 1LB3 chips and I need to understand that as well.

I also have the HP Museum CD set and will start there and look through the documents for the electrical interface to the HP-IL module.

Upon first look, it appears that the HP-71B IDS and HP-IL IDS contain the interface information I need. [quote]However, if your desire is to understand how to program the 1LB3, studying the HP-71 HP-IL module won't help.

Edited: 31 May 2006, 8:14 p.m.

                              
Re: So, what documentation is best for this case?
Message #8 Posted by Eric Smith on 1 June 2006, 4:41 a.m.,
in response to message #7 by Mike

Quote:
This might be a good thing, as you say. Is this "mailbox" interface fully documented somewhere? HP-71B HP-IL IDS perhaps?

Yes, that's where it is documented.

Quote:
what I need to know is the interface of the HP-IL module so that I can give it access to a "mailbox" in my design.

Standard Saturn bus interface, as documented in the HP-71B Hardware IDS. A four-bit data bus, a command/data select, and a strobe (clock). Addresses and data are transferred nibble serially.

Quote:
I want to do both, actually. I have a source for these 1LB3 chips and I need to understand that as well.

Unless you simply have too much time on your hands, I'd recommend only trying to do one or the other. Since you indicated that you have a supply of 1LB3 chips, I'd recommend learning how to use that, since in general they're much more readily available than the HP-71 HP-IL module, and the chip is arguably easier to interface from a hardware point of view (standard DIP, standard 8-bit bus interface).

                                    
You have a point there
Message #9 Posted by Mike on 1 June 2006, 10:02 a.m.,
in response to message #8 by Eric Smith

What I had planned to do was use the HP-IL module with an HP-71B to try and understand the HP-IL software protocol. That would require building no hardware.

Then, I'd build some hardware and use the ILB3 chip in the design and implement what I learned using the HP-IL module. But you may be right. It might just be easier to jump to step two.

Edited: 1 June 2006, 10:06 a.m.

                                          
Re: You have a point there
Message #10 Posted by Eric Smith on 1 June 2006, 3:56 p.m.,
in response to message #9 by Mike

I was a beta tester for the 82166C component kit. I built an HP-IL card for the Apple II. The hardware was very simply, so it only took about an hour to design and a half day to wire up, and worked the first time. The software took months of spare-time effort, but was arguably the interesting and fun part of the project.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall