gism / esp32_ad7190 Goto Github PK
View Code? Open in Web Editor NEWAD7190 running on ESP (demo)
License: GNU General Public License v3.0
AD7190 running on ESP (demo)
License: GNU General Public License v3.0
I think you are reading the value from the data register even if MOSI never goes low
src/AD7190.cpp
uint32_t AD7190::getDataRegisterAvg(uint8_t sampleNumber) {
uint32_t samplesAverage = 0;
for (uint8_t i = 0; i < sampleNumber; i++) {
waitMisoGoLow(); // TODO: Check if this can be removed
uint32_t v = getRegisterValue(AD7190_REG_DATA, 3);
uint8_t channel = v & 0x7;
samplesAverage += (v >> 4);
}
samplesAverage = samplesAverage / sampleNumber;
return samplesAverage ;
}
examples/AD7190_continuousReadMode/AD7190_ContinuousReadMode.ino
void loop() {
timeOut = !ad7190->waitMisoGoLow();
rawAd7190Data = ad7190->getDataRegisterAvg(3);
if (timeOut)Serial.println("RDY time out");
...
}
Is this deliberate or a bug?
If you change the code to
while (p_ad7190->waitMisoGoLow()) {}
m_rawAd7190Data = p_ad7190->getDataRegisterAvg(3);
The the output rate goes from ~1-11kHz (depending on what is being logged to serial monitor, baud rate, rest of program etc.) to ~30Hz.
When just reading the data regardless of whether MISO has gone low, every few seconds the ADC reading is significantly wrong. I expect this is when the data is being read while the ADC is updating the register values
I expect to get the high frequency, the RDY pin needs to be configured as an interrupt which I will try next.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.