How the Arduino memory model works - for AVR

By dave on September 10, 2018

An overview of memory organisation All general purpose processors, be it Intel, ARM or AVR devices work by reading instructions from memory and executing them. They are generally based on one of two Architectures: Von-Neumann or Harvard. The vast majority of larger systems such as PC’s and mobile devices use Von-Neumann, but AVR processors in Arduino boards such as Uno and Mega use Harvard architecture. In a Von-Neumann processor there is one memory area, all program code, data, EEPROM and IO registers share a single memory space, with everything mapped to unique address ranges.

Detecting power loss in a power supply

By dave on July 2, 2018

There are times when your program needs to react to your device being turned off, for example to save the current state of an Arduino sketch to EEPROM before shutting down, or to disengage relays in a power module to ensure there is a clean shutdown. Usually, the power loss detector is designed as part of the power supply, so here I’ve put together an example power supply that we can study, note that this is not intended as an exemplar of power supply design, and is rather incomplete, but to serve as a crude model that we can study to see how to detect power loss.

Making an arduino board holder from ply & wood

By dave on November 23, 2017

Making a nice case for an Arduino board can range from the simplest possible case, a piece of plywood the right size, with a few holes to mount the board, right through to an intricate box with closing lid etc. This one probably falls in the middle somewhere. Why another Arduino board holder you ask? Now that my son has taken up the same hobby as me, having started with scratch and a bit of python, he fancies his hand at Arduino.

Arduino digital input and output tutorial

By dave on July 25, 2017

In this tutorial and accompanying youtube video (left), I discuss how Arduino inputs and outputs work. Arduino 8 bit boards are mainly based on Atmel AVR chips, in fact the Mega is named after the chip number AVR-Mega-2560. Outputs on the AVR chips are much more versatile than they first look, and the video covers this in detail. If you are using an Arduino pro or other 3V3 based Arduino, replace the 5V mentioned here with 3V3.

IO abstraction: the same code for pins, shift registers and i2c IO

By dave on June 25, 2017

When writing Arduino code that needs quite a few IO pins, you may need to expand the IO using a shift register or i2c expansion device such as the PCF8574. Up until now that meant significantly changing your code to use the new device. If you were using the io-abstraction library then you’d just set up a different type of IO. This library allows you to treat shift registers and i2c exapnders almost as if they were pins.

Arduino Game library for 20x4 display

By dave on March 21, 2016

<img class=" titleimg" alt="Arduino Game Board 20x4" src="/images/electronics/arduino/games/game-library-20x4.jpg"/> Here we discuss a game library that provides an easy way to write games with 20x4 parallel display and a few micro-switches. There is quite a lot of stuff going on in this library, so I'd like to start slow and build up. First, let's start by taking a look at the parts needed to use this library: 20x4 display (other size will work too) 4k7 resistors (at least 6) 220R or 330R resistor for backlight Microswitches for joystick 1uF capacitor to smooth PWM Arduino and breadboard!

Low power Arduino menu using tcmenu library

By dave on March 21, 2016

In this article we’ll discuss building a low power Arduino menu using tcMenu library. We will use a TFT screen and a rotary encoder connected to a PCF8574 device. The device will be SAMD MKR board. I’ve picked this choice purposely, because it’s non-trivial, and requires a lot of digging to make sure power usage is a low as possible. Running an Arduino menu on battery If the device can be powered from the mains, then power usage is probably not the biggest issue.

Working with and de-bouncing switches for Arduino

By dave on March 5, 2016

When we press a button that’s connected to an Arduino input, it is likely that the button will momentarily “flicker” between the on and off state. This gives false readings for a short period of time after the button is pressed. Problems caused by this can range from the mild annoyance of a slight flicker, to doing something more than once that should have only happened once. Therefore we need a way to ignore these false readings; ensuring we only consider the button pressed or released when we know for sure that it is “stable”.

Java development for Raspberry PI using an IDE

By dave on October 11, 2015

If you're anything like me, you'll probably want to develop any large Java application using a fully fledged IDE such as IntelliJ or Eclipse. However, these are probably better run on another computer if available, transferring the code onto the PI. This article shows how to use maven to do fast turn around development onto a PI from a laptop. Note I'm not talking about using this for single class file Java development, but for larger systems.

Buffering an arduino output pin for more power

By dave on May 2, 2015

There are some occasions when the amount you safely draw (assume 20mA) from an Arduino board pin is just not enough (and some Arduino boards have even lower current capability). In these cases the output needs to be buffered in order to provide more power. At this point there are several possibilities, including ready made buffer chips such as the ULN2003A. However, in this tutorial we are going to discuss single transistor buffers; which are simple to build, easily understood and good for a few hundred milli-amps.

This site uses cookies to analyse traffic, and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.

Send a message
X

Please use the forum for help with UI & libraries.

This message will be securely transmitted to our servers.