Skip to content

Commit

Permalink
Merge pull request #2 from CircuitSetup/master
Browse files Browse the repository at this point in the history
Merge circuit setup changes to upstream.
  • Loading branch information
CircuitSetup authored Oct 21, 2020
2 parents 8b7d43e + 1cc43f9 commit 9274c51
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions ATM90E32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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
}
}
2 changes: 1 addition & 1 deletion ATM90E32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"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"
},
"version": "1.0.0",
"version": "1.1.0",
"authors":
[
{
Expand All @@ -20,5 +20,5 @@
}
],
"frameworks": "arduino",
"platforms": "*"
"platforms": ["espressif8266", "espressif32", "atmelsam", "atmelmegaavr", "atmelavr"]
}

0 comments on commit 9274c51

Please sign in to comment.