The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

HP71B 82164A Help
Message #1 Posted by Howard Owen on 27 Jan 2007, 3:21 p.m.

I'm trying to read the status registers of my 82164A HP-IL to RS232 interface from BASIC on the 71. On page 35 of the 82164A manual, I see a pseudo-code sequence of HP-IL messages to accomplish this:

Unlisten
Talk Address 3
Device Dependent Talker 0
Send Data
.. Data ..
EOT
Untalk

I've been experimenting with implementing that on my 71B, using the HP-IL interface manual. The best I can come up with is this:

  10 D=DEVADDR("%66")
  20 LOCAL
  30 SEND UNL MLA TALK D DDT 0
  40 FOR I=1 TO 14 @ ENTER :LOOP USING "#,B";C0 @ DISP I @ NEXT I
  50 SEND UNT

The motivation for this form of the code is that any attempt to read more than one byte at a time hangs with the T/R lite on the serial interface constantly lit. Consistent with that, the above code displays "1" and then hangs.

Can anyone suggest what I'm doing wrong?

Thanks,
Howard

      
Re: HP71B 82164A Help
Message #2 Posted by Eric Smith on 27 Jan 2007, 8:23 p.m.,
in response to message #1 by Howard Owen

Unless I'm trying to send binary data, I usually just use "PRINTER IS" and then print to the serial interface.

Anyhow, the only thing I can think of that would explain it stalling on ouptut is if it is expecting hardware handshaking on the serial port. But perhaps someone else here actually has more 82164A experience than I have.

            
Re: HP71B 82164A Help
Message #3 Posted by Howard Owen on 28 Jan 2007, 12:27 p.m.,
in response to message #2 by Eric Smith

Hi, Eric

The above code is trying to get a dump of the status registers from the interface. That shouldn't require any activity on the RS-232 side of the interface at all. Even so, I had that side configured to do hardware handshaking with the following code from JF's 82164 cable doc:

10 ! --- SETRS ---
20 D=DEVADDR(β€œ%66”)
30 REMOTE
40 OUTPUT D;”LI5;C0”
50 LOCAL
60 END

That code turns off software flow control and disables DTR control. That leaves RTS/CTS handshaking on.

The code does behave differently when I attach a USB-Serial cable to the RS-232 side. With Hyperterminal running so that DISPLAY IS works, the code in my first post stops with a "DEVICE NOT READY" error in line 40. It displays "1" first, so it's the second iteration through the FOR loop that returns the error. That certainly sounds like a flow control issue of some sort. But turning off all hand shaking makes no difference. It's possible I'm not following the HP-IL protocol as to how to receive data after the DDT 0 command.

Regards,
Howard

                  
Re: HP71B 82164A Help
Message #4 Posted by Garth Wilson on 28 Jan 2007, 4:49 p.m.,
in response to message #3 by Howard Owen

I have the FSI-164A which is not quite identical to the 82164. You may be trying to do something I haven't needed to up to now, but it seems like you're doing it the hard way. I have never had to address the registers directly, but use the commands instead, also letting the OS take care of the internals of HPIL protocol. A typical setup on mine mine look like:

10 RESTORE IO @ A=DEVADDR("RS232") @ REMOTE @ OUTPUT :A ;"C0;SBE;R0;R1;SL0" @ LOCAL

Garth

E-mail addr: wilsonmineszdslextremezcom (replace the z's with @ and . )

                        
Re: HP71B 82164A Help
Message #5 Posted by Howard Owen on 28 Jan 2007, 11:45 p.m.,
in response to message #4 by Garth Wilson

Hi, Garth,

Yes, there are two ways to get and set the status registers. In addition to the REMOTE mode you demonstrate, there's the Device Dependent (Listener|Talker) method that takes place in LOCAL mode. I'm trying to get to know this interface better, so I was trying out the DDT method of dumping the registers. I think I'm probably missing pieces of the protocol, or else mixing the SEND and ENTER approaches is running afoul of how ENTER treats HP-IL.

I did finally have a look at Friedman's "Control the World with HP-IL". He has several interesting examples of practical 71B code addressing the 82164A. In particular, this sequence from page 263 shows an initialization of the interface with the DDL method:

20 A=DEVADDR("RS232") 30 SEND UNT UNL LISTEN A MTA DDL 0 DATA 0,0,0,0,0,0,0,14 UNT UNL 40 PRINTER IS :RS232

This is setting the registers, not reading their contents. But it's close to what I came up with. (I modified my code to do both UNT and UN after reading this - no help.) So I'm pretty sure the problem has to do with reading the bytes off HP-IL with ENTER. It's probably doing some loop maintenance itself, which could throw things for a .. er.. loop.

Regards,
Howard

                              
Re: HP71B 82164A Help
Message #6 Posted by J-F Garnier on 29 Jan 2007, 6:41 a.m.,
in response to message #5 by Howard Owen

Hi Howard,

Yes, I think the problem is the multiple ENTER statements : each will probably send a SDA (send data), enter one byte, then send a NRD (Not Ready for Data).

A better way would be:

  
   5 DIM A$[14]  
  10 D=DEVADDR("%66")
  20 LOCAL
  30 SEND UNL MLA TALK D DDT 0
  40 ENTER :LOOP ;A$
  50 SEND UNT

Without any guarantee, I didn't test it!

J-F

                                    
Re: HP71B 82164A Help
Message #7 Posted by Howard Owen on 29 Jan 2007, 11:59 a.m.,
in response to message #6 by J-F Garnier

Hi, JF,

Here's what I came up with that actually works:

10 OPTION BASE 1 20 DESTROY C$ @ DIM C$[14] 30 D=DEVADDR("%66") 40 LOCAL 50 SEND UNT UNL MLA TALK D DDT 0 60 ENTER :LOOP USING "#,14A";C$ 70 SEND UNT 80 END

It doesn't work without the image because the 82164A is using EOT as a line separator, instead of a line feed. This code also works:

  10 OPTION BASE 1
  20 DESTROY C$ @ DIM C$[14]
  30 SFLAG -23
  40 D=DEVADDR("%66")
  50 LOCAL 
  60 SEND UNT UNL MLA TALK D DDT 0 
  70 ENTER :LOOP ;C$
  80 SEND UNT 
  90 END 

System flag 23 sets the end of line character to EOT, which is what the 82164A uses.

Thanks for your help!

Regards,
Howard


[ Return to Index | Top of Index ]

Go back to the main exhibit hall