Added AD7367.h busy with the .cpp file
- Added AD7367.cpp and 2 examples,
- build was successful
- merged the develop branch into master.
- released an 0.1.0 version
- published on platformIO
- published on Arduino Library manager
So there is an initial version to get started, waiting for your feedback ![]()
Please open an issue on GitHub if there are problems with the code.
Please share the GitHub repository link where you have published the AD7367 library
See post number 10 above
Master branch as develop is merged.
okay
The AD7367 Arduino library README mentions that hardware SPI won’t work due to the ADC having two data channels (DOUTA & DOUTB). I’m trying to understand how the library manages dual-channel reading and if it allows reading both ADC channels simultaneously.
Key Questions:
1.How does the library handle reading from both data channels (DOUTA & DOUTB)?
2. Can I read both channels in a single SPI transaction, or do I need two separate reads?
3. can you give an example CODE for reading two inputs let say +-10 V range?
- The library implements a software SPI alike protocol in which it reads not one but both data channels simultaneously. In the constructor the two data data pins are defined that are used.
- No, SPI does not support two data channels.
- The minimal example shows how to read both channels. One call to read() and two calls to getValue(channel)
okay i will check
void loop()
{
AD.read();
Serial.print(AD.getValue(0));
Serial.print("\t");
Serial.println(AD.getValue(1));
}
in the minimal example ,reading channel 0 and channel1 . What I understand from the data sheet is that either channel1 or channel 2 (of adc-A and adc-B) can only participate communication at a time,(which is determined by ADDR pin).
1.Then how we can read the channel0 and channel1 at a time without changing the ADDR pin.?
2.or you mean getValue(0) corresponds to ADC A , and getValue(1) corresponds to ADC B ?
On which page of the datasheet is this information?
Do you have tested with hardware now?
Datasheet page 17
1.Then how we can read the channel0 and channel1 at a time without changing the ADDR pin.?
When ADDR is LOW you read the values representing voltages of A1 and B1
When ADDR is HIGH you read the values representing voltages of A2 and B2
2.or you mean
getValue(0)corresponds to ADC A , andgetValue(1)corresponds to ADC B ?
Yes, but the ADDR pin has to be set to LOW or HIGH.
It is mentioned in the readme.md FUTURE section under SHOULD to support this pin.
Can work on it when I get feedback about how the library works so far.
Will add these functions to control the ADDR line and REFSEL line from library.
void ADDRpin(uint8_t pin);
void ADDRwrite(uint8_t mode);
uint8_t ADDRread();
void REFSELpin(uint8_t pin);
void REFSELwrite(uint8_t mode);
uint8_t REFSELread();
So one can set the ADDR pin to low and HIGH before the read() to select one of the pairs.
new 0.1.1 version is prepared in develop branch
I'm not happy yet with the function names
Think ADDRwrite() should be ADDRselect() or channelSelect() 0..1 as parameter.
Think REFSELwrite() should be externalReference(bool b = false)
opinion?
okay so the thing is we can only read either channel1 or channel2 at a time(both A & B)
okay, nice
I am facing some hardware issues right now.. I will rectify it and let you know
