summaryrefslogtreecommitdiff
path: root/gpib.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpib.c')
-rw-r--r--gpib.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gpib.c b/gpib.c
index 091aef6..1ad96ca 100644
--- a/gpib.c
+++ b/gpib.c
@@ -202,6 +202,8 @@
#define R_misc 0x15
#define R_sts1 0x10
+#define R_sts2 0x1c
+
#define B_halt (1<<1)
#define R_cfg 0x10
@@ -421,18 +423,17 @@ void GPIB_initialize(void)
DATA_COUNT=0;
Requested_Count=0;
- TNT_Out(R_cmdr,F_softreset); /* Reset FIFOS */
+ // test to detect TNT chip
+ if ((TNT_In(R_sts2) & 0xB0) == 0x90) {
+ is_gpib = 1;
+ } else {
+ is_gpib = 0;
+ printf ("Error: TNT4882 chip not found\n");
+ return;
+ }
+ TNT_Out(R_cmdr,F_softreset); /* Reset FIFOS */
TNT_Out(R_spmr ,0x80); /* This sequence of commands */
-
- if (TNT_In(R_spmr) == 0x80) {
- is_gpib = 1;
- } else {
- is_gpib = 0;
- printf ("Error: TNT4882 chip not found\n");
- return;
- }
-
TNT_Out(R_auxmr,0x80); /* insures that the TNT */
TNT_Out(R_auxmr,0x99); /* will be in the normal 7210 */
TNT_Out(R_keyrg,0); /* mode and not 9914 */