Monthly Archives: May 2013

Arduino Blink Using GCC Inline Assembly

At less than 490 bytes, this version is less than half the size of the Arduino example program. Obviously, it could be made smaller. Note: Updated 3.16.2016 to conform with Arduino Inline Assembly Tutorials. Also available as a book, with … Continue reading

Posted in Uncategorized | Tagged , , , , , , | 18 Comments

-Poof- My Delay Was Optimized Away!

In the Arduino IDE, compiler optimization is set at “–Os”, which means optimization for reduced code size (this level includes most level 2 optimizations also). It might have some surprising affects on your code. For example, Look at the below … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Nested Interrupts

Normally, the AVR hardware clears the global interrupt flag (in SREG) before entering an interrupt. This means other interrupts are disabled inside the running handler until the handler finishes and exits. The RETI instruction is the normal function epilogue for … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Bad Interrupt

If during the running of your program, an unexpected interrupt were to occur (an interrupt for which no handler is installed) bad things could occur. Default behavior is for the program to jump through the reset interrupt vector and attempt … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

Simple Test LED

This is an easy method to conduct quick pin/port tests with a microcontroller. It’s helpful for debugging purposes and can be used many times without needing to wire up a breadboard. I have a few of these scattered around the … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

Un-Bricking an ATtiny13

I was playing with my ATtiny13 timer #0 fast PWM settings to test the range of frequencies I could achieve. I started with the fastest setting using the internal oscillator. 9.6MHz, no prescaler, no timer divider and using a TCNT0 … Continue reading

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

ATtiny13 Blink Using an Interrupt

Note to self: Ensure you set the fuse bits for internal oscillator correctly. Code:

Posted in Uncategorized | Tagged , , , , , , , | 1 Comment

ATtiny13 Project & SparkFun AVR Programmer

I decided to work on an ATtiny13 project. I will be using a test board based on the following schematic: Here is the board. Top: Bottom: Here are the results of a simple “blink” test program: Code: SparkFun AVR Programmer … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment