Step 1: Modify the board

To make a microcontroller program that responds to a button, you
first have to have a button!

The hello.echo.44.cad board already has the footprint for a button
embedded in the file. To add it to the board, I just had to instantiate
it and then create a couple of straight wires to connect the pads.
Here's what that looks like:



Step 2: Mill it and make it

I milled my board on the Modella and stuffed it just as in the circuit
board project. No major issues here.




Step 3: Software take 1

It was relatively straightforward to use gavarasm to build the
serial echo code. I then modified the code to respond to button by
adding a read of PINA in the main loop, and branching off of bit 3.
If bit 3 (PA3) is set, I turn on the led. Otherwise the led is turned
off.

Step 3: Software take 2

I want to use quite a few ATTiny13 microcontrollers in my final project.
Because of the number of controllers and tiny form factor I'm targeting,
its not attactive to program the controllers using the 6 pin ISP header.

To solve this problem, I created (and am still improving) a serial
bootloader for the Tiny13. The Tiny13 only has 1K of flash and does
not have any hardware bootloader support. Consequently, the bootloader
must be very small and do some fancy footwork to get the load and run
the target application.

On reset, the bootloader runs and waits for a command byte from the
host. If a magic word is received, the bootloader enters programming
mode and loads the program sent by the host into flash. Otherwise,
the bootloader jumps to the start of the loaded application code.
The current iteration of the bootloader runs on the Tiny44 at 8MHz and
fits into 128 bytes of flash. It can run programs written in C or
assembly, provided that they do not use interrupts.

If you're interested in using the loader, send me an email to
dcarr at media. I'll help you get started.

Over and out.