Tag Archives: avr

Blowing a Fuse

I like to use avrdude for programming my AVR’s. It’s got support for pretty much every possible programming method supported by the AVR CPUs and has a good command line interface. A command line interface is very important when you use Makefiles to act as your IDE. Here, for example, is a little bit of… Read More »

Volatile Delays

You want to write a simple delay loop on your embedded microcontroller. Let’s say you’re waiting for the crystal oscillator to stabilise before you use it. static void delay( int loops ) { while(loops–) ; } You’re then very surprised to find that this takes a total time of 0ms when you call it. You… Read More »

CPU, Interrupted — Timers

Yesterday I mentioned that interrupts on an embedded microcontroller can cause you trouble. That’s not strictly true – it’s not the interrupt that causes trouble it’s the way you handle them. An awful lot of programmers don’t handle them correctly and they end up in a sticky mess. Before I can talk about interrupts though,… Read More »

AVR UART Transmit and stdio

The setup for a UART on AVR is such common code that I wonder if possibly it’s just assumed to be understood and explained. This is a quick article to fill in the gaps. First let’s talk initialisation. This is often the most important part of using any hardware peripheral on an embedded processor. In… Read More »