Wiki source code of Front I/O

Version 3.3 by Kevin Wiki on 2024/07/04 23:07

Show last authors
1 (% class="row" %)
2 (((
3 (% class="col-xs-12 col-sm-8" %)
4 (((
5 = Pinout =
6
7 There is a single cable that controls four parts, each half side of I/O LED and center column of blue LEDs.
8
9 [[image:xserve io main cable pinout.drawio.png]]
10
11 (% class="wikigeneratedid" %)
12 [[attach:xserve io main cable pinout.drawio.svg||target="_blank"]]
13
14 = How we got here =
15
16 Measure out the ground and power signals by comparing with other chips on board. E.g. we find [SAA1064T] datasheet, locate the GND (Vee) and 5V (Vcc) and measure connectivity (0 ohm resistance) between chip pins and cable pins. This gives us pins GND 2 & 8 and PWR 16 & 22.
17
18 We keep doing this for SCL & SDA pins on SAA1064T chip and find pins 14 & 15 and 20 & 21 are I2C clock and data pins for each chip.
19
20 == Finding i2c chip address ==
21
22 === SAA1064T ===
23
24 Reading the datasheet for SAA1064T chip we find that: "//This results in the corresponding valid addresses HEX 70, 72, 74 and 76 for writing and 71, 73, 75 and 77 for reading. All other addresses cannot be acknowledged by the circuit".// Giving us a clue what we are looking for, i2c addresses 0x70, 0x72 or 0x74.
25
26 === PCA9554 ===
27
28 asdf
29
30 === Code example finding i2c addresses ===
31
32 We can test the following addresses manually or use the following code snippet:
33
34 {{code language="C++"}}
35 /*I2C_scanner
36 This sketch tests standard 7-bit addresses.
37 Devices with higher bit address might not be seen properly.*/
38
39 #include <Wire.h>
40
41 void setup() {
42 Wire.begin();
43
44 Serial.begin(9600);
45 while (!Serial);
46 Serial.println("\nI2C Scanner");
47 }
48
49 void loop() {
50 byte error, address;
51 int nDevices;
52
53 Serial.println("Scanning...");
54
55 nDevices = 0;
56 for (address = 1; address < 127; address++ ) {
57 Wire.beginTransmission(address);
58 error = Wire.endTransmission();
59
60 if (error == 0) {
61 Serial.print("I2C device found at address 0x");
62 if (address < 16)
63 Serial.print("0");
64 Serial.print(address, HEX);
65 Serial.println(" !");
66
67 nDevices++;
68 }
69 else if (error == 4) {
70 Serial.print("Unknown error at address 0x");
71 if (address < 16)
72 Serial.print("0");
73 Serial.println(address, HEX);
74 }
75 }
76 if (nDevices == 0)
77 Serial.println("No I2C devices found\n");
78 else
79 Serial.println("done\n");
80
81 delay(5000);
82 }
83 {{/code}}
84
85 == i2c multiplexing with TCA9548 ==
86
87 We have two sets of chips, one for left and one for right where we have two different i2c chips on each side for controlling lights. Since the chips controlling their respective parts have the same address for each side, we can't distinguish them from each other. To handle this we use a i2c multiplexer to selectively communicate with one half at a time, switching TCA9548 between two different output ports.
88
89 === Code example finding i2c ports ===
90
91 To verify wiring, connection, output ports and device addresses run the following script:
92
93 {{code language="c++"}}
94 /**
95 * TCA9548 I2CScanner.ino -- I2C bus scanner for Arduino
96 *
97 * Based on https://playground.arduino.cc/Main/I2cScanner/
98 *
99 */
100
101 #include "Wire.h"
102
103 #define TCAADDR 0x70
104
105 void tcaselect(uint8_t i) {
106 if (i > 7) return;
107
108 Wire.beginTransmission(TCAADDR);
109 Wire.write(1 << i);
110 Wire.endTransmission();
111 }
112
113
114 // standard Arduino setup()
115 void setup()
116 {
117 while (!Serial);
118 delay(1000);
119
120 Wire.begin();
121
122 Serial.begin(9600);
123 Serial.println("\nTCAScanner ready!");
124
125 for (uint8_t t=0; t<8; t++) {
126 tcaselect(t);
127 Serial.print("TCA Port #"); Serial.println(t);
128
129 for (uint8_t addr = 0; addr<=127; addr++) {
130 if (addr == TCAADDR) continue;
131
132 Wire.beginTransmission(addr);
133 if (!Wire.endTransmission()) {
134 Serial.print("Found I2C 0x"); Serial.println(addr,HEX);
135 }
136 }
137 }
138 Serial.println("\ndone");
139 }
140
141 void loop()
142 {
143 }
144 {{/code}}
145
146 == SAA1064T data for driving center IO LED stack ==
147
148 Center IO stack is a stack of 23 LED's, 22 blue and 1 green for ethernet activity. These are duplicated next to each other and driven by each their SAA1064T chips. Earlier we found the i2c address and just by playing around figured out that 4 segments of 1 byte binary values are used to set ship register.
149
150 {{code language="C++"}}
151 void fillColumns() {
152 Serial.println("filling columns");
153 Wire.beginTransmission(saa1064);
154 Wire.write(1);
155 Wire.write(0x7F); // 127 - 1111111
156 Wire.write(0x7F); // 127 - 1111111
157 Wire.write(0x7F); // 127 - 1111111
158 Wire.write(0x1F); // 31 - 11111
159 Wire.endTransmission();
160
161 colsFilled = 1;
162 }
163 {{/code}}
164
165 (% class="wikigeneratedid" %)
166 Here the last byte we send only is 5 bits since we only have 5 LEDs instead of 6 to address (total of 23). Also note that we start the transmission with a single bit.
167
168 == Pinouts voltages from MLB ==
169
170 Powered off:
171
172 * PWR fail LED - 0.00 V
173 * UID LED - 4.5V
174 * OH/Fan fail LED - 4.72 V
175 * NIC1 LED - 0.8 - 2.6 V
176 * NIC2 LED - 2.95 V
177 * UID SW - 2.8V
178 * HDD LED - 0.00 V
179 * Power LED P3V3 - 0.00V
180 * Power LED - 0.00 V after unplug grows
181
182 Powered on:
183
184 * PWR tail LED - 3.47 V
185 * UID LED - 4.85V
186 * OH/Fan failed LED - 5 V
187 * NIC 1 LED - 1.2 - 2.9 V
188 * NIC 2 LED - 3.2 V
189 * UID SW - 3V
190 * HDD LED - 3 V
191 * Power LED P3V3 - 3.30V
192 * Power LED - 0.87 V
193
194
195 )))
196
197
198 (% class="col-xs-12 col-sm-4" %)
199 (((
200 {{box title="**Contents**"}}
201 {{toc/}}
202 {{/box}}
203
204 [[image:[email protected]]]
205 //Figure 1: [[Sea>>https://commons.wikimedia.org/wiki/File:Isle_of_Icacos_II.jpg]]//
206
207 [[image:[email protected]]]
208 //Figure 2: [[Waves>>https://commons.wikimedia.org/wiki/File:Culebra_-_Playa_de_Flamenco.jpg]]//
209
210
211
212
213
214
215
216 )))
217 )))