The EV3 uses a Texas Instruments ADS7957 chip. It is connected to the CPU via an [SPI](EV3 SPI).
##Essentials
- 16 channels
- 10-bit resolution
- 20kHz max clock rate
- Using the 5V input mode (i.e. 1024 == 5.00V)
##Documentation
##Channel Usage
Ch. | Connection | Notes |
---|---|---|
0 | Output port B pin 5 | |
1 | Output port A pin 5 | |
2 | N/C | Was battery temperature on pre-release hardware |
3 | Battery current | Uses 0.05Ω shunt resistor, value read is 15x actual voltage |
4 | Battery voltage | Value read is 1/2 actual voltage |
5 | Input port 1 pin 6 | |
6 | Input port 1 pin 1 | |
7 | Input port 2 pin 6 | |
8 | Input port 2 pin 1 | |
9 | Input port 3 pin 6 | |
10 | Input port 3 pin 1 | |
11 | Input port 4 pin 6 | |
12 | Input port 4 pin 1 | |
13 | Output port C pin 5 | |
14 | Output port D pin 5 | |
15 | N/C | Was motor current on pre-release hardware |
##Notes
- In lsm2012, you will see scaling of the value read from the ADC by 4096 (12-bits) instead of by 1024 (10-bits). This is because they are not shifting the value read to the right 2 bits. Since this is a 10-bit chip, the 2 least significant bits read will always be 0.
- A TI employee wrote a hwmon driver for the ADS7957 (source) which is used by lm-sensors. This interface is generally for low-speed (on the order of 1Hz) polling of fan speeds, temperatures, voltages, etc. This does not really fit our needs for ev3dev, so we borrowed some code and wrote our own driver.