Twilight-Logic / AR488

AR488 Arduino GPIB Interface
GNU General Public License v3.0
215 stars 62 forks source link

Custom Board (teensy 3.1 with SN7516X) problems with DAV and SRQ not asserting #37

Closed RussellSenior closed 1 year ago

RussellSenior commented 1 year ago

With current master branch (hash: f5c948f1275ef3c1109b32466cb4cfb077d5caef with the patch below) 0.51.18 on a handwired protoboard using a PJRC Teensy 3.1 and SN75160/SN75161 transceiver chips.

diff --git a/src/AR488/AR488.ino b/src/AR488/AR488.ino
index efe34c9..2d54271 100644
--- a/src/AR488/AR488.ino
+++ b/src/AR488/AR488.ino
@@ -288,6 +288,10 @@ void setup() {
   digitalWrite(LED_BUILTIN, LOW);
 #endif

+#ifdef SN7516X_PE
+  pinMode(SN7616X_PE, OUTPUT);
+  digitalWrite(SN7616X_PE, HIGH);
+#endif

 #ifdef PIN_REMOTE
   pinMode(PIN_REMOTE, OUTPUT);
@@ -1480,7 +1484,7 @@ void rst_h() {
   };
 #else
   // Otherwise restart program (soft reset)
-  asm volatile ("  jmp 0");
+  // asm volatile ("  jmp 0");
 #endif
 }

diff --git a/src/AR488/AR488_Config.h b/src/AR488/AR488_Config.h
index 057a973..f98c865 100644
--- a/src/AR488/AR488_Config.h
+++ b/src/AR488/AR488_Config.h
@@ -24,7 +24,7 @@
 /*
  * Uncomment to use custom board layout
  */
-//#define AR488_CUSTOM
+#define AR488_CUSTOM

 /*
  * Configure the appropriate board/layout section
@@ -155,14 +155,15 @@
  * This will require the use of an additional GPIO pin to control
  * the read and write modes of the ICs.
  */
-//#define SN7516X
+#define SN7516X
 #ifdef SN7516X
 //  #define SN7516X_TE 6
 //  #define SN7516X_DC 13
 //  #define SN7516X_SC 12
   // ONLYA board
-  #define SN7516X_TE 13
-  #define SN7516X_DC 5
+  #define SN7516X_TE 16
+  #define SN7516X_DC 17
+  #define SN7616X_PE 19
 #endif

@@ -265,24 +266,25 @@
 /***** vvvvvvvvvvvvvvvvvvv *****/
 #ifdef AR488_CUSTOM

-#define DIO1  A0  /* GPIB 1  */
-#define DIO2  A1  /* GPIB 2  */
-#define DIO3  A2  /* GPIB 3  */
-#define DIO4  A3  /* GPIB 4  */
-#define DIO5  A4  /* GPIB 13 */
-#define DIO6  A5  /* GPIB 14 */
-#define DIO7  4   /* GPIB 15 */
-#define DIO8  5   /* GPIB 16 */
-
-#define IFC   8   /* GPIB 9  */
-#define NDAC  9   /* GPIB 8  */
-#define NRFD  10  /* GPIB 7  */
-#define DAV   11  /* GPIB 6  */
-#define EOI   12  /* GPIB 5  */
-
-#define SRQ   2   /* GPIB 10 */
-#define REN   3   /* GPIB 17 */
-#define ATN   7   /* GPIB 11 */
+// PORT D
+#define DIO1  2
+#define DIO2 14
+#define DIO3  7
+#define DIO4  8
+#define DIO5  6
+#define DIO6 20
+#define DIO7 21
+#define DIO8  5
+
+// PORT C
+#define IFC   15
+#define NDAC  22
+#define NRFD  23
+#define DAV    9
+#define EOI   10
+#define SRQ   11
+#define REN   13
+#define ATN   12

 #endif
 /***** ^^^^^^^^^^^^^^^^^^^ *****/

I started to play with AR488 in order to talk to an HP 7440A Pen Plotter. Not getting any response, I began probing with a DVM and ++xdiag, and found that two pins (SRQ and DAV) leading to from the Teensy to the SN75161 were not asserting successfully, instead of zero volts, I see about 0.5V instead, not low enough to cause the GPIB side of the SN75161 chip to go low. I don't see an electrical problem on the board (no shorts or opens that I can find).

RussellSenior commented 1 year ago

I'm a big fat dummy. READ THE DATASHEET. Page 2 of the SN75161 explains that TE and DC low force SRQ and DAV to receive mode. So, ++xdiag for those bits are going to give confusing results when connected through SN7516X chips.