diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/Pyr0_Piezo_Sensor_V2.x.x.cpp b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/Pyr0_Piezo_Sensor_V2.x.x.cpp index a070da2..9a62d52 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/Pyr0_Piezo_Sensor_V2.x.x.cpp +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/Pyr0_Piezo_Sensor_V2.x.x.cpp @@ -15,7 +15,7 @@ * PB7 PCINT7 (Gain Adjustment Resistor 1 'D21') * PD5 T1 (Gain Adjustment Resistor 2 'D5') * PD6 PCINT22 (Gain Adjustment Resistor 3 'D6') - * PB0 PCINT0 (VCC Adjustment Resistors 'D8') + * PB0 PCINT0 (Signal voltage Adjustment Resistors 'D8') * PB1 OC1A (Comparator VRef PWM Out 'D9') * PD3 OC2B (Voltage Follower VRef PWM Out 'D3') @@ -37,7 +37,7 @@ To change trigger active duration: TRG_D [integer for milliseconds] To change gain factor: GAIN_F [integer for gain state - see note*] To change the output logic: LOGIC [0|1] (0 for active low, 1 for active high) To enable piezo plugged detection: PZDET [0|1] (0 for disabled, 1 for enabled) -To set the sensor's output voltage: VCCSW [0|1] (0 for 3.3v, 1 for 5v) +To set the sensor's output voltage: SIGVOL [0|1] (0 for 3.3v, 1 for 5v) To change ADC hysteresis value: HYST [integer in millivolts] To change sensor input pullup vRef low threshold: VFOL [integer in millivolts] To change comparator trigger high threshold: VCOMP [integer in millivolts] diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_cmd.cpp b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_cmd.cpp index 3284c1b..ec76c71 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_cmd.cpp +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_cmd.cpp @@ -81,10 +81,10 @@ void updatePzDet(int value) { /*------------------------------------------------*/ -void updateVccSwitch(int value) { +void updateSigVoltage(int value) { if (value >= 0) { - VCCSW = value; - EEPROM.put(VCCSW_ADDRESS, VCCSW); + SIGVOL = value; + EEPROM.put(SIGVOL_ADDRESS, SIGVOL); } } diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_cmd.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_cmd.h index a38149c..51d7b6e 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_cmd.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_cmd.h @@ -9,7 +9,7 @@ void updateTrigDuration(int value); void updateHysteresis(int value); void updateLogic(int value); void updatePzDet(int value); -void updateVccSwitch(int value); +void updateSigVoltage(int value); void updateConstant(long value); void adjustConstant(int value); void updateDebug(int value); diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.cpp b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.cpp index b681de5..3607b90 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.cpp +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.cpp @@ -10,7 +10,7 @@ int TRG_DUR = TRG_DUR_DEFAULT; int Hyst = HYST_DEFAULT; int LOGIC = LOGIC_DEFAULT; int PZDET = PZDET_DEFAULT; -int VCCSW = VCCSW_DEFAULT; +int SIGVOL = SIGVOL_DEFAULT; int Debug = 0; long voltMeterConstant = VM_CONST_DEFAULT; uint8_t pP_i2c_address = 0x10; @@ -29,7 +29,7 @@ void eraseEEPROM() { EEPROM.put(HYST_ADDRESS, Hyst); EEPROM.put(PZDET_ADDRESS, PZDET); EEPROM.put(LOGIC_ADDRESS, LOGIC); - EEPROM.put(VCCSW_ADDRESS, VCCSW); + EEPROM.put(SIGVOL_ADDRESS, SIGVOL); EEPROM.put(VM_CONST_ADDRESS, voltMeterConstant); } @@ -97,11 +97,11 @@ void restoreConfig() { LOGIC = temp; } - EEPROM.get(VCCSW_ADDRESS, temp); + EEPROM.get(SIGVOL_ADDRESS, temp); if (temp < 0 || temp > 1) { erase = true; } else { - VCCSW = temp; + SIGVOL = temp; } long longTemp; @@ -131,7 +131,7 @@ void setDefaultConfig() { Hyst = HYST_DEFAULT; PZDET = PZDET_DEFAULT; LOGIC = LOGIC_DEFAULT; - VCCSW = VCCSW_DEFAULT; + SIGVOL = SIGVOL_DEFAULT; voltMeterConstant = VM_CONST_DEFAULT; adjustFollow(); adjustComp(); diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.h index cbdcc22..627934e 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.h @@ -41,9 +41,9 @@ extern int LOGIC; // Trigger logic scheme, Active LOW is default #define PZDET_ADDRESS 26 extern int PZDET; // Enable or disable piezo connection detection, default is off -#define VCCSW_DEFAULT 0 -#define VCCSW_ADDRESS 28 -extern int VCCSW; // Set the signal output to 3.3v [0] or 5v logic [1] +#define SIGVOL_DEFAULT 1 +#define SIGVOL_ADDRESS 28 +extern int SIGVOL; // Set the signal output to 3.3v [0] or 5v logic [1] extern int Debug; @@ -55,7 +55,7 @@ extern long voltMeterConstant; // For fine tuning input voltage sense extern uint8_t pP_i2c_address; #ifndef PP_VERSION - #define PP_VERSION "2.3.1" + #define PP_VERSION "2.3.2" #endif // PP_VERSION fallback if python script fails void eraseEEPROM(); diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_function.cpp b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_function.cpp index 288efe1..1efcf02 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_function.cpp +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_function.cpp @@ -178,14 +178,14 @@ void adjustGain() { /*------------------------------------------------*/ void adjustVcc() { - switch (VCCSW) { + switch (SIGVOL) { case 0: - pinMode(VCCSW_PIN, OUTPUT); - digitalWriteFast(VCCSW_PIN, LOW); + pinMode(SIGVOL_PIN, OUTPUT); + digitalWriteFast(SIGVOL_PIN, LOW); break; case 1: default: - pinMode(VCCSW_PIN, INPUT); + pinMode(SIGVOL_PIN, INPUT); break; } } diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.cpp b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.cpp index e459006..27e62aa 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.cpp +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.cpp @@ -38,7 +38,7 @@ void i2cReportConfig() { i2cWrite(buffer, 10, Hyst); i2cWrite(buffer, 12, LOGIC); i2cWrite(buffer, 14, PZDET); - i2cWrite(buffer, 16, VCCSW); + i2cWrite(buffer, 16, SIGVOL); i2cWrite(buffer, 18, voltMeterConstant); memcpy(buffer + 22, PP_VERSION, length - 22); #ifdef __AVR_ATmega328P__ @@ -142,8 +142,8 @@ void i2cInput(int bytesReceived) { break; case CMD_STATE: break; - case CMD_VCCSW: - updateVccSwitch(value); + case CMD_SIGVOL: + updateSigVoltage(value); break; case CMD_VCCADJUST: adjustConstant(value); diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c_config.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c_config.h index 510a3c9..9cdd033 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c_config.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c_config.h @@ -10,5 +10,5 @@ #define CMD_CONFIG 0x09 #define CMD_ERASE 0x0a #define CMD_STATE 0x0b -#define CMD_VCCSW 0x0c +#define CMD_SIGVOL 0x0c #define CMD_VCCADJUST 0x0d \ No newline at end of file diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_pins.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_pins.h index 57ca5c6..0d5ec5e 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_pins.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_pins.h @@ -33,7 +33,7 @@ Default pins (based on Rev.2.x.xPCB layout) #define V_FOL_PWM 3 // PWM analog output pin for voltage follower adjustment #define VCOMP_PWM 9 // PWM analog output pin for comparator adjustment #define PZDET_PIN 16 // Digital input pin for detecting piezo connection -#define VCCSW_PIN 8 // VCC variable regulator switch pin +#define SIGVOL_PIN 8 // VCC variable regulator switch pin #endif //__AVR_ATmega328PB__ @@ -55,6 +55,6 @@ Default pins (based on Rev.2.x.xPCB layout) #define V_FOL_PWM 3 // PD3 PWM analog output pin for voltage follower adjustment #define VCOMP_PWM 9 // PB1 PWM analog output pin for comparator adjustment #define PZDET_PIN 16 // PC2 Digital input pin for detecting piezo connection -#define VCCSW_PIN 8 // PB0 VCC variable regulator switch pin +#define SIGVOL_PIN 8 // PB0 VCC variable regulator switch pin #endif //__AVR_ATmega328P__ \ No newline at end of file diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_serial.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_serial.h index 88699d4..87e09a1 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_serial.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_serial.h @@ -81,9 +81,9 @@ void serialPrintConfig() { Serial.print("PZDET "); Serial.println(PZDET); - Serial.print("VCCSW "); - Serial.print(VCCSW); - switch (VCCSW) { + Serial.print("SIGVOL "); + Serial.print(SIGVOL); + switch (SIGVOL) { case 0: Serial.println(" 3.3v"); break; @@ -146,8 +146,8 @@ void updateParams() { updateLogic(serialLong); } else if (strcmp(serialMessageIn, "PZDET") == 0) { updatePzDet(serialLong); - } else if (strcmp(serialMessageIn, "VCCSW") == 0) { - updateVccSwitch(serialLong); + } else if (strcmp(serialMessageIn, "SIGVOL") == 0) { + updateSigVoltage(serialLong); } else if (strcmp(serialMessageIn, "CONST") == 0) { updateConstant(serialLong); } else if (strcmp(serialMessageIn, "VCCADJUST") == 0) { @@ -172,7 +172,7 @@ void updateParams() { Serial.println(" (0 for active low, 1 for active high)"); Serial.println("To enable piezo plugged detection: PZDET [0|1]"); Serial.println(" (0 for disabled, 1 for enabled)"); - Serial.println("To change the main voltage of the circuit: VCCSW [0|1]"); + Serial.println("To change the main voltage of the circuit: SIGVOL [0|1]"); Serial.println(" (0 for 3.3v, 1 for 5v)"); Serial.println("To change ADC hysteresis value: HYST [integer in millivolts]"); Serial.println("To adjust VCC voltage readings: VCCADJUST [integer in millivolts, use value from multimeter]"); diff --git a/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/i2c.cpp b/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/i2c.cpp index fc36a88..04a5037 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/i2c.cpp +++ b/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/i2c.cpp @@ -56,7 +56,7 @@ config_t requestConfig() { config.Hyst = read16(); config.LOGIC = read16(); config.PZDET = read16(); - config.VCCSW = read16(); + config.SIGVOL = read16(); config.voltMeterConstant = read32(); config.version = Wire.readString(); diff --git a/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/i2c.h b/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/i2c.h index 97b79ae..9ed6b71 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/i2c.h +++ b/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/i2c.h @@ -15,7 +15,7 @@ #define CMD_CONFIG 0x09 #define CMD_ERASE 0x0a #define CMD_STATE 0x0b -#define CMD_VCCSW 0x0c +#define CMD_SIGVOL 0x0c #define CMD_VCCADJUST 0x0d #include "WString.h" @@ -29,7 +29,7 @@ typedef struct { uint16_t Hyst; uint16_t LOGIC; uint16_t PZDET; - uint16_t VCCSW; + uint16_t SIGVOL; uint32_t voltMeterConstant; String version; } config_t; diff --git a/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/pP_serial.h b/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/pP_serial.h index 3357a42..a37046e 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/pP_serial.h +++ b/firmware/AVR-Source/Pyr0_Piezo_i2c_Bridge/src/pP_serial.h @@ -90,9 +90,9 @@ void serialPrintConfig() { Serial.print("PZDET "); Serial.println(config.PZDET); - Serial.print("VCCSW "); - Serial.print(config.VCCSW); - switch (config.VCCSW) { + Serial.print("SIGVOL "); + Serial.print(config.SIGVOL); + switch (config.SIGVOL) { case 0: Serial.println(" 3.3v"); break; @@ -157,8 +157,8 @@ void updateParams() { write(CMD_LOGIC, (uint16_t)serialLong); } else if (strcmp(serialMessageIn, "PZDET") == 0) { write(CMD_PZDET, (uint16_t)serialLong); - } else if (strcmp(serialMessageIn, "VCCSW") == 0) { - write(CMD_VCCSW, (uint16_t)serialLong); + } else if (strcmp(serialMessageIn, "SIGVOL") == 0) { + write(CMD_SIGVOL, (uint16_t)serialLong); } else if (strcmp(serialMessageIn, "CONST") == 0) { write(CMD_CONST, serialLong); } else if (strcmp(serialMessageIn, "VCCADJUST") == 0) { @@ -181,7 +181,7 @@ void updateParams() { Serial.println(" (0 for active low, 1 for active high)"); Serial.println("To enable piezo plugged detection: PZDET [0|1]"); Serial.println(" (0 for disabled, 1 for enabled)"); - Serial.println("To change the main voltage of the circuit: VCCSW [0|1]"); + Serial.println("To change the main voltage of the circuit: SIGVOL [0|1]"); Serial.println(" (0 for 3.3v, 1 for 5v)"); Serial.println("To change ADC hysteresis value: HYST [integer in millivolts]"); Serial.println("To adjust VCC voltage readings: VCCADJUST [integer in millivolts, use value from multimeter]");