From 24ee2996af15f5f085dad771245d50d9f3877432 Mon Sep 17 00:00:00 2001 From: Twilight-Logic Date: Mon, 18 Mar 2024 18:51:54 +0000 Subject: [PATCH] HPO3478A cal data fix --- src/AR488/AR488.ino | 13 +++++-------- src/AR488/AR488_Config.h | 2 +- src/AR488/AR488_GPIBbus.cpp | 10 +++++++--- src/AR488/AR488_GPIBbus.h | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/AR488/AR488.ino b/src/AR488/AR488.ino index 249802c..462e793 100644 --- a/src/AR488/AR488.ino +++ b/src/AR488/AR488.ino @@ -14,7 +14,7 @@ #include "AR488_Eeprom.h" -/***** FWVER "AR488 GPIB controller, ver. 0.51.28, 16/02/2024" *****/ +/***** FWVER "AR488 GPIB controller, ver. 0.51.29, 18/03/2024" *****/ /* Arduino IEEE-488 implementation by John Chajecki @@ -631,7 +631,7 @@ uint8_t parseInput(char c) { // Carriage return or newline? Then process the line case CR: case LF: - // If escaped just add to buffer + // If escaped add char 0x10 or 0x13 to buffer and clear Escape flag if (isEsc) { addPbuf(c); isEsc = false; @@ -646,7 +646,6 @@ uint8_t parseInput(char c) { } return 0; } else { -// if (isVerb) dataPort.println(); // Move to new line #ifdef DEBUG_SERIAL_INPUT DB_PRINT(F("parseInput: Received "), pBuf); #endif @@ -679,12 +678,12 @@ uint8_t parseInput(char c) { case ESC: // Handle the escape character if (isEsc) { - // Add character to buffer and cancel escape + // Add character 0x27 to buffer and clear Escape flag addPbuf(c); isEsc = false; } else { - // Set escape flag - isEsc = true; // Set escape flag + // Flag that we have seen an Escape character + isEsc = true; } break; case PLUS: @@ -697,8 +696,6 @@ uint8_t parseInput(char c) { break; // Something else? default: // any char other than defined above -// if (isVerb) dataPort.print(c); // Humans like to see what they are typing... - // Buffer contains '++' (start of command). Stop sending data to serial port by halting GPIB receive. addPbuf(c); isEsc = false; } diff --git a/src/AR488/AR488_Config.h b/src/AR488/AR488_Config.h index c68dfcd..35a6a9c 100644 --- a/src/AR488/AR488_Config.h +++ b/src/AR488/AR488_Config.h @@ -7,7 +7,7 @@ /***** Firmware version *****/ -#define FWVER "AR488 GPIB controller, ver. 0.51.28, 16/02/2024" +#define FWVER "AR488 GPIB controller, ver. 0.51.29, 18/03/2024" /***** BOARD CONFIGURATION *****/ diff --git a/src/AR488/AR488_GPIBbus.cpp b/src/AR488/AR488_GPIBbus.cpp index a2967bc..40ad702 100644 --- a/src/AR488/AR488_GPIBbus.cpp +++ b/src/AR488/AR488_GPIBbus.cpp @@ -3,7 +3,7 @@ #include "AR488_Config.h" #include "AR488_GPIBbus.h" -/***** AR488_GPIB.cpp, ver. 0.51.25, 21/12/2023 *****/ +/***** AR488_GPIB.cpp, ver. 0.51.29, 18/03/2024 *****/ /****** Process status values *****/ @@ -691,13 +691,17 @@ void GPIBbus::sendData(char *data, uint8_t dsize) { if (cfg.eoi) { // Send all characters if (tc) { - state = writeByte(data[i], NO_EOI); // Send EOI with terminator + state = writeByte(data[i], NO_EOI); // Just send the character - EOI will be sent with the terminator } else { state = writeByte(data[i], (i == (dsize - 1))); // Send EOI on last character } } else { // Otherwise ignore non-escaped CR, LF and ESC - if ((data[i] != CR) && (data[i] != LF) && (data[i] != ESC)) state = writeByte(data[i], NO_EOI); + // Filter REMOVED as it afftects read of HP3478A cal data + // if ((data[i] != CR) && (data[i] != LF) && (data[i] != ESC)) state = writeByte(data[i], NO_EOI); + // Filter REMOVED as it affects read of HP3478A cal data + // + state = writeByte(data[i], NO_EOI); } #ifdef DEBUG_GPIBbus_SEND diff --git a/src/AR488/AR488_GPIBbus.h b/src/AR488/AR488_GPIBbus.h index 68c750d..5b61800 100644 --- a/src/AR488/AR488_GPIBbus.h +++ b/src/AR488/AR488_GPIBbus.h @@ -12,7 +12,7 @@ #endif #endif -/***** AR488_GPIBbus.cpp, ver. 0.51.25, 21/12/2023 *****/ +/***** AR488_GPIBbus.cpp, ver. 0.51.29, 18/03/2024 *****/ /*********************************************/