Hack Jam Log Book is a log of progress made in and around a weekly hack session. Topics include natural language processing, high energy electronics, linguistics, interface design, &c. Enjoy.

Recent Posts:

Archives:

13.11.08

 

Makefile , Blink , and Software Controlled Buttons

As promised, another update on the glorious piano project.

This week has mostly been about getting a good solid foundation for development. After some time, I managed to make my first Makefile specifically for the Atmega16 and my avr-toolchain. I also managed to test it both on my JTAG programmer, as well as Sam's STK500v2 which I'm still in possession of.

Additionally, I spent a good deal of time trying to get a software controlled switch to work. Getting the code to compile and upload to the Atmega was simplified with my Makefile, for sure, but for some reason the silly microcontroller was resetting on me. The data sheet didn't seem to provide much help [I went through all of the RESETs listed, to no avail]. Sam suggested I research the internal pull-up resistors, but they seemed to hold the current around +3V, and also produce the same intermittent reset problem. I finally said enough was enough and decided to do external pull-up resistors. If you are interested, here is a site which shows the basic diagram of how to put a switch into a Microcontroller: http://www.micahcarrick.com/05-15-2006/avr-tutorial-switch-debounce.html .

I've uploaded my sample code onto my website for now. You can find all of the available warez under http://brandon.bagwellonline.com/piano . Currently, you will find a simple "blink" program, a "swbutton" [which has a software-controlled button listed], the Makefile, and eventually an image of my JTAG programming breadboard. Hopefully, I will add more interesting pics as they become available, but with were the project is at the moment, all the fun will exist in the world of C, Assembly, and my head.

Updates will be coming, though they will be slower since the end of the year is a busy time for me at work [everyone else is burning their vacation time]. Besides, I'm still catching up on Doctor Who and Business Week.

More next time,

Brandon

Labels:


31.10.08

 

Greetings

This is my first blog post to this, or any other blog... so please bear with me as I gather up steam and learn the new format.

For those of you who don't know me, I'm Brandon. Hello! I know there isn't much listed on my current project, so here is generally the gist... we got an old upright Lexington-brand piano free from some nice people who were cleaning their basement. The guys here were interested in getting a piano for the foyer, but didn't want to spend a lot [read "any"] money. As such, the piano is what you expect from a free piano. The word "totaled" comes to mind [and that of the piano tuner I had take a look at it].

To make a long story short, being the group full of steam-punk, tinkering, tech heads that only the readers of this blog might enjoy, we decided to turn this 1940's upright piano into an electric keyboard. Perfect! Keeps a tune forever and maybe does other nice nifty things as well.

Having never messed with embedded systems [or electronics even], it made process somewhat scary. However, it still had to be easier [and cheaper] than rebuilding normally. I got together with Sam [who is Fantastic in only ways Dr. Who can describe] and plotted the course. We purchased the following items:

* 100 x Small Raised Tactile Switches
* 3 x Atmega16 Microcontrollers
* 3 x 5 Volt VRMs
* 1 x JTAG-ICE-MKI programmer for said Atmegas
* 1 x "magical" breakout board from Sparkfun [SKU: BOB-00718 ] to turn signals into computer based serial.
* 1 x Jumperkit, including Capacitors, resistors, and some breadboards... various other sundry electronic components [Total cost so far, < $150 US].

The general goal is to have the microcontroller interpret the incoming signals from the various buttons, encode them into a long byte stream, send it over to a laptop running ALSA hidden in the piano cabinent and PRESTO! Electronic piano!

As to installing the AVR Toolkit, I know that Sam mentioned how frustrating some things were. I am running Mandriva Linux 2008 on my devel-machine and installed the following packages to get everything working AOK:

avrdude
avr-libc-1.6.2
binutils-2.19.50
ddd [graphical gdb front-end, kinda nice since I'm not used to gdb]
gcc-4.3.2 for the AVR [you'll use --target=avr]
gdb-6.8 [for handyness]
gmp-4.2.2
mpfr-2.3.0
simulavr-0.1.2.5

Those are all of the packages that you truly need [plus their sub-dependencies, such as a YACC or a BISON... also a neat one called "m4" for gcc.

With those installed, you should be good to go. However, I do want to draw this post to a close as otherwise it will be so long you might loose interest.

I will post my Makefile and other "piano-warez" on my website or this blog for those who are interested. The Makefile is very basic, so remember, just because you graduate with a BS in CS does not make you a programmer.

I will also post on some of my other projects as they happen.

Regards,

Brandon Bagwell

Labels:


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]