Fab Academy at AS220 Labs

December 8, 2009 8:06 PM

Re-Programming the Echo Board

by Elliot Clapp

chorder2-2.jpg

chorder3-2.jpg

chorder4-2.jpg

The results of Shawn helping me work through the problem of having multiple button with several positions

chorderpcb.jpg

PNG of board that I drew in Illustrator

chorder5-2.jpg

chorder1.jpg

Main PCB with components being added

buttonpcb_01.jpg

buttonpcb_02.jpg

Button PCB, first try, and refinement

chorder3.jpg

chorder4.jpg

Button PCBs

chorder-white2.jpg

I cut out a wooden frame on the laser cutter to to attach the buttons

chorder-white5.jpg

chorder-white1.jpg

chorder-white4.jpg

chorder-white6.jpg

Here is the code to make the LED light up when one of the buttons is pressed:

The code:

#include <avr/io.h>
.org 0
cbi _SFR_IO_ADDR(DDRA), 1
sbi _SFR_IO_ADDR(DDRB), 2
loop:
 sbic _SFR_IO_ADDR(PINA),1
   sbi _SFR_IO_ADDR(PORTB), 2
 sbis _SFR_IO_ADDR(PINA),1
   cbi _SFR_IO_ADDR(PORTB), 2
 rjmp loop

The compile commands:

avr-gcc -c -mmcu=attiny84 -o blink.out blink.S avr-objcopy -j .text -O ihex blink.out blink.hex

The command to upload:

avrdude -F -p t84 -P usb -c avrispmkII -U flash:w:blink.hex

The reference:

www.atmel.com/atmel/acrobat/doc0856.pdf

Return to front

Older articles