From 427e5b5877bca5780f4598e43cbfff545c898cde Mon Sep 17 00:00:00 2001 From: John <34163498+CircuitSetup@users.noreply.github.com> Date: Tue, 11 Feb 2020 09:56:04 -0500 Subject: [PATCH 1/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee5fe04..ff9b939 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ The following are other functions for other metering data that the ATM90E32 calc - GetTemperature() //chip temperature ### Getting Energy Over Time -The following functions get data from the ATM90E32 that is converted to kWh +The following functions get data from the ATM90E32 that is converted to kWh. The registers are cleared once they are read. - GetImportEnergy() //forward active energy - GetImportReactiveEnergy() - GetImportApparentEnergy() From 5949f7c38659eddad69f1eaf3f5c7b36350a4abd Mon Sep 17 00:00:00 2001 From: John <34163498+CircuitSetup@users.noreply.github.com> Date: Mon, 24 Aug 2020 16:28:33 -0400 Subject: [PATCH 2/6] Update ATM90E32.cpp updated SPI mode to mode1 for esp8266 --- ATM90E32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ATM90E32.cpp b/ATM90E32.cpp index aa77309..7393686 100644 --- a/ATM90E32.cpp +++ b/ATM90E32.cpp @@ -41,7 +41,7 @@ unsigned short ATM90E32::CommEnergyIC(unsigned char RW, unsigned short address, #endif #if defined(ESP8266) - SPISettings settings(200000, MSBFIRST, SPI_MODE2); + SPISettings settings(200000, MSBFIRST, SPI_MODE1); #endif #if defined(ESP32) @@ -536,4 +536,4 @@ void ATM90E32::begin(int pin, unsigned short lineFreq, unsigned short pgagain, u CommEnergyIC(WRITE, IoffsetC, 0x0000); // 6C C line current offset CommEnergyIC(WRITE, CfgRegAccEn, 0x0000); // 7F end configuration -} \ No newline at end of file +} From a573bb68ec777b25b8e51b3b4a1412d48ea540d3 Mon Sep 17 00:00:00 2001 From: John <34163498+CircuitSetup@users.noreply.github.com> Date: Mon, 21 Sep 2020 16:38:39 -0400 Subject: [PATCH 3/6] Update library.json bumped version --- library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.json b/library.json index 2ab3147..9d1af9d 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://github.com/CircuitSetup/ATM90E32.git" }, - "version": "1.0.0", + "version": "1.1.0", "authors": [ { From 209f1a5b1a733ab4a6a7a88c91c68d30633c1590 Mon Sep 17 00:00:00 2001 From: John <34163498+CircuitSetup@users.noreply.github.com> Date: Mon, 21 Sep 2020 16:59:17 -0400 Subject: [PATCH 4/6] Update library.json --- library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.json b/library.json index 9d1af9d..f458c28 100644 --- a/library.json +++ b/library.json @@ -20,5 +20,5 @@ } ], "frameworks": "arduino", - "platforms": "*" + "platforms": ["espressif8266", "espressif32", "atmelsam", "atmelmegaavr", "atmelavr"] } From 724beeb7c291ae719f4b70e16ea8cc1e5df4e7a6 Mon Sep 17 00:00:00 2001 From: John <34163498+CircuitSetup@users.noreply.github.com> Date: Mon, 21 Sep 2020 17:03:03 -0400 Subject: [PATCH 5/6] Update library.json --- library.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index f458c28..7b19f4d 100644 --- a/library.json +++ b/library.json @@ -1,7 +1,7 @@ { "name": "ATM90E32", - "keywords": "energy meter, circuitsetup", - "description": "Arduino library for energy meters that use the ATM90E32 IC from Microchip/Atmel", + "keywords": "energy meter, circuitsetup, spi, sensor, iot", + "description": "Arduino library for energy meters that use the ATM90E32AS IC from Microchip/Atmel", "repository": { "type": "git", "url": "https://github.com/CircuitSetup/ATM90E32.git" From 1cc43f9bb9707f5c449afef71b4018e3b7dcd962 Mon Sep 17 00:00:00 2001 From: jdeglavina Date: Mon, 5 Oct 2020 16:27:23 -0400 Subject: [PATCH 6/6] corrected condition for sagv and frequency thresholds --- ATM90E32.cpp | 4 ++-- ATM90E32.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ATM90E32.cpp b/ATM90E32.cpp index 7393686..aa9671d 100644 --- a/ATM90E32.cpp +++ b/ATM90E32.cpp @@ -443,7 +443,7 @@ void ATM90E32::begin(int pin, unsigned short lineFreq, unsigned short pgagain, u /* Enable SPI */ SPI.begin(); - + Serial.println("Connecting to ATM90E32"); #if defined(ENERGIA) SPI.setBitOrder(MSBFIRST); @@ -457,7 +457,7 @@ void ATM90E32::begin(int pin, unsigned short lineFreq, unsigned short pgagain, u unsigned short sagV; unsigned short FreqHiThresh; unsigned short FreqLoThresh; - if (_lineFreq == 4485 || _lineFreq == 5231) + if (_lineFreq == 4485 || _lineFreq == 4231) { sagV = 90; FreqHiThresh = 61 * 100; diff --git a/ATM90E32.h b/ATM90E32.h index 1f37549..73fc10e 100644 --- a/ATM90E32.h +++ b/ATM90E32.h @@ -159,8 +159,8 @@ The MIT License (MIT) #define ANenergyCH 0xAF // C Reverse Harm. Energy /* POWER & P.F. REGISTERS */ -#define PmeanA 0xB1 // A Mean Power (P) #define PmeanT 0xB0 // Total Mean Power (P) +#define PmeanA 0xB1 // A Mean Power (P) #define PmeanB 0xB2 // B Mean Power (P) #define PmeanC 0xB3 // C Mean Power (P) #define QmeanT 0xB4 // Total Mean Power (Q)