diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2013-04-08 14:28:00 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2013-04-08 14:28:00 -0400 |
commit | 9bf3eecdcb6273c92e27ad233b7497624c33b792 (patch) | |
tree | 9814697641f6c9af3fce9035f24ce60c46c0e677 | |
parent | dc99289acd9644a365bbe662deaac2fef1b3035f (diff) |
add a dedicated pin to reset GPIB, becase SYS_RESETn is flaky
-rw-r--r-- | bus.c | 3 | ||||
-rw-r--r-- | bus.h | 1 | ||||
-rw-r--r-- | gpib.c | 7 |
3 files changed, 10 insertions, 1 deletions
@@ -356,7 +356,8 @@ static unsigned gpio_pins[] = { GPIO0_X + 22, // i.e., GPIO0_22 GPIO1_X + 15, // i.e., GPIO1_15 GPIO1_X + 14, GPIO0_X + 27, - GPIO1_X + 12 + GPIO1_X + 12, + GPIO2_X + 1 }; @@ -19,6 +19,7 @@ #define OUTPUT_RELAY 4 /* output enable/disable relay */ #define PW_ENABLE 5 /* TTL enable/disable output */ #define POWER_FAIL 6 /* pulled low if +24V OK, pulled high if power fails */ +#define RST_GPIB 7 /* don't use SYS_RESETn for this purpose - unpredictable */ // A5, A6 used to select chips #define Octal_DACportCS_low 0x00 @@ -413,6 +413,13 @@ static void TNT_Gen_Error(int code) /*----------------------------------------------------------------------------------------------------------*/ void GPIB_initialize(void) { + // The RST_GPIB pin should already be low - defaults to low at + // power on. + bus_setpin(RST_GPIB, 0); + g_usleep(1); + bus_setpin(RST_GPIB, 1); + g_usleep(100); + INTERFACE_STATUS=0; /* Initialize Globals to zero */ INTERFACE_ERROR=0; DATA_COUNT=0; |