TinyMatrix

This project started in an unlikely place, DEFCON 21. My girl and I attended DEFCON this year because we find it interesting and because we have lots of friends that go. While we were hanging out in the hardware hacking room, we saw someone soldering together a LED display project and asked where he got it. Turns out Makertronic was selling several DIY solder kits, including what they call the LED Matrix Pendant Kit. My girl wanted to try her hand at soldering (yup she is a very cool girl, even geeky at times!). So we forked over $15 and off we went. About an hour later we connected the battery, only to find out that I instructed her to solder the display on backwards. Dammit. No biggie, 5min later I had it desoldered and resoldered on the right way. It was awesome and so I decided I needed to have one also.

Fast forward to the next week ... there I was soldering my kit together in my lab at work, and thinking how cool this project would be for my Intro to Electrical Engineering students. So I set out to figure it out. A lengthy Google search finally revealed what I assume is the original project page, TinyMatrix, complete with parts list, how-to and source code.

You will need a way to program the Attiny4313 microprocessors. Some people might already have something but I did not, so I picked up an Arduino Uno kit that came with wires and a small breadboard.

Step 2: Programming the Attiny4313

I am new to bothAtmel processors and Arduino boards. I started out by using Google to find a few how-tos and then I spent several hours tinkering with it to finally get it to work. I had hell trying to get the Arduino to recognise the Attiny. It's often the small things that stop us in our tracks.

Okay now on to programming, first setting up the Arduino Uno

Install the Arduino software on your computer. Simply download it from the Arduino site and install it.

Now the Arduino is ready to program the Attiny. Time to wire it up. If you are like me and you bought the kit with the wires and breadboard, you are ready to go. If not, you will need a method of connecting the Attiny to the Arduino. Below are the pin connections needed for connecting an Arduino Uno R3 to a Attiny4313 (Uno port -> Attiny pin):

Port 5V -> Pin 20 (VCC)

Port GND -> Pin 10 (GND)

Port 13 (SCK) -> Pin 19 (SCK)

Port 12 (MISO) -> Pin 18 (MISO)

Port 11 (MOSI) -> Pin 17 (MOSI)

Port 10 (SS) -> Pin 1 (RESET)

It is time to get/create a hex file to upload to the Attiny. You candownload one or compile your own. Without going into much detail, here is now to compile "program.c" in Ubuntu:

avr-gcc -Wall -Os -DF_CPU=4000000 -mmcu=attiny4313 -c program.c

avr-gcc -g -mmcu=attiny4313 -o program.elf program.o

avr-objcopy -j .text -j .data -O ihex program.elf program.hex

Once I had a viable hex file to upload, this is the command I used to do it: