An STM32 arrives in the workshop Mar22

An STM32 arrives in the workshop

While browsing around ebay one day I stumbled across some very reasonably priced STM32 development boards from Chinese sellers. These boards came with all the usual stuff that you’d expect, i.e. serial, USB, SDIO and a ton of GPIOs. What really got my attention was that some of them came...

Building the phototrap. Part 3: Control unit assembly

In the previous article in this series I explained the steps necessary to build the control board. Now, with that completed we are ready to prepare the box that will contain all the components. Back in part 1 I presented a photograph of the box that I’d found to hold the project. Here it...

How to hand solder an LCD FPC/FFC connector Jan30

How to hand solder an LCD FPC/FFC connector

Let’s face it, full-colour TFT displays are cool and adding one to your project is going to instantly endow your project with coolness. The problem for the hobbyist is that they come with flexible flat connectors known as FPC or FFC connectors. These are designed to be soldered to a PCB...

The Standard Template Library (STL) for AVR with C++ streams Jan15

The Standard Template Library (STL) for AVR with C++ streams

Yes you did read that correctly, this post will present a port of the Standard Template Library, or STL as it’s more commonly known, to the AVR microcontrollers. Introduction The STL has been around forever in computing terms with copyright notices appearing in the source code as far...

Debugging AVR dynamic memory allocation Jan01

Debugging AVR dynamic memory allocation

The avr-libc port of the standard C library for gcc supports dynamic memory allocation through malloc() and free(). These functions (particularly when used to implement the new and delete C++ operators) allow you to use more memory throughout the life of your program as it’s needed than...

Building the phototrap. Part 2: The control unit electronics

In part one of this series I documented the requirements for my phototrap project and chose the major components that I will use. This article will document the electronics used inside the control unit. The camera triggers When a sensor (or sensors) is triggered we are going to allow the user...

Building the phototrap. Part 1: Design.

Welcome to the first in a series of posts where I will document the design and build of a microcontroller based camera/flash phototrap that can support multiple sensors and multiple cameras and flashes. The problem As many of you are aware I have a keen interest in bird photography,...

Animation on the Arduino with easing functions Dec05

Animation on the Arduino with easing functions

In this article I’ll show you how to do advanced animation techniques on the Arduino using what are known as easing functions. What’s an easing function? Computer animation of motion involves making an object appear to move from A to B over some time period T. The simple way to do...

LCD backlight and contrast manager Nov28

LCD backlight and contrast manager

This article will present a circuit and accompanying source code that you can use to control the backlight and contrast functions of an HD44780-compatible LCD. Controlling these functions from software allows you to cut down on external components such as dials, saving you space and...

Debounced buttons with auto-repeat in AVR C++ Nov22

Debounced buttons with auto-repeat in AVR C++

This article presents a C++ class that implements an auto-repeat button. An auto-repeat button behaves like a key on a keyboard. That is, it fires first when you press it and then repeatedly when you hold it down. The class allows you to configure the length of time that the button waits...

Debouncing buttons in AVR C++ Nov21

Debouncing buttons in AVR C++

On the face of it, reading the open/closed state of a button should be straightforward. You would just wire up the button circuit and tap the current flow into one of the Arduino digital pins configured for input. Unfortunately you will soon discover that it’s just not that simple. At...

An ATtiny85 development environment Nov20

An ATtiny85 development environment

This article will help you to set up a low-cost development environment for programming and testing the ATtiny 85 MCU. The same principles apply to any other member of the ATtiny family that can run free of any external components. Parts List Component Supplier Price...

USBasp drivers for 64 bit Windows 7 Nov14

USBasp drivers for 64 bit Windows 7

The most cost-effective way to program an ATmega/ATtiny MCU that’s not embedded in a development board such as the Arduino is to buy yourself a USB in-system programmer (ISP). There are dozens available on ebay for just a few pounds, and that’s where I got mine. Unfortunately when...

An introduction to the ATtiny85/45/25 Nov07

An introduction to the ATtiny85/45/25

The ATtiny range of microcontrollers are ATmel’s smallest and lowest power 8-bit AVR offerings. Typically they come with between 1K and 16K of program memory and 512 bytes of SRAM and 512 bytes of EEPROM. These MCUs are entirely self-contained. All they need is a stable power supply,...

avr-gcc 4.5.1 and avr-libc 1.7.0 for windows Oct31

avr-gcc 4.5.1 and avr-libc 1.7.0 for windows

Deprecated! This has now been superceded by gcc-4.7.0 and avr-libc 1.8.0. Click here to go to my article that describes how to upgrade. The version of gcc included with WinAVR-20100110 is 4.3.3. If you’d like to update to avr-gcc 4.5.1 with avr-libc 1.7.0 then you’ve come to...

Your first AVR project in Eclipse Oct24

Your first AVR project in Eclipse

So you’ve read my blog post Setting up Eclipse for AVR projects and now you want to write some code but you’re somewhat bewildered by all the Eclipse options. Well not to worry, I’ll walk you through your first project step-by-step. We’ll go ahead and recreate the...

Recommended avr-gcc compiler settings Oct24

Recommended avr-gcc compiler settings

It can be daunting when you first set up a project in Eclipse and you start browsing the available compiler options. There are just so many it’s not even funny. The aim of this article is to show you which options you should change, and what you should change them to in order to get the...

The global constructor bug in avr-gcc Oct24

The global constructor bug in avr-gcc

There is a major bug affecting versions of avr-gcc that I have tested from 4.4 all the way up to the most recent (at the time of writing) 4.5.1. It only affects programs that target MCUs with more than 64K flash memory so you need to know about this if you are programming the Arduino Mega...