My AVR Development Board

I build a new dev board for my AVR and Arduino development. My old one really was too small... Since I am daily are working on the evaluation of all the nice and tiny IC's in my electronics box I needed this. Maybe it will become too small in some time but currently it helps me a lot.

It consists of two large breadboards and a wooden panel underneath with four rubber foots. I will work on optimizing this in the future and maybe I will write a document, describing how to build it like mine... ;)

Attiny13 Blink example

Image of Attiny13 MCUJust to keep and share the code... Here is the code for making a LED blink using an Attiny13 MCU from Atmel.

I got a package with about 30 AVR MCU's from different kind yesterday and now I will give them all a try. The next step with the Attiny13 is to build a thermometer with a RGB LED as indicator of the temperature. As temperature sensor I will use the LT1025 chip which I tried some days ago. I got many logic IC's too so it will be a hackish time this december. I will post the code and circuit here in some days when everything is working properly... ;)

#include <avr/io.h>
#include <util/delay.h>

#define LED_PIN PB4

int main(void) {

  // Configure LED_PIN (PB4) as output
  DDRB |= (1 << LED_PIN);

  while (1) {
    PORTB |= (1 << LED_PIN);
    PORTB &= ~(1 << LED_PIN);
  return 0;

Have fun... ;)

Evaluating LT1025

Today I found a chip named LT1025. It is a Thermocouple Cold Junction Compensator from Linear Technology which is very easy to use for building temperature sensors for measurement and control and can also be used to convert a heat gradient into electricity.

It took about 5 minutes to get it working in the Arduino environment.

Just order some samples from Linear, they will send you one or two without charge... ;)

Evaluating 74HC238

Image of 74hc238 icI am currently working me thru my box of microchips and other electronic stuff. I found some 74HC238 IC's today and gave them a try. It was no very spectacular event but it's nice to know what I have laying around when starting the next AVR project.

The 74HC238 is a high speed CMOS 3 to 8 line decoder which makes it possible to control 8 outputs with only 3 input lines. You will find more information and the datasheet at Sparkfun.

I used it to control 8 LED's with my Arduino using just 3 output pins. Nothing worth to show you a photo... ;)

Building a working toolchain for AVR and Arduino development using Gentoo Linux


Gentoo's crossdev is not able to compile a toolchain with one command in one process. Since I am using Ardunio for embedded prototyping I really needed to fix this!

If you don't have crossdev installed just execute:

emerge crossdev

Here you find more information about crossdev

crossdev is modifying /etc/portage/package.use while compile time... :/ Before stage2 it adds the obsolete USE="nocxx" flag to cross-avr/gcc. If you have USE="cxx" flag set in /etc/make.conf or when USE="cxx" is not set in make.conf it will fail to build; I think it is a default value. So you need to add USE="-cxx" in /etc/make.conf at the beginning of the process. When crossdev reaches stage2 it removes USE="nocxx" in /etc/portage/package.use and expects USE="cxx" and not USE="-cxx" in /etc/make.conf. If the compile error rises up, simply change USE="-cxx" to USE="cxx" in /etc/make.conf. Then execute the crossdev command again. Since everything before gcc stage2 is compiled already, crossdev is not doing it again and continues at gcc stage2 with the USE flag changes set.


  1. /etc/make.conf: USE="-cxx"
  2. crossdev -t avr
  3. Compile error at stage2
  4. Change USE="-cxx" to USE="cxx" in /etc/make.conf
  5. crossdev -t avr
  6. Installation complete! :)
  7. ln -s /usr/i686-pc-linux-gnu/avr/lib/ldscripts /usr/avr/lib/ldscripts

    This is filed in Gentoo bug #147155.

  8. For each AVR MCU you are using you need to do this:

    ln -s /usr/avr/lib/avr5/crtm168.o /usr/avr/lib/crtm168.o

    The Arduino IDE gives an error if the library for the used MCU is not found! Simply create a symlink for it and everything works... :/

  9. All done!

After all this pain in the last two days I have decided to build my own AVR toolchain in the future. I will never again go through this evil process of installing all this with packages provided by a Linux distribution regardless of Gentoo...

More about:

For Arduino users this solution does not fix the following problem:

It seems Gentoo is using a broken version of the avr-gcc toolchain. I have tried installing older versions of gcc, binutils and libc for AVR but with no luck. It took hours trying this out... :/

All the time I am getting problems related to the error described in the link from Archlinux above or much more complex problems I don't wanna talk about. I am using the workaround described above for now but I think there must be a solution for these problems in the future.

I think this does not only happen for Arduino users because the compiled file implies the broken data and when writing it to an AVR using avrdude your program is broken regardless of Arduino. This is a problem for all people trying to use Gentoo for AVR development. After talking to some people on the Arduino develper list it seems not only Gentoo is broken at this place. Many distributions are shipping the latest avr-gcc version, utterly unaware how broken the most recent versions usually are.

I hope this information is helpful to someone and I wish good luck... ;)

BTW: I am using the wonderful GNOME based Arduino IDE called Gnoduino which I found by researching my problems today... ;) Give it a try! I love it because it natively runs on my Desktop, not GNOME but Xfce, without the use of JAVA.

Just ask me if you have questions!