{"id":1668,"date":"2026-08-13T23:30:58","date_gmt":"2026-08-13T23:30:58","guid":{"rendered":"https:\/\/pdp2011.sytse.net\/wordpress\/?p=1668"},"modified":"2026-08-14T00:01:56","modified_gmt":"2026-08-14T00:01:56","slug":"gpib-like-its-nineteen-eighty-something","status":"publish","type":"post","link":"https:\/\/pdp2011.sytse.net\/wordpress\/gpib-like-its-nineteen-eighty-something\/","title":{"rendered":"GPIB like it&#8217;s Nineteen-Eighty-Something"},"content":{"rendered":"\n<p>My last post was about playing with the GPIB support in MINC and my Philips PM6666. A very capable and unassuming counter &#8211; it doesn&#8217;t take up a lot of space, it makes no noise, it doesn&#8217;t get hot or consume lots of power. I don&#8217;t worry about leaving it on when I&#8217;m not there &#8211; well, the power entry module RIFA already blew up, but that&#8217;s been replaced.<\/p>\n\n\n\n<p>There&#8217;s only one thing wrong with the PM6666 really &#8211; it&#8217;s LCD display is a bit hard to read in my dim workshop. So when I ran into a &#8216;reasonably priced&#8217; HP 5335A, I couldn&#8217;t resist &#8211; not even when the listing said that it didn&#8217;t work without specifying exactly what didn&#8217;t. I thought it&#8217;d probably be something simple, and a nice challenge to figure out a solution for.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0369-1024x683.jpg\" alt=\"\" class=\"wp-image-1669\" srcset=\"https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0369-1024x683.jpg 1024w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0369-300x200.jpg 300w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0369-768x512.jpg 768w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0369-1536x1024.jpg 1536w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0369-1200x800.jpg 1200w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0369-600x400.jpg 600w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0369.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0375-1024x683.jpg\" alt=\"\" class=\"wp-image-1670\" srcset=\"https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0375-1024x683.jpg 1024w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0375-300x200.jpg 300w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0375-768x512.jpg 768w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0375-1536x1024.jpg 1536w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0375-1200x800.jpg 1200w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0375-600x400.jpg 600w, https:\/\/pdp2011.sytse.net\/wordpress\/wp-content\/uploads\/2026\/08\/div2026q1-Z9A_0375.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Checking out that ROM CRC error<\/figcaption><\/figure>\n\n\n\n<p>That took me a while, I should say &#8211; mostly because the little voice in the back of my head kept saying &#8216;sure, you&#8217;ve established beyond all reasonable doubt that the ROM is broken, but what else might be wrong with it&#8217;. But all that was quickly resolved when I happened to find another &#8216;reasonably priced&#8217; HP 5335A. And just another couple late night ebay orders later, I&#8217;ve not just fixed the problems of the first one, I now suddenly have two working units!<\/p>\n\n\n\n<p>So next to the PM6666 &#8211; small, unassuming, unobtrusive, now I have two HP 5335A &#8211; very large, very loud, consuming an inordinate amount of energy and producing worrying amounts of heat &#8211; but also with lots and lots of very nice red seven segment displays. And also very, very precise, and very much early-eighties in their GPIB implementation.<\/p>\n\n\n\n<p>In comparison with the PM6666 or later instruments, no, a 5335A doesn&#8217;t do ID commands. A 5335A can report its current setup, but partially &#8211; notably, the gate time is missing. And where the PM6666 reports the setup in sort-of readable text, the 5335A reports it in binary. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">10 I%=15<br>20 SEND(\"PQ \",I%)<br>30 RECEIVE(A$,,I%)<br>40 IF LEN(A$)&lt;2 THEN 30<br>50 IF LEN(A$)&gt;=30 THEN 70<br>60 PRINT \"error\" \\ STOP<br>70 PRINT \"FN=\";ASC(SEG$(A$,1,1))<br>80 PRINT \"B2=\";ASC(SEG$(A$,2,2))<br>90 PRINT \"GC=\";ASC(SEG$(A$,3,3))<br>100 PRINT \"CA=\";ASC(SEG$(A$,4,4))<br>110 PRINT \"CB=\";ASC(SEG$(A$,5,5))<br>120 PRINT \"AR=\";ASC(SEG$(A$,6,6))<br>130 FOR I=7 TO 14 \\ PRINT USING \" ###\",ASC(SEG$(A$,I,I)); \\ NEXT I<br>140 PRINT <br>150 FOR I=15 TO 22 \\ PRINT USING \" ###\",ASC(SEG$(A$,I,I)); \\ NEXT I<br>160 PRINT <br>170 FOR I=23 TO 30 \\ PRINT USING \" ###\",ASC(SEG$(A$,I,I)); \\ NEXT I<br>180 PRINT<\/pre>\n\n\n\n<p>and that might produce output like<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">T5H35P    13-AUG-86  23:35:43<br><br>FN= 1 <br>B2= 0 <br>GC= 0 <br>CA= 32 <br>CB= 0 <br>AR= 0 <br>   0   0   0   0   0   0   0   0<br>   0  16   0   0   0   0   0   0<br>   0  16   0   0   0   0   0   0<br><br>READY<\/pre>\n\n\n\n<p>Ok no that might not be very informative &#8211; but that&#8217;s maybe the point: MINC Basic isn&#8217;t very well suited to decode bit fields, and later instruments are just easier to work with. Sure, you could copy the setup and push it back, but it&#8217;d be so much more useful if it was in a readable format.<\/p>\n\n\n\n<p>So let&#8217;s do a basic measurement. I&#8217;ve set up the generator for a 1MHz sine wave and connected that to the A input, and set the 5335A for the most basic config &#8211; initialize, and function 1 &#8211; FREQ A in R2D2 speak. The first thing that stands out is that the 5335A doesn&#8217;t recognize the end of the MINC strings like all my other instruments do &#8211; note the extra trailing space in line 20 below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">10 I%=15<br>20 SEND(\"in fn1 \",I%)<br>30 RECEIVE(A$,,I%)<br>40 PRINT CLK$;\" \";LEN(A$);A$<br>50 GO TO 30<\/pre>\n\n\n\n<p>but then note the output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">T5H35C    13-AUG-86  23:53:24<br><br>23:53:25  19 F    +999.99964E+03<br>23:53:27  19 F    +999.99964E+03<br>23:53:27  0 <br>23:53:28  19 F    +999.99964E+03<br>23:53:29  19 F    +999.99964E+03<br>23:53:29  0 <br>23:53:31  19 F    +999.99963E+03<br>23:53:32  19 F    +999.99964E+03<\/pre>\n\n\n\n<p>What&#8217;s with all those zero length strings? I&#8217;m not sure, but I&#8217;m getting those on both the 1.0 and 1.1 firmware versions. Maybe the issue that was described in the 1.1 update document was related and timing dependent?<\/p>\n\n\n\n<p>Does it work with the serial poll? Sure:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">10 I%=15<br>20 SRQ_SUBROUTINE(90)<br>30 SEND(\"in wa1 sr1 \",I%)<br>40 TRIGGER_INSTR(I%)<br>50 FOR I=1 TO 5<br>60 PAUSE(.2)<br>70 NEXT I<br>80 GO TO 40<br>90 REM this is the serial poll subroutine<br>100 SERIAL_POLL(D%,,I%)<br>110 RECEIVE(A$,,I%)<br>120 IF LEN(A$)&lt;2 THEN 110<br>130 PRINT CLK$;\" \";A$<br>140 RETURN<\/pre>\n\n\n\n<p>but note line 120 &#8211; and yes, that seems necessary for both the 1.0 and 1.1 versions of the firmware.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">T5H35D    14-AUG-86  00:27:28<br><br>00:27:29 F    +999.99961E+03<br>00:27:30 F    +999.99961E+03<br>00:27:32 F    +999.99961E+03<br>00:27:33 F    +999.99961E+03<br>00:27:34 F    +999.99961E+03<br>00:27:36 F    +999.99961E+03<br>00:27:37 F    +999.99962E+03<\/pre>\n\n\n\n<p>Anyway, instead of replicating the entire previous post with the 5335A &#8211; how about if I try to have both units measure at the same time, how would that work? Obviously it&#8217;d have to use serial poll and reading the results asynchronously.<\/p>\n\n\n\n<p>The way MINC Basic deals with the SRQ signal, as I&#8217;ve described in the previous post, is through the SRQ_SUBROUTINE and SERIAL_POLL commands. Yes, you can list more than one GPIB address to poll on the SERIAL_POLL command &#8211; but it still just polls the listed instruments serially, so it&#8217;s mostly a notational convenience over using two separate commands. For one, you&#8217;d still have to figure out in software which of the units raised the SRQ signal. And because it reports the responding instrument by index &#8211; not by address&#8230; another of those ideas that were probably bright at the time, but not that useful if you actually try to wotk with them. I find it easier to just poll each instrument directly. Like so:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">10 I%=15<br>20 J%=16<br>30 SRQ_SUBROUTINE(110)<br>40 SEND(\"in wa1 sr1 \",I%)<br>50 SEND(\"in wa1 sr1 \",J%)<br>60 TRIGGER_INSTR(I%,J%)<br>70 FOR I=1 TO 25<br>80 PAUSE(.1)<br>90 NEXT I<br>100 GO TO 60<br>110 REM this is the serial poll subroutine<br>120 K%=I%<br>130 SERIAL_POLL(D%,C,I%)<br>140 IF C=1 THEN 190<br>150 K%=J%<br>160 SERIAL_POLL(D%,C,J%)<br>170 IF D%&lt;&gt;65 THEN RETURN<br>180 IF C=1 THEN 190<br>190 RECEIVE(A$,,K%)<br>200 IF LEN(A$)&lt;2 THEN 190<br>210 PRINT CLK$;\" \";D%;\" \";K%;\" \";A$<br>220 RETURN<\/pre>\n\n\n\n<p>and that produces something like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">T5H35E    14-AUG-86  00:44:31<br><br>00:44:31  65   16  F     +999.9999E+03<br>00:44:32  65   15  F    +999.99964E+03<br>00:44:34  65   16  F    +1.0000000E+06<br>00:44:34  65   15  F    +999.99964E+03<br>00:44:36  65   16  F    +1.0000000E+06<br>00:44:36  65   15  F    +999.99964E+03<br>00:44:38  65   16  F     +999.9999E+03<br>00:44:39  65   15  F    +999.99963E+03<br>00:44:40  65   16  F     +999.9999E+03<br>00:44:41  65   15  F    +999.99964E+03<br>00:44:43  65   16  F    +1.0000000E+06<br>00:44:43  65   15  F    +999.99964E+03<br>00:44:45  65   16  F    +1.0000000E+06<br>00:44:46  65   15  F    +999.99964E+03<br>00:44:47  65   16  F    +1.0000000E+06<br>00:44:48  65   15  F    +999.99964E+03<br>00:44:50  65   16  F     +999.9999E+03<br>00:44:50  65   15  F    +999.99963E+03<br>00:44:52  65   16  F    +1.0000000E+06<\/pre>\n\n\n\n<p>except when I shorten the gate time on the V1.1 firmware unit &#8211; the one with address 15, it starts producing spurious measurements. Not sure what is going on there, I&#8217;ll need to do some more research. But I already kind of know the answer: this is GPIB like it&#8217;s 1980.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>My last post was about playing with the GPIB support in MINC and my Philips PM6666. A very capable and unassuming counter &#8211; it doesn&#8217;t take up a lot of space, it makes no noise, it doesn&#8217;t get hot or consume lots of power. I don&#8217;t worry about leaving it on when I&#8217;m not there [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,4],"tags":[],"class_list":["post-1668","post","type-post","status-publish","format-standard","hentry","category-gpib","category-minc","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/posts\/1668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/comments?post=1668"}],"version-history":[{"count":8,"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/posts\/1668\/revisions"}],"predecessor-version":[{"id":1680,"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/posts\/1668\/revisions\/1680"}],"wp:attachment":[{"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/media?parent=1668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/categories?post=1668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pdp2011.sytse.net\/wordpress\/wp-json\/wp\/v2\/tags?post=1668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}