Project

General

Profile

Wiki » History » Version 40

Frédéric Blanc, 2024-12-09 16:16

1 1 Frédéric Blanc
h1. Wiki
2
3 9 Frédéric Blanc
{{toc}}
4 1 Frédéric Blanc
5 9 Frédéric Blanc
h2. USB <-> I2C
6 3 Frédéric Blanc
7 39 Frédéric Blanc
h3. SiLabs CP2112
8
9 3 Frédéric Blanc
!clipboard-202411051457-ujwet.png!
10 1 Frédéric Blanc
Passerelle USB-I2C SiLabs CP2112
11 39 Frédéric Blanc
12
h3. Arduino
13
14
<pre><code class="cpp">
15
#include <Arduino.h>
16
#include <Wire.h>
17
 
18
void setup(){
19
    Wire.begin();    
20
    Serial.begin(9600);
21
} 
22
 
23
void loop(){
24
    byte error, address;
25
    int nDevices;
26
 
27
    Serial.println("Scanning...");
28
 
29
    nDevices = 0;
30
    for(address = 8; address < 127; address++ ){
31
        Wire.beginTransmission(address);
32
        error = Wire.endTransmission();
33
 
34
        if (error == 0){
35
            Serial.print("I2C device found at address 0x");
36
            if (address < 16)
37
                Serial.print("0");
38
            Serial.print(address,HEX);
39
            Serial.println(" !");
40
 
41
            nDevices++;
42
        }
43
        else if (error == 4) {
44
            Serial.print("Unknow error at address 0x");
45
            if (address < 16)
46
                Serial.print("0");
47
            Serial.println(address,HEX);
48
        } 
49
    }
50
    if (nDevices == 0)
51
        Serial.println("No I2C devices found\n");
52
    else
53
        Serial.println("done\n");
54
 
55
    delay(5000);
56
}
57
</code></pre>
58
59
60
https://arduino-france.site/i2c-scanner/
61 1 Frédéric Blanc
62
h3. Commande Linux
63
64 38 Frédéric Blanc
h4. i2c-tools
65 1 Frédéric Blanc
<pre><code class="shell">
66
sudo apt install i2c-tools
67
</code></pre>
68
69 38 Frédéric Blanc
h5. i2cdetect
70
71 1 Frédéric Blanc
<pre><code class="shell">
72
i2cdetect -l
73
</code></pre>
74 6 Frédéric Blanc
!clipboard-202411051520-zo9bt.png!
75 4 Frédéric Blanc
76
<pre><code class="shell">
77 36 Frédéric Blanc
sudo i2cdetect -r -y N
78 4 Frédéric Blanc
</code></pre>
79 5 Frédéric Blanc
N numero I2C ici 5
80 33 Frédéric Blanc
!clipboard-202411081354-28b9g.png!
81 35 Frédéric Blanc
détection de puces I2C, TCA9535 0x20, ADS1115 0x48, PCF8563 0x51
82 1 Frédéric Blanc
83 38 Frédéric Blanc
h5. i2cget
84
85 37 Frédéric Blanc
<pre><code class="shell">
86
sudo i2cget 5 0x20 0x04
87
</code></pre>
88
!clipboard-202411081405-bcbfj.png!
89 1 Frédéric Blanc
lecture dans le TCA9535 0x20, dans le registre 0x4
90 38 Frédéric Blanc
91
h5. i2cset
92 37 Frédéric Blanc
93
<pre><code class="shell">
94
sudo i2cset 5 0x20 0x02 0x01
95
</code></pre>
96
!clipboard-202411081403-zlizw.png!
97
écriture dans le TCA9535 0x20, dans le registre 0x2, les bits 0b00000001
98
99 2 Frédéric Blanc
https://www.acmesystems.it/i2c
100 1 Frédéric Blanc
https://www.youtube.com/watch?v=QwlqOTDAPfk
101 10 Frédéric Blanc
102
h2. Composants
103
104
h3. PCF8563 Real-time clock/calendar
105
106 1 Frédéric Blanc
!clipboard-202411071057-aw2q3.png!
107 16 Frédéric Blanc
VDD = 1.8 V to 5.5 V
108
400-kHz Fast I2C bus
109 11 Frédéric Blanc
*@I2C 0x51*
110 1 Frédéric Blanc
111 17 Frédéric Blanc
document#245
112
113 40 Frédéric Blanc
h3. TCA9555 and TCA9535 I/O Expander 16-Bit
114 1 Frédéric Blanc
115 40 Frédéric Blanc
TCA9535 Low-Voltage 16-Bit I2C and SMBus Low-Power I/O Expander with Interrupt Output and Configuration Registers,
116
TCA9555 is identical to the TCA9535, except for the inclusion of the internal I/O pull-up resistor
117 13 Frédéric Blanc
118 10 Frédéric Blanc
!clipboard-202411071059-exmd3.png!
119 16 Frédéric Blanc
VDD 1.65 V to 5 V
120
400-kHz Fast I2C bus.
121 12 Frédéric Blanc
*@I2C*
122
!clipboard-202411071120-iho0j.png!
123 18 Frédéric Blanc
document#243
124 15 Frédéric Blanc
125 16 Frédéric Blanc
h3. ADS1115 Quad ADCs
126 15 Frédéric Blanc
127
16-bit, 860-SPS, 4-channel, delta-sigma ADC with PGA, oscillator, VREF, comparator and I2C
128
129 1 Frédéric Blanc
!clipboard-202411071414-qcbtd.png!
130 16 Frédéric Blanc
VDD 2.0 V to 5.5 V
131 1 Frédéric Blanc
*@I2C*
132 26 Frédéric Blanc
133 1 Frédéric Blanc
|0x48|0b1001000|GND|
134
|0x49|0b1001001|VDD|
135
|0x48|0b1001010|SDA|
136
|0x49|0b1001011|SCL|
137 26 Frédéric Blanc
138 19 Frédéric Blanc
document#242
139 16 Frédéric Blanc
140
h3. LTC2635 Quad DACs
141
142
Quad 12-/10-/8-Bit I2C VOUT
143
DACs with 10ppm/°C Reference
144
!clipboard-202411081042-w1dol.png!
145
VDD 2.7V to 5.5V
146
*@I2C*
147 25 Frédéric Blanc
148 16 Frédéric Blanc
|0x10|0b0010000|GND|
149
|0x11|0b0010001|NC|
150
|0x12|0b0010010|VDD|
151 25 Frédéric Blanc
152 20 Frédéric Blanc
document#244
153 21 Frédéric Blanc
154 29 Frédéric Blanc
h3. IP5306 Battery Management System
155 21 Frédéric Blanc
156
Fully-Integrated Power Bank System-On-Chip with 2.1A charger, 2.4A discharger
157 27 Frédéric Blanc
!clipboard-202411081112-fltgj.png!
158 28 Frédéric Blanc
*@I2C 0x75*
159 21 Frédéric Blanc
document#246
160 30 Frédéric Blanc
161
h3. 24LC512 EEPROM 512Kbit
162
163 31 Frédéric Blanc
!clipboard-202411081325-eulk2.png!
164
VDD 2.5-5.5V
165
400-kHz Fast I2C bus
166
*@I2C*
167
|||A2|A1|A0|
168
|0x50|0b1010000|GND|GND|GND|
169
|0x51|0b1010001|GND|GND|VCC|
170
|0x52|0b1010010|GND|VCC|GND|
171
|0x53|0b1010000|GND|VCC|VCC|
172
|0x54|0b1010100|VCC|GND|GND|
173
|0x55|0b1010101|VCC|GND|VCC|
174
|0x54|0b1010110|VCC|VCC|GND|
175
|0x55|0b1010111|VCC|VCC|VCC|
176 32 Frédéric Blanc
document#247