Tag: Dorkbot

  • Reprogramming your avr-usb device using atmel’s built in bootloader

    Getting code onto the MidiMonster or Benito device.

    Midi Monster Button Locations.
    Midi Monster Button Locations.

    Benito 7g Switch Positions.
    Benito 7g Switch Positions.

    Benito 2010 Switch Locations
    Benito 2010 Switch Locations

    Benito Without Buttons.
    Benito Without Buttons.

    All of the code on the Benito and MidiMonster devices is open source and references an open source library called the Lightweight Usb For Avr (lufa). Getting the code compiled and onto the device requires a few other open source tools.

    AVR-GCC

    The most current and stable release of the toochain for the AVR has untill recently been maintained by Eric Wedddington and released as WinAvr (http://sourceforge.net/projects/winavr/) Winaver integrates nicely into atmels avr studio http://www.atmel.com/dyn/Products/tools_card.asp?tool_id=2725 and I reccomend that you get both if you are running windows. Each Winavr Release is closely followed by objective developments CrossPack for avr http://www.obdev.at/products/crosspack/index.html and a script for building the current toolchain on linux which is hosted by AvrFreaks at present there is also a debian package that was put out last month http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=90172

    HWB? DFU?

    Most Atmel “atmega” devices have a pin dedicated to determining weather or not the device goes into the bootloader depending on the devices flag settings. This pin is labled HWB (for hardware boot) on most of  the datasheets. The usb avr family has this mode set up by default. When you hold the hwb pin low and reset the device it goes into the bootloader. On these devices the built in bootloader uses a usb device class called the Device Firmware Uploader (DFU). Atmel provides a tool called flip for programming DFU devices on  windows and linux. There is an open source programmer called dfu-programmer http://dfu-programmer.sourceforge.net/

    That other guys stuff.

    Those of you who have worked with the teensy boards from paul stoffregon will notice some subtle differences. Paul wrote his own (closed source) bootloader rather than use the bootloader tha comes installed on the chips. Then he uses a hardware trick similar to the auto reset hack to make a single button manipulate both the reset and the hwb pins to put his boards into the bootloader. I didnt feel that either the two button arrangement or the builtin bootloaders were broken so I like most people working with these chips dont fix them.

    Using the dfu-programmer

    All of the programs in Dean Cameras Lightweight Usb for Avr have a “dfu” target. Once you have the target into the DFU mode you can simply

    $make dfu

    This will cause the dfu-programmer to erase the flash reprogramm it with a new hex file and restart the chip. You can also do this manually with the following commands

    $dfu-programmer atmega32u2 erase
    $dfu-programmer atmega32u2 flash mycode.hex
    $dfu-programmer atmega32u2 start

    This will cause the dfu-programmer to erase the flash reprogramm it with a new hex file and restart the chip.

  • Day 1: Thing 1: Midi Monster Board Design

    This month we have two workshops. One on interfacing Purdata with the outside world and one on programming midi devices. I designed one board that should work for both classes.

    I will blog a bit more about this technically later at dorkbotpdx.org/feurig but that was my thing for the day.

  • The $15 Wiring Board

    This was started out as one of my things for Thing-A-Day (2008) (http://www.thing-a-day.com/2008/02/22/day-22-thing-22-the-15-wiring-board/)

    This follows my work getting the wiring software platform working on some generic mega128 boards. It is somehow related to my work on reducing the costs of the Arduino runtime to less than $4

    I recently found the code for an Stk500v2 based bootloader at http://www.avride.com/article/wiring/ for the new wiring platform. I have wanted to run wiring on several of the systems I have using the mega128 and the olimex header board that sparkfun sells. Between sparkfun and Ebay my per board cost is about 11 bucks. With the ftdi ft232rl usb to serial chip at $4 that would make the wiring platform affordable :)

    My initial attempt was using Wiring 0014 which seemed pretty darned broken. It didnt take long for 0015 to come out fortunately. Once I got the bootloader to work with wiring I realized that the wiring platform requires a 32khz clock crystal to be connected to tosc1 and tosc2. On the Olimex boards there is a space for this crystal. On some other boards like the Futulec ET-AVR-stamp this had to be soldered to the legs of the processor.

    Once this was added to the boards things started working. Below you can see the Futurelec ET-AVR-STAMP running my “antisocial” wiring program.

  • Day 28: Thing 28: Charley plexed display

    (Archive of: http://www.thing-a-day2.com/2008/02/28/day-28-thing-28-charley-plexed-display/)

    Today I made the software for some hardware that I built a while ago.

    The origional question was if I got 15000 leds for next to nothing and it costs 4-15 per 8×8 array (with the 4$ solution also needing 4 to eleven additional parts) to drive them are we getting anywhere? I looked at 2 solutions before realizing that the leds were to dim to do much of anything that interested me. One solution was to drive the led rows with cmos shift registers and sink the columns using TPIC6 based shift registers.

    The other solution is called charlyplexing.

    The idea is to multiplex a series of leds in a way that maximizes the leds per io pin avaliable. The led connections are paired and driven one at a time depending on the direction of the output pins. The remaining pins are tri-stated out of the way. It is a pretty intense software complexity vs hardware problem.

    As only one led in the array is on at a given time, multiplexing the leds into an array reduces the brightness significantly making my near free leds impractical for this application. (These are 5×6 array, the fonts i used were for 5×7 displays)

  • Day 25: Thing 25: AntiSocial(ism)

    (Archive of: http://www.thing-a-day2.com/2008/02/25/day-25-thing-25-antisocialism/)

    I went to radio shack about a month ago and bought an utrasonic distance sensor made by parallax called a ping))).

    I have been feeling cranky and anti social lately so I thought I should make something that didnt want to be bothered.


    I am considering adding an air horn for people who dont respect its limits but think that the neighbors might not appreciate it much.

  • Day 24: Thing 24 — Mouse Whiskers (touch sensor)

    (Archive of: http://www.thing-a-day2.com/2008/02/24/day-24-thing-24-mouse-whiskers-touch-sensor/)

    Two weekends ago Aidan and I went to radio shack and he was looking at these $9 bug bots which have a sound sensor, two touch sensors (antennae) and 6 legs. He was very interseted in both the walking mechanism and the touch sensor. We decided that we should add one of those to his arduino based mouse (A168).

  • Day 23: Thing 23: DELETED!!! (Button and screen)

    (Archive of: http://www.thing-a-day2.com/2008/02/23/day-23-thing-23-deleted-button-and-screen/)

    After the last two days of disaster I got a new board in the mail.

    It has one of the new atmel USB avrs on it which I would like to work with instead of the the ftdi chipset for programming avrs and arduinos. Rather than attempt to do another complicated and ambitious project I decided that my first project with this board should be to run the example keyboard code that atmel provides and modify it to send a “<shift><command>B” sequence followed by a “<CR>”. The sequence I use to “bounce” the 5o or so pieces of e-mail that get past my already overambitious mail filters.

    I needed a button!

    So I used the rem from resin for the displays to cast this one.

    I thought a “Display” might not be a bad idea either.

  • Day 20: Thing 20: Arduino on a (simm) Stick

    (Archive of: http://www.thing-a-day2.com/2008/02/20/day-20-thing-20-arduino-on-a-simm-stick/)

    In response to a conversation I had with “lady ada” in which she asked me “what is an arduino?” I have been pushing the question “What isnt?”. I have a bunch of stuff that I have built around the simstick platform which I wanted to reclaim so I put a 168 on a dt107 (dontronics) board and adjusted the IDE to see it. (this is in preparation for bigger and better mods)

  • Day 18: Thing 18: CD Hole Based circuit board.

    (Archive of: http://www.thing-a-day2.com/2008/02/18/day-18-thing-18-cd-hole-based-circuit-board/)

    I havent made a circuit board in ages. I was thinking that if I made circular pads for the leds they might make a decent reflections for the display. I made the etch mask for this out of the holes for press on cd lables and 1/8″ engineering tape.

    In the middle of this I realized that I need to get some more tinning solution.


    I plan to cast this in less expensive fiberglass resin once I have finished the 4 panels.

  • Day 17: Thing 17: Soldering Iron Timer Redux

    (Archive of: http://www.thing-a-day2.com/2008/02/17/day-17-thing-17-soldering-iron-timer-redux/)

    Today I really made Space and time (The appartment was getting a bit difficult to get around in).

    So this is a make up entry.

    After oxydizing the first tip on my new weller I decided it was time to build a new soldering iron timer (and one for my glue gun as well). This is a bench junk project. It is mostly from scores at Wackey Willies (RIP 2007). I had a 4 channel Solid State Relay board with 3 channels populated and a small pile of outlets (I have plans for most of them :). The transformer for the digital power supply is from an old clock radio. At present the buttons turn on the Soldering Iron and Hot Glue Gun and it stays on for about 10 minutes (The arduino doesnt support the RTC crystal that all of the x8 family has attached to Timer 2).

    The big button on the right turns everything off. There is a front pannel which I will program to give some status (the leds on the board are two burried to really use for on off status at a glance). Also there is a set of buttons on the panel (currently unwired) to allow for timing adjustment and other future planned functions.

    I would also plan use this to adjust the temperature on the iron.