<ol type="1">
<li>intro</li>
</ol>
<p>1.1 brian in ohio</p>
<p>1.2 out from under my rock</p>
<ol start="2" type="1">
<li>motivation</li>
</ol>
<p>2.1 ken fallon bootloader episode</p>
<ul>
<li>hpr 2660</li>
<li>burned many bootloaders</li>
<li>used usbtiny programmer</li>
<li>putting together a programmer would be a good learning experience</li>
</ul>
<p>2.2 still use arduino</p>
<ul>
<li>easy to check out a new piece of hardware</li>
<li>boards are cheap and easy to find</li>
<li>boards are robust</li>
</ul>
<p>2.3 need to run an arduino board at lower frequency</p>
<ul>
<li>developing a data logger</li>
<li>write code in c using the avr open source tool chain</li>
<li>prototype on arduino board</li>
</ul>
<ol start="3" type="1">
<li>needed supplies</li>
</ol>
<p>3.1 arduino ide</p>
<ul>
<li>get from your distro’s repository</li>
<li>slackbuilds i used the version that repackages the binaries, the little a arduino</li>
<li>read this good information<br />
<a href="https://www.arduino.cc/en/Tutorial/ArduinoISP" class="uri">https://www.arduino.cc/en/Tutorial/ArduinoISP</a></li>
</ul>
<p>3.2 avrdude</p>
<ul>
<li>use it to test the programmer outside of the arduino environment</li>
<li>part of the gnu avr toolchain</li>
</ul>
<p>3.3 arduino nano clone - un assembled</p>
<p><img src="https://www.hackerpublicradio.org/eps/hpr2799-bare-nano.jpg" alt="hpr2799-bare-nano.jpg" /></p>
<ul>
<li>look for the boards that have the unpoplated icsp header</li>
<li>make sure its a nano and not a pro-mini</li>
</ul>
<p>3.4 3 leds 3mm or smaller</p>
<p><img src="https://www.hackerpublicradio.org/eps/hpr2799-led.jpg" alt="hpr2799-led.jpg" /></p>
<ul>
<li>optional but are useful, especially the heartbeat led</li>
</ul>
<p>3.5 3 resistors 200 ohm - small</p>
<ul>
<li>if you install the led’s</li>
</ul>
<p>3.6 1 5-10 uF electrolytic capacitor</p>
<p>3.7 3-4 inch long jumper wire</p>
<p>3.8 2x3 female header</p>
<p><img src="https://www.hackerpublicradio.org/eps/hpr2799-2x3header.jpg" alt="hpr2799-2x3header.jpg" /></p>
<p>3.9 some way to cut wire</p>
<p>3.10 soldering supplies</p>
<ol start="4" type="1">
<li>howto</li>
</ol>
<p>4.1 upload arduino isp sketch to nano</p>
<p>File→Examples→11.ArduinoISP→ArduinoISP</p>
<ul>
<li>i modified the sketch changing where the led’s are placed</li>
<li><p>i put the led’s at digital 9, 7, and 5 for spacing</p>
<pre><code>#define RESET 10 // Use pin 10 to reset the target rather than SS
#define LED_HB 9 // No change define LED_ERR 7 // changed define
#LED_PMODE 5 // changed</code></pre></li>
<li><p>upload the sketch</p></li>
</ul>
<p>4.2 solder on led’s</p>
<p><img src="https://www.hackerpublicradio.org/eps/hpr2799-led-on-board.jpg" alt="hpr2799-led-on-board.jpg" /></p>
<ul>
<li>solder the anode leg to the apropriate digital pin on the board</li>
<li>add a resistor to the cathode leg of the led (usually the shorter leg)</li>
<li>solder the resistor attached to the cathode to ground pin of the board</li>
<li>i started with pin 9</li>
<li>you can test each led before moving on to the next led</li>
<li>my soldering ended up messy but it gets the job done</li>
</ul>
<p><img src="https://www.hackerpublicradio.org/eps/hpr2799-leds-done.jpg" alt="hpr2799-leds-done.jpg" /></p>
<p>4.3 modify sketch and test leds</p>
<ul>
<li>you can modify the sketch</li>
<li>change the heartbeat pin to whatever led you just soldered</li>
<li>upload the modified sketch</li>
<li>the led you just soldered should pulse</li>
</ul>
<p>4.4 clip jumper wire and attach</p>
<p><img src="https://www.hackerpublicradio.org/eps/hpr2799-reset-wire.jpg" alt="hpr2799-reset-wire.jpg" /></p>
<ul>
<li>pin 10</li>
<li>used the hole on the end of the board as strain relief</li>
</ul>
<p>4.5 add capacitor</p>
<ul>
<li>watch polarity</li>
<li>no more auto reset</li>
<li>if you want to program with arduino ide, you need to push the reset button</li>
</ul>
<p>4.6 2x3 header</p>
<pre class="___"><code>                         MISO -|o o|-+Vcc
                          SCK -|o o|-MOSI
 Do not attach-Reset-|o o|-Gnd
                                     -----</code></pre>
<p><img src="https://www.hackerpublicradio.org/eps/hpr2799-header-mod.jpg" alt="hpr2799-header-mod.jpg" /></p>
<ul>
<li>remove reset connecter south-west connector</li>
<li>solder the remaining 5 pins</li>
<li>the header is soldered on the bottom of the board</li>
</ul>
<p><img src="https://www.hackerpublicradio.org/eps/hpr2799-header-soldered.jpg" alt="hpr2799-header-soldered.jpg" /></p>
<ol start="5" type="1">
<li>how to use</li>
</ol>
<p>5.1 plug usb cable into programmer and your computer</p>
<p>5.2 start the arduino ide</p>
<p>5.3 plug programmer onto target board remember to plug the wire into the reset pin of the target</p>
<p>5.4 in the tools folder of the ide make sure your usb port is selected</p>
<p>Tools→Port<code>&quot;/dev/ttyUSBx&quot;</code>→<code>/dev/ttyUSBx</code></p>
<p>5.5 and that in the programmer section you select arduino as isp not arduinoisp</p>
<p>Tools→Programmer→Arduino as ISP</p>
<p>5.6 at this point you can burn a bootloader as Ken described</p>
<p>5.7 upload a program</p>
<p>5.7.1 bring up the blink example sketch</p>
<p>5.7.2 under tools make sure your target board type is selected</p>
<p>Tools→Boards</p>
<p>5.7.3 under the sketch menu you’ll see upload using a programmer</p>
<p>Sketch→Upload Using Programer</p>
<p>5.7.4 when you select that the blink sketch will be compiled and uploaded</p>
<ol start="6" type="1">
<li>at the command line</li>
</ol>
<p>6.1 check functionallity</p>
<pre><code>bash-4.3$ avrdude -p m328p -c arduino -P /dev/ttyUSB0 -b 19200</code></pre>
<p>6.2 output</p>
<pre><code>  avrdude: AVR device initialized and ready to accept instructions

  Reading | ################################################## | 100%
  0.01s

  avrdude: Device signature = 0x1e950f (probably m328p)

  avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)

  avrdude done.  Thank you.</code></pre>
<ol start="7" type="1">
<li>things to look out for</li>
</ol>
<p>7.1 permissions issues - arch wiki gentoo</p>
<p>7.2 when you upload this way you overwrite bootloader</p>
<p>7.3 arduino ide boards.txt has some fuse errors</p>
<p>7.4 avrdude version 6.2 will not work</p>
<p>7.5 baud rate using avrdude command line</p>
<p>7.6 capacitor is non-optional, but makes uploading to that board non-trivial</p>
<ol start="8" type="1">
<li>conclusion</li>
</ol>
<p>8.1 upload via icsp vs usb serial</p>
<p>8.2 do you need a bootloader?</p>
<p>8.3 challenge to max out any 8bit microcontroller</p>
<ul>
<li>if you need to do one or two things use a microcontroller i.e. arduino</li>
<li>if you need to do many things use a linux single board computer i.e. raspberry pi</li>
</ul>
