Embedded Programming
Concept
Starting from a circuit with an ATTiny44 and FTDI connection, add an LED and a switch. Program it using the FabISP built week 1.
Design with Eagle
Key eagle commands in Schematic mode:
move, net, name, label, add, value, show, erc (electronic rules check), run BOM
Key eagle commands in Board mode:
route, rats, ripup (rip up), drc (design rules check)
When exporting the png for kokompe, remember: monochrome and 1000dpi.
I added 3 LEDs and a switch, to use up the free pins.
Milling and Stuffing Process
Milling was straight forward.
Stuffing Round 1 : moving a bit too fast. Got the processor inverted. Back to Milling.
Stuffing Round 2 : not bad. Went pretty quickly (but not too quickly).
Programming
Tricky stuff. Take this amazing example:
unsigned short pauseTime = 1000;
while (1)
{
    PORTA = (1<<PA3);
    PORTB = 0;
    _delay_ms(pauseTime);
    //pauseTime--;
}
AVR Memory Usage
----------------
Device: attiny44
Program: 136 bytes (3.3% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
AVR Memory Usage
----------------
Device: attiny44
Program: 3878 bytes (94.7% Full)
(.text + .data + .bootloader)
Data: 264 bytes (103.1% Full)
(.data + .bss + .noinit)
(1) Embedded programming is subtle
(2) I need a good cookbook
for (unsigned short i = 0; i < 1000; ++i)
_ms_delay(1);
So now I can do arithmetic decrement, e.g., pauseTime = pauseTime-10;
But I wanted to do geometric decrement, roughly down 10% each loop. But pauseTime = .9*pauseTime links in the floating point library again. But I found a trick. The bit shift operator will divide by 2. So if I want to decrement by say an eighth, this should work: pauseTime = pauseTime - (3< < pauseTime);