[hp34970a] fixes and improvements on the protocol description

Fri, 18 Jan 2019 12:33:39 +0100

author
David Douard <david.douard@logilab.fr>
date
Fri, 18 Jan 2019 12:33:39 +0100
changeset 111
25cae2c53694
parent 110
64b852fb7470
child 112
534da25d732e

[hp34970a] fixes and improvements on the protocol description

content/hp34970a_protocol.rst file | annotate | diff | comparison | revisions
--- a/content/hp34970a_protocol.rst	Tue Aug 28 15:12:49 2018 +0200
+++ b/content/hp34970a_protocol.rst	Fri Jan 18 12:33:39 2019 +0100
@@ -7,7 +7,7 @@
 :Tags: HP, 34970A, DMM, repair, test equipment
 :series: HP 34970A repair
 :JavaScripts: default.js, WaveDrom.js
-	 
+
 In order to build a replacement display for the HP34970A data
 acquisition unit, I needed to understand the communication protocol
 between the CPU board and the front panel assembly.
@@ -28,7 +28,7 @@
 .. image:: {filename}/images/hp34970a/block_diagram.svg
    :alt: System Block Diagram of the HP34970A.
 
-  
+
 The commnucation between the different system blocks is done with
 asynchronous serial links. They use the rather uncommon bit rate of
 187500 baud, with a classic 8N1 schema.
@@ -56,10 +56,56 @@
 
 - acknowledge values are:
 
-  - 0x99 as a response to the SoT,
+  - one-complement of the received SoT byte, so
+
+	- 0x99 for the 0x66 SoT byte and
+	- 0xCC for the 0x33 SoT byte.
 
   - 0x00 otherise
 
+- a special packet is sent by the Display Panel at startup, which SoT value is
+  ``0x33``, which does not seem to follow the general pattern in which the first
+  value after the SoT byte is the number of arguments.
+
+Initialization sequence
+-----------------------
+
+The initialization transmission is:
+
+.. wavedrom::
+
+   { signal: [
+      {name: "CPU", wave: "zz5x5x5xx", data: ["0xCC", "0x00", "0x00"]},
+      {name: "DP",  wave: "z3x4x4x3x", data: ["0x33", "0x02", "0x00", "0x55"]},
+      ]}
+
+If a key is pressed during while powering the unit on, then the initialization
+of the Display Panel is frozen (with all elements of the display lit) until the
+key is released. In this case, the initialization packet adds the key code of
+that key, typically used with the Shift key pressed in to force a full test of
+the device (in this datagram, ``0x0C`` is the keycode of the Shift key):
+
+.. wavedrom::
+
+   { signal: [
+      {name: "CPU", wave: "zz5x5x5x5xx", data: ["0xCC", "0x00", "0x00", "0x00"]},
+      {name: "DP",  wave: "z3x4x4x4x3x", data: ["0x33", "0x02", "0xFF", "0x0C", "0x55"]},
+      ]}
+
+
+Shutdown sequence
+-----------------
+
+.. wavedrom::
+
+   { signal: [
+     {name: "Rx", wave: "z3x4x44|=4", data: ["0x66", "0x86", "0x55", "0x55","0x55"] },
+     {name: "Tx", wave: "zx5x5xx", data: ["0x99", "0x00"] },
+     ]}
+
+
+CPU -> DP trasmission
+---------------------
 
 The CPU->DP transmission protocol looks like:
 
@@ -76,13 +122,16 @@
 .. wavedrom::
 
    { signal: [
-     {name: "Rx", wave: "z3x4x4x|=x3x4x|3x", 
+     {name: "Rx", wave: "z3x4x4x|=x3x4x|3x",
       data: ["0x66", "0x0C", "0x03", "D3", "0x66", "0x0A", "0x55"] },
-     {name: "Tx", wave: "zx5x5x5x|5x5x5x|x", 
+     {name: "Tx", wave: "zx5x5x5x|5x5x5x|x",
       data: ["0x99", "0x00", "0x00", "0x00", "0x99", "0x00"] },
      ]}
 
-     
+
+DP -> CPU transmission
+----------------------
+
 When the user press a key on the front panel, a slightly simpler "packet transmission" occurs:
 
 .. wavedrom::
@@ -93,6 +142,33 @@
       ]}
 
 
+Commands
+========
+
+The known command bytes sent by the CPU for now are:
+
+:0x00: show text on the main display. N arguments; the characters to display.
+
+:0x0C: show text in the 'channels' area. 3 arguments; the digits to display.
+
+:0x0A: indicators (or flags) to display. 4 arguments; the flag bytes.
+
+:0x08: to set an indicator in low bright mode. 1 argument; the number of the
+       indicator dimm.
+
+:0x09: to set an indicator in hight bright mode. 1 argument; the number of the
+       indicator to highlight.
+
+:0x01: clear the 'shift' button. Typically sent as ``0x01 0x01 0x0E``. 1
+	   argument; 0x0E to clear the 'shift' flag. Other values unknown.
+
+:0x02: might be a reset or clear for the front panel (typically sent as
+	   ``0x02 0x01 0x0C`` packet). 1 argument; unknown.
+
+:0x86: shutdown. 0 argument.
+
+:0x0D: set char at pos dimm (eg 0D 01 02 55 = cursor on the 3rd char)
+
 Sending data to the main display
 ================================
 
@@ -104,7 +180,7 @@
 
 .. image:: {filename}/images/hp34970a/digit.jpg
    :alt: 17-segments digit of the main display.
-	 
+
 The command used to send text to the main display is ``0x00``. The
 character ``0x09`` (tabulation) has a special meaning: it marks the
 beginning and the end of a part of the text to be displayed darker
@@ -139,53 +215,51 @@
       data: ["0x66", "0x0A", "0x04", "F1", "F2", "F3", "F4", "0x55"]}
      ]}
 
-Then the flags I've identified so far are:
+The 29 flags I've identified are (should be complete):
 
 .. wavedrom::
-   
+
    { signal: [
-   {name: "bit", wave: "z========z", 
+   {name: "bit", wave: "z========z",
     data: ["7", "6", "5", "4", "3", "2", "1", "0"]},
 
-   {name: "F1",  wave: "z=3333333z", 
-    data: ["", "HI", "Alarm", "LO", "Channels", "Ch. frame", "Mx+B", "<Bell>"]},
-   {name: "F2",  wave: "z===33333z", 
-    data: ["", "", "", "4W", "1", "3", "4", "2"]},
-   {name: "F3",  wave: "z========z", 
-    data: ["", "", "", "", "", "", "", ""]},
-   {name: "F4",  wave: "z=3=333==z", 
-    data: ["", "CONFIG", "", "MON", "VIEW", "*", "", ""]},
+   {name: "F1",  wave: "z=3333333z",
+    data: ["Al. frame", "HI", "Alarm", "LO", "Channel", "Ch. frame", "Mx+B", "<Bell>"]},
+   {name: "F2",  wave: "z===33333z",
+    data: ["AVG", "", "OC", "4W", "1", "3", "4", "2"]},
+   {name: "F3",  wave: "z========z",
+    data: ["ERROR", "EXT", "ONCE", "", "MEM", "LAST", "MIN", "MAX"]},
+   {name: "F4",  wave: "z=3=333==z",
+    data: ["", "CONFIG", "SCAN", "MON", "VIEW", "*", "ADRS", "REMOTE"]},
     ],
     config: { hscale: 2 },
     }
 
-     
-
-
 
 Keypad
 ======
 
-Note that the front panel sends a "key press event" and a "key
-released event", depending on the value of the bit 7:
-
-:0: key pressed
-:1: key released
-
-The bit 8 of the key event byte is set high for the knob.
+the keycode byte consists in:
 
 .. wavedrom::
 
    {signal: [
-   
-   {name: "bit", wave: "z========z", 
+
+   {name: "bit", wave: "z========z",
     data: ["7", "6", "5", "4", "3", "2", "1", "0"]},
-   {name: "KP", wave: "z34=.....z", 
-    data: ["Knob", "Key", "Key Code"]},
+   {name: "KP", wave: "z344=....z",
+    data: ["Knob", "Rel.", "Shift", "Key Code"]},
     ],
     config: { hscale: 1 },
     }
 
+:Bit 5: is set when the key has been pressed while 'shift' indicator was stil
+		active.
+
+:Bit 6: is set when the key is released, and clear for the key pressed event.
+
+:Bit 7: of the key event byte is set high for the knob key events.
+
 
 The key codes are:
 
@@ -209,6 +283,5 @@
 :0x10: Advanced
 :0x11: Step
 
-For the knob (including the "Knob" bit):
-:0x80: Knob left 
-:0x81: Knob right 
+:0x80: Knob right
+:0x81: Knob left

mercurial