Categories
Fab Academy AS220 - Providence, RI Fab Academy Providence -Year II - Teaching

Hello (Make Your Own) Arduino

arduino
For reasons I haven’t uncovered yet, I was unable to use the Arduino IDE to burn the bootloader to a fabbed Arduino board. For my first attempt at this, see the Fabkit / Fabduino post. Also see Ed Baafi’s Fabkit / Fabduino page for how to program an fabbed Arduino without an external clock through the Arduino IDE. In both OS X and Ubuntu I was unable to connect to the board through the IDE. Shawn Wallace suggested that I use the following code. (See “To Program Your Arduino” section below) The code below worked for me in Ubuntu. NOTE: This code below works for a using an external 8MHZ resonator, see the links to the .png files.

Download the Files

Download Files to Mill
Get the files from the Fab Academy site
Download the Arduino Bootloader File for the Atmega168
Right click to save the files

To Program Your Arduino:

Set the fuses with:

Paste code is all in one line

avrdude -c usbtiny -p m168 -B 5 -u -U lock:w:0x0F:m -U  efuse:w:0x00:m -U
hfuse:w:0xdd:m -U lfuse:w:0xf6:m -P usb

Burn the bootloader with:

Paste code is all in one line

avrdude -P usb -c usbtiny -p m168  -u -U flash:w:ATmegaBOOT_168_pro_8MHz.hex
-U lock:w:0x0F:m -B .2

The options used:

  1. -u –> Disable safemode, default when running from a script.
  2. -U :r|w|v:[:format] –> Memory operation specification. Multiple -U options are allowed, each request is performed in the order specified.
Categories
Fab Academy AS220 - Providence, RI Fab Academy Providence -Year II - Teaching

Hello Stepper Motor

hello stepper
This board is a “hello world” for running a basic stepper motor board..   To make it yourself – download the Fab Academy board diagrams / .pngs and code.

To Program the Board / Motor to Do a Half Turn

sudo make -f hello.stepper.44.half.make program-usbtiny

To Program the Board / Motor to Do a Full Turn

sudo make -f hello.stepper.44.full.make program-usbtiny

To Program the Board / Motor to Do a Wave

sudo make -f hello.stepper.44.wave.make program-usbtiny

I had trouble getting this board to work at first, the motor would turn back and forth only a small amount, not the full or half turn that the program specified. Then I checked the jumper wires. One of the wires was bad (the header was not connected). After replacing the faulty wire, the motor ran.

Categories
Fab Academy AS220 - Providence, RI Fab Academy Providence -Year II - Teaching

Hello RGB

rgb
This board is a “hello world” for a basic  RGB LED. The program flashed to the microcontroller cycles through the available LED colors.   To make it yourself – download the Fab Academy board diagrams / pngs and code.

Categories
Fab Academy AS220 - Providence, RI Fab Academy Providence -Year II - Teaching

Hello LED Matrix

Hello LED MatrixHello LED Matrix
This board is a “hello world” for a basic LED matrix. I labeled some green LEDs as red by accident, so there are green and red LEDs on the board. (I had intended them to be all red).  Download the Fab Academy board diagrams / pngs and code.

Board In Action

Programming Setup

To Flash the Board

sudo make -f hello.array.84.make program-usbtiny

Terminal Output Upon Success

avr-gcc -mmcu=attiny84 -Wall -Os -DF_CPU=8000000 -I./
-o hello.array.84.out hello.array.84.c
avr-objcopy -j .text -O ihex hello.array.84.out hello.array.84.c.hex;\
   avr-size --mcu=attiny84 --format=avr hello.array.84.out
AVR Memory Usage
----------------
Device: attiny84

Program:     358 bytes (4.4% Full)
(.text + .data + .bootloader)

Data:          1 bytes (0.2% Full)
(.data + .bss + .noinit)

avrdude -p t84 -P usb -c usbtiny -U flash:w:hello.array.84.c.hex

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e930c
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be
performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "hello.array.84.c.hex"
avrdude: input file hello.array.84.c.hex auto detected as Intel Hex
avrdude: writing flash (358 bytes):

Writing | ################################################## | 100% 1.03s

avrdude: 358 bytes of flash written
avrdude: verifying flash memory against hello.array.84.c.hex:
avrdude: load data flash data from input file hello.array.84.c.hex:
avrdude: input file hello.array.84.c.hex auto detected as Intel Hex
avrdude: input file hello.array.84.c.hex contains 358 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.60s

avrdude: verifying ...
avrdude: 358 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.