First draft for clippy sonar
[challenge-bot] / pcb / index.html
1 <HTML>
2 <Head>
3 <Title>
4 MBino (Rev. C)
5 </Title>
6 </Head>
7 <Body>
8 <H1>
9 MBino (Rev. C)
10 </H1>
11 <P>
12 </P>
13 <H2>
14 Table of Contents
15 </H2>
16 <P>
17 <UL><LI>
18 <A HRef="#Schematic">
19 1.0 Schematic</A>
20 </LI><LI>
21 <A HRef="#Design_Files">
22 2.0 Design Files</A>
23 </LI><LI>
24 <A HRef="#Errata_and_Notes">
25 3.0 Errata and Notes</A>
26 </LI><LI>
27 <A HRef="#Bootloader">
28 4.0 Bootloader</A>
29 </LI><LI>
30 <A HRef="#IDE">
31 5.0 IDE</A>
32 </LI></UL>
33 </P>
34 <H2>
35 <A Name="Schematic">
36 1.0 Schematic</A>
37 </H2>
38 <P>
39 The schematic is available as either a
40 <A HRef="mbino.pdf">
41 .pdf</A> file or as a
42 <A HRef="mbino.svg">
43 .svg</A> (Scalable Vector Graphics) file.
44 The .pdf file should print reasonably well on a black
45 and white printer. The .svg file is embedded below:
46 </P>
47
48 <Img Src="mbino.svg">
49 <P>
50 There are two 2.1mm power jacks , N1 and N3.
51 N1 feeds power through protection diode D1 and
52 protection resettable polyfuse F2 to the LPWR1
53 and LWPR2 pins of MakeBus connector N2. D1 protects
54 everthing if the power accidentally comes in with
55 reverse polarity on N1. (Connector N2 is labeled as
56 "Robus" which is the previous bus name to "MakerBus".)
57 The ground line of N1 is also connected to LGND1
58 and LGND2 of N2. The same thing happens with N3,
59 F1, and D2 with BPWR1, BPWR2, BGND1, and BGND2 on N2.
60 </P><P>
61 The LPWR1 and LPWR1 lines from N2 are further connected
62 to the 5V linear regulator U1 and the 3.3V linear
63 regulator U2 to provide 5 volts and 3.3 volts respectively.
64 </P><P>
65 CANH and CANL of N2 or connected to the 5V CAN bus
66 transceiver chip U3. The 1 &times; 3 jumper J1 can
67 be jumpered to connect a 124 ohm termination resistor R6.
68 The 24K resistor R9 enables slope control for U3.
69 The TXD and RXD pins are connected to the microcontroller
70 U4 pins PD3 (TXD1) and PD2 (RXD1). Capacitors C5-C10
71 are .1&micro;F bypass capacitors for U4 and U3.
72 16MHz crystal X1 and crystal 22pF capactiors C4 and C5
73 provide the 16MHz frequency reference for U4.
74 </P><P>
75 Connector N4 is a 2&times;8 pin combined JTAG and
76 serial download connector that connects to the
77 various JTAG pins on the microcontroller (U4).
78 The serial debug lines from N4 are also connected
79 to the 1&times;6 serial cable pin N5 before
80 connecting to PD1 (TXD0) and PD0 (RXD0) on U4
81 through 1K ohm resistors R2 and R3. R2 and R3
82 pins D0 (N9) and D1 (N9) to have priority over
83 over both N4 and N5 is voltage sources are connected
84 to both at the same time. It is a really bad idea
85 to attempt to use both N4 and N5 for serial downloading
86 at the same time. 10K ohm resistor R1 and 1&micro;F
87 capacitor C12 provide a simple reset circuit to trigger
88 RESET on U4. The reset button SW1 can also be used
89 to manually reset U4.
90 </P><P>
91 470 Ohm resistor R8 and LED D4 are connected to D13
92 (N8) to provide an on-board LED. 470 ohm resistor R7
93 and bicolor LED D3 are only meant to be used for
94 debugging; they are not installed in the final product.
95 Connectors N6 (Power/Reset pins), N7 (ISP header),
96 N8 (D0-D13, GND, AREF), N9 (D0-D7) and N10 (A0-A5)
97 are used used to connect to Arduino compatible shields.
98 </P><P>
99 4.7K ohm resistors R4 and R5 are available to be used
100 as pull up resistors for the I<Sup>2</Sup>C bus pins
101 connected to D13 (SCK) and D12 (MISO) pins on U4.
102 </P>
103 <H2>
104 <A Name="Design_Files">
105 2.0 Design Files</A>
106 </H2>
107 <P>
108 This board was designed using KiCAD. The design
109 files are kept at
110 <A HRef="http://github.com/waynegramlich/mbino">
111 http://github.com/waynegramlich/mbino</A>.
112 </P>
113 <H2>
114 <A Name="Errata_and_Notes">
115 3.0 Errata and Notes</A>
116 </H2>
117 <P>
118 The following errors and issues are noted:
119 <UL><LI>
120 A reset circuit for MakerBus is needed.
121 </LI></UL>
122 </P><P>
123 The design notes for the reset circuit are:
124 <UL><LI>
125 Use a SNLVC2G06 (dual open collector inverter):
126 </LI><LI>
127 At VCC = 5V:
128 <UL><LI>
129 V<Sub>IH</Sub> = .7 * V<Sub>CC</Sub> = 3.5V
130 </LI><LI>
131 V<Sub>IL</Sub> = .3 * V<Sub>CC</Sub> = 1.5V
132 </LI><LI>
133 V<Sub>OL</Sub> = .55V
134 </LI><LI>
135 I<Sub>OL</Sub> = 32mA
136 </LI></UL>
137 </LI><LI>
138 Assuming that the capacitor is clamped to VOL most
139 of the time, the R*C that corresponds to charging
140 from VOL to VIH in T seconds is the
141 the basic capacitor charging equation:
142 </LI><UL><LI>
143 V(t) = V<Sub>OL</Sub> + (V<Sub>CC</Sub> -
144 V<Sub>OL</Sub>) * (1 - e<Sup>-t/R*C</Sup>)
145 </LI></UL><LI>
146 Replacing V(t) with V<Sub>IH</Sub> and T:
147 <UL><LI>
148 V<Sub>IH</Sub> = V<Sub>OL</Sub> + (V<Sub>CC</Sub> -
149 V<Sub>OL</Sub>) * (1 - e<Sup>-T/R*C</Sup>)
150 </LI></UL>
151 </LI><LI>
152 Solving for RC:
153 <UL><LI>
154 (V<Sub>IH</Sub> - V<Sub>OL</Sub>)/(V<Sub>CC</Sub> - V<Sub>L</Sub>) =
155 1 - e<Sup>-T/R*C</Sup>
156 </LI><LI>
157 e<Sup>-T/R*C</Sup> = 1 - (V<Sub>IH</Sub> -
158 V<Sub>OL</Sub>)/(V<Sub>CC</Sub> - V<Sub>OL</Sub>)
159 </LI><LI>
160 -T/R*C = ln(1 - (V<Sub>IH</Sub> -
161 V<Sub>OL</Sub>)/(V<Sub>CC</Sub> - V<Sub>OL</Sub>))
162 </LI><LI>
163 R*C = -T/ln(1 - (V<Sub>IH</Sub> -
164 V<Sub>OL</Sub>)/(V<Sub>CC</Sub> - V<Sub>OL</Sub>))
165 </LI></UL>
166 </LI><LI>
167 Substituting in for T=1mS, V<Sub>IH</Sub>,
168 V<Sub>OL</Sub>, and V<Sub>CC</Sub>:
169 <UL><LI>
170 R*C = -.001/ln(1 - (3.5 - .55)/(5 - .55))
171 </LI><LI>
172 R*C = -.001/-1.08744
173 </LI><LI>
174 R*C = .009196
175 </LI></UL>
176 </LI><LI>
177 Setting C = .1&micro;F
178 <UL><LI>
179 R = .009196 / .0000001 = 9196
180 </LI></UL>
181 Using an R near 10K should do the trick.
182 </LI><LI>
183 The maximum discharge current is I<Sub>OL</Sub>. Use Ohm's law
184 to determine determine discharge resistor:
185 <UL><LI>
186 V = I * R
187 </LI><LI>
188 R = V / I
189 = 5 / .032
190 = 156.25
191 </LI></UL>
192 Setting R<Sub>discharge</Sub> = 180 should be good enough.
193 </LI><LI>
194 The charge/discharge ratio is:
195 <UL><LI>
196 R<Sub>charge</Sub>/R<Sub>discharge</Sub> = 10K/180 = 55.5
197 </LI></UL>
198 </LI></UL>
199 <P>
200 <H2>
201 <A Name="Bootloader">
202 4.0 Bootloader</A>
203 </H2>
204 <P>
205 {Bootloader discussion goes here!}
206 </P>
207 <H2>
208 <A Name="IDE">
209 5.0 IDE</A> </H2>
210 <P>
211 The following URL specifies how to add a new board:
212 <BlockQuote>
213
214 <A HRef="http://www.avr-developers.com/corefiles/index.html">
215 http://www.avr-developers.com/corefiles/index.html</A>
216 </BlockQuote>
217 </P><P>
218 The short answer is:
219 <Pre>
220 cd .../hardware
221 (cd arduino; tar cvf /tmp/arduino.tar .)
222 (mkdir {your_board_dir}; tar xvf /tmp/arduino.tar)
223 # now edit {your_board_dir}/boards.txt to configure your board
224 # now edit {your_board_dir}/programmers.txt
225 </Pre>
226 The problem with this strategy is that you get a snap-shot of
227 all the files and everything becomes out of date when the next
228 release of the Arduino IDE comes out. A better way is probably
229 to have a shell script that make a copy of arduino files followed
230 by a file that unzips the stuff that needs to be changed. That
231 may be just a few files.
232 </P><P>
233 Here are the files that have been edited so far:
234 <DL><DT>
235 .../MBino/variants/standard/pins_arduino.h: </DT><DD>
236 <Pre>
237 // Add 4 pins to the vector for I2C SDA, SCL, and external pull-ups
238 SDA = 20
239 SCL = 21
240
241 port_to_mode_PGM = {
242 // Add &DDRA, // ATmega324 has a Port A
243
244 port_to_output_PGM = {
245 // Add &PORTA, // ATmega324 has a Port A
246
247 port_to_input_PGM = {
248 // Add &PINA, // ATmega324 has a Port A
249
250 digital_pin_to_port_PGM = {
251 // Remap digital pin ports
252
253 digital_pin_to_bit_mask_PGM = {
254 // Remap bit masks
255 </Pre>
256 Obviously thes is pretty minor changes.
257 </DD></DL>
258 </P><P>
259 {Create a .zip file that creates the various MBino
260 sub-directories for the Arduino IDE.}
261 </P>
262 <HR>
263 <Address>
264 <A HRef="http://gramlich.net/copyright.html">
265 Copyright</A> 2013 by
266 <A HRef="http://gramlich.net/index.html">
267 Wayne C. Gramlich</A>.
268 All rights reserved.
269 </Address>
270 </Body>
271 </HTML>