-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMCP3002 Protocol.txt
More file actions
161 lines (160 loc) · 2.42 KB
/
MCP3002 Protocol.txt
File metadata and controls
161 lines (160 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
a = [0,2,6,2,6,0,4,2,6,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,8,12,99];
for(i=0; i<34;i++) {
x=a[i];
console.log("•",i,"["+x+"]")
if(x==0) console.log(" everything LOW");
else {
if(x==99) {
console.log(" - THE END - "); break;
}
if(x&1) {
console.log(" Dout HIGH");
console.log(" . read 1 bit");
}
if(x&2) {
console.log(" Din HIGH");
} else {
console.log(" Din LOW");
}
if(x&4) {
console.log(" CLK HIGH");
} else {
console.log(" CLK LOW");
}
if(x&8) {
console.log(" CS HIGH");
} else {
console.log(" CS LOW");
}
}
}
• 0 [0]
everything LOW
• 1 [2]
Din HIGH |
CLK LOW | START
CS LOW |
• 2 [6]
Din HIGH
CLK HIGH
CS LOW
• 3 [2]
Din HIGH |
CLK LOW | SGL/DIFF = 1
CS LOW |
• 4 [6]
Din HIGH
CLK HIGH
CS LOW
• 5 [0]
everything LOW
• 6 [4]
Din LOW |
CLK HIGH | ODD/SIGN = 0
CS LOW |
• 7 [2]
Din HIGH |
CLK LOW |
CS LOW |
• 8 [6]
Din HIGH
CLK HIGH | MSBF = 1 MSB
CS LOW
• 9 [0]
everything LOW
• 10 [5]
Dout HIGH | Repeated 10 times
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 11 [0]
everything LOW | stop
• 12 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 13 [0]
everything LOW
• 14 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 15 [0]
everything LOW
• 16 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 17 [0]
everything LOW
• 18 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 19 [0]
everything LOW
• 20 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 21 [0]
everything LOW
• 22 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 23 [0]
everything LOW
• 24 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 25 [0]
everything LOW
• 26 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 27 [0]
everything LOW
• 28 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 29 [0]
everything LOW
• 30 [5]
Dout HIGH
. read 1 bit
Din LOW
CLK HIGH
CS LOW
• 31 [8]
Din LOW |
CLK LOW | End of transmission
CS HIGH |
• 32 [12]
Din LOW
CLK HIGH
CS HIGH
• 33 [99]
- THE END -