Skip to content

Commit 5c25f36

Browse files
committed
update readme
1 parent 9d81802 commit 5c25f36

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

README.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Supports Microchip 16bit [MCP3461/MCP3462/MCP3464/](https://www.microchip.com/en
55
## Supported Boards
66

77
This project is set up to be build with different MCUs, but I am not able the test each of them.
8-
Personally I use the SAMD most, so this should be the most stable code.
8+
Personally I use the SAMD21, so this should be the most stable code.
99

1010
### Introduction
1111

@@ -23,29 +23,15 @@ const uint8_t pinMOSI = MOSI, const uint8_t pinMISO = MISO, const uint8_t pinCLK
2323
MCP3x6x(const uint8_t pinIRQ, const uint8_t pinMCLK, const uint8_t pinCS = SS, SPIClass *theSPI = &SPI,
2424
const uint8_t pinMOSI = MOSI, const uint8_t pinMISO = MISO, const uint8_t pinCLK = SCK)
2525
```
26+
So scan mode requieres two additional pins, pinIQR for the conversion interrupt flag and pinMCLK (which is not implemented at all).
2627

27-
Both constructors fall back to default definitions which are common in the Arduino world. So if nothing else is explicit specified the default SPI pinout will be used. But to run in Scan Mode it is mandatory to give one interruptcapable pin as well as one PWM pin (altough MCLK functions are not implemented).
28+
Both constructors fall back to default definitions which are common in the Arduino world. So if no pins is explicit specified the default SPI pinout will be used. Therefor it boils down to something simple as `MCP3561 mcp(2, 3, 10);` or even `MCP3561 mcp(10);`.
2829

29-
For initialization of the ADC you must run once:
30-
```
31-
if (!mcp.begin()) {
32-
// failed to initialize
33-
while (1)
34-
;
35-
}
36-
```
37-
After that you could simple do ```int32_t adcdata0 = mcp.analogRead(0);``` to get a value of the single ended channel0.
30+
Please take a look at the examples how to configure these different modes.
3831

39-
An initialization like this:
40-
```
41-
if (!mcp.begin(2)) {
42-
// failed to initialize
43-
while (1)
44-
;
45-
}
46-
attachInterrupt(digitalPinToInterrupt(8), mcp_handler, FALLING);
47-
```
48-
will enable reading differential channel0, in that case ```int32_t adcdata0 = mcp.analogRead(8);``` will give the result.
49-
This also requires an interupt handler ```void mcp_wrapper() { mcp.IRQ_handler(); }```.
32+
Further documentation is available [here](http://nerdyscout.github.io/Arduino_MCP3x6x_Library).
33+
34+
---
5035

51-
***Setting up and reading (differential) channels will change in further version!***
36+
see also:
37+
- https://github.com/fhnw-ise-qcrypt/mcp3564

0 commit comments

Comments
 (0)