Project

General

Profile

Wiki » History » Version 39

Frédéric Blanc, 2024-12-09 15:24

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 10 Frédéric Blanc
h3. TCA9535 I/O Expander 16-Bit
114 1 Frédéric Blanc
115 16 Frédéric Blanc
Low-Voltage 16-Bit I2C and SMBus Low-Power I/O Expander with Interrupt Output and Configuration Registers,
116 13 Frédéric Blanc
117 10 Frédéric Blanc
!clipboard-202411071059-exmd3.png!
118 16 Frédéric Blanc
VDD 1.65 V to 5 V
119
400-kHz Fast I2C bus.
120 12 Frédéric Blanc
*@I2C*
121
!clipboard-202411071120-iho0j.png!
122 18 Frédéric Blanc
document#243
123 15 Frédéric Blanc
124 16 Frédéric Blanc
h3. ADS1115 Quad ADCs
125 15 Frédéric Blanc
126
16-bit, 860-SPS, 4-channel, delta-sigma ADC with PGA, oscillator, VREF, comparator and I2C
127
128 1 Frédéric Blanc
!clipboard-202411071414-qcbtd.png!
129 16 Frédéric Blanc
VDD 2.0 V to 5.5 V
130 1 Frédéric Blanc
*@I2C*
131 26 Frédéric Blanc
132 1 Frédéric Blanc
|0x48|0b1001000|GND|
133
|0x49|0b1001001|VDD|
134
|0x48|0b1001010|SDA|
135
|0x49|0b1001011|SCL|
136 26 Frédéric Blanc
137 19 Frédéric Blanc
document#242
138 16 Frédéric Blanc
139
h3. LTC2635 Quad DACs
140
141
Quad 12-/10-/8-Bit I2C VOUT
142
DACs with 10ppm/°C Reference
143
!clipboard-202411081042-w1dol.png!
144
VDD 2.7V to 5.5V
145
*@I2C*
146 25 Frédéric Blanc
147 16 Frédéric Blanc
|0x10|0b0010000|GND|
148
|0x11|0b0010001|NC|
149
|0x12|0b0010010|VDD|
150 25 Frédéric Blanc
151 20 Frédéric Blanc
document#244
152 21 Frédéric Blanc
153 29 Frédéric Blanc
h3. IP5306 Battery Management System
154 21 Frédéric Blanc
155
Fully-Integrated Power Bank System-On-Chip with 2.1A charger, 2.4A discharger
156 27 Frédéric Blanc
!clipboard-202411081112-fltgj.png!
157 28 Frédéric Blanc
*@I2C 0x75*
158 21 Frédéric Blanc
document#246
159 30 Frédéric Blanc
160
h3. 24LC512 EEPROM 512Kbit
161
162 31 Frédéric Blanc
!clipboard-202411081325-eulk2.png!
163
VDD 2.5-5.5V
164
400-kHz Fast I2C bus
165
*@I2C*
166
|||A2|A1|A0|
167
|0x50|0b1010000|GND|GND|GND|
168
|0x51|0b1010001|GND|GND|VCC|
169
|0x52|0b1010010|GND|VCC|GND|
170
|0x53|0b1010000|GND|VCC|VCC|
171
|0x54|0b1010100|VCC|GND|GND|
172
|0x55|0b1010101|VCC|GND|VCC|
173
|0x54|0b1010110|VCC|VCC|GND|
174
|0x55|0b1010111|VCC|VCC|VCC|
175 32 Frédéric Blanc
document#247