October 16, 2013
Arduino Robotics

Beginner robotics is a series of article chronicling my first autonomous robot build, Clusterbot.  This build is meant to be affordable, relatively easy and instructive.  The total cost of the build is around $50. 1. Arduino robotics - motor control2. Arduino robotics - chassis, locomotion and power3. Arduino robotics - wiring, coding and a test run4. ## Introduction to Microcontrollers - More Timers and Displays October 15, 20131 comment Building Your World Around Timers By now you have seen four different ways to use timers in your programs. Next we will look at some ways to produce the effect of multiple parallel streams of work in your program with the help of timers. This effect is only an appearance, not a reality, since a single microcontroller (one core) can only run a single thread of code. However, since microcontrollers are so fast in relation to a great many of the tasks to... ## Arduino robotics #1 - motor control October 13, 20133 comments Arduino Robotics Beginner robotics is a series of article chronicling my first autonomous robot build, Clusterbot. This build is meant to be affordable, relatively easy and instructive. The total cost of the build is around$50.

1. Arduino robotics - motor control2. Arduino robotics - chassis, locomotion and power3. Arduino robotics - wiring, coding and a test run4.

## Introduction to Microcontrollers - Adding Some Real-World Hardware

When 2 LEDs Just Don't Cut It Anymore

So far, we've done everything in this series using two LEDs and one button.  I'm guessing that the thrill of blinking an LED has worn off by now, hard as that is to imagine.  What's more, we've just about reached the limits of what we can learn with such limited I/O.  We have come to the point where we need to add some hardware to our setup to continue with additional concepts and microcontroller...

## Introduction to Microcontrollers - Timers

Timers - Because "When" Matters

Computer programs are odd things, for one reason because they have no concept of time.  They may have the concept of sequential execution, but the time between instructions can be essentially any number and the program won't notice or care (unless assumptions about time have been built into the program by the programmer).  But the real world is not like this.  In the real world, especially the real embedded world,...

## Introduction to Microcontrollers - More On Interrupts

September 25, 2013

A Little More Detail About The Interrupt Mechanism

It's time to look a little closer at what happens in an interrupt request and response.  Again this is in general terms, and different microcontroller designs may do things somewhat differently, but the basics remain the same.  Most but not all interrupt requests are latched, which means the interrupt event sets a flag that stays set even if the interrupt event then goes away.  It is this latched flag...

## Introduction to Microcontrollers - Interrupts

It's Too Soon To Talk About Interrupts!

That, at least, could be one reaction to this chapter.  But over the years I've become convinced that new microcontroller programmers should understand interrupts before being introduced to any complex peripherals such as timers, UARTs, ADCs, and all the other powerful function blocks found on a modern microcontroller.  Since these peripherals are commonly used with interrupts, any introduction to them that does not...

## Introduction to Microcontrollers - More On GPIO

Now that we have our LED Blinky program nailed down, it's time to look more closely at outputs, add button/switch inputs, and work with reading inputs and driving outputs based on those inputs.

It's ON - No, It's OFF - No, It's ON...

I have to confess, I cheated.  Well, let's say I glossed over something very important.  In our LED Blinky program, we never cared about whether an output '1' or an output '0' turned on the LED.  Since we were just...

## Introduction to Microcontrollers - Hello World

Embedded Hello World

A standard first program on an embedded platform is the blinking LED.  Getting an LED to blink demonstrates that you have your toolchain set up correctly, that you are able to download your program code into the μC, and that the μC and associated circuitry (e.g. the power supply) is all working.  It can even give you good evidence as to the clock rate that your microcontroller is running (something that trips up a great many people,...

## Introduction to Microcontrollers - Further Beginnings

Embedded Programming Basics

This tutorial entry will discuss some further embedded programming basics that you will need to understand before proceeding on to the LED blinky and other example programs. We will do this by looking at the general organization and types of instructions found in most microcontrollers, and how that organization and those instructions are reflected (or, in some cases, ignored) by the C programming language.

Basic CPU...

## Introduction to Microcontrollers - 7-segment displays & Multiplexing

August 14, 2014

Doing the 7 Segment Shuffle

The 7 segment display is ubiquitous in the modern world.  Just about every digital clock, calculator and movie bomb has one.  The treadmills at my gym have 6 or 7, each one displaying 3 or 4 digits.  What makes the 7-seg interesting is that it presents an opportunity to make a trade off between GPIO (output pins) for time.  Every 7-seg display requires 8 outputs (the 7 segments and usually either a decimal point or a...

## VHDL tutorial - A practical example - part 1 - Hardware

May 18, 20111 comment

In previous posts I described some simple VHDL examples.  This time let's try something a little more complex. This is part one of a multiple part article.  This is intended to be a detailed description of one of several initial designs that I developed for a client.  This design never made it into a product, but a similar design was used and is currently being produced.  As a considerable amount of work was put into this effort, I decided to share this design...

## C Programming Techniques: Function Call Inlining

Introduction

Abstraction is a key to manage software systems as they increase in size and complexity. As shown in a previous post, abstraction requires a developper to clearly define a software interface for both data and functions, and eventually hide the underlying implementation.When using the C language, the interface is often exposed in a header '.h' file, while the implementation is put in one or more  corresponding '.c' files.

First, separating an interface from its...

## Introduction to Microcontrollers - More On Interrupts

September 25, 2013

A Little More Detail About The Interrupt Mechanism

It's time to look a little closer at what happens in an interrupt request and response.  Again this is in general terms, and different microcontroller designs may do things somewhat differently, but the basics remain the same.  Most but not all interrupt requests are latched, which means the interrupt event sets a flag that stays set even if the interrupt event then goes away.  It is this latched flag...

## Coding - Step 0: Setting Up a Development Environment

Articles in this series:

You can easily find a million articles out there discussing compiler nuances, weighing the pros and cons of various data structures or discussing the  optimization of databases. Those sorts of articles are fascinating reads for advanced programmers but...

## How to Arduino - a video toolbox

November 15, 20131 comment

I've begun producing a new series of video tutorials for the hobbyist new to the Arduino or microcontrollers in general.  My videos are very pragmatic - I prefer to answer the question "what is the quickest, simplest and most affordable way to accomplish this?".  The videos are meant to be a quick source of "how to" knowledge for the hobbyist that is using an LCD display, ultrasonic sensor or accelerometer for the first time, for example.  I hope you enjoy this series of...

## Coding Step 1 - Hello World and Makefiles

Articles in this series:

Step 0 discussed how to install GCC and the make utility with the expectation of writing and compiling your first C program. In this article, I discuss how to use those tools we installed last time. Specifically, how to use GCC to compile a C program and...

## Introduction to Microcontrollers - Button Matrix & Auto Repeating

November 12, 2013

Too Many Buttons, Not Enough Inputs

Assigning one GPIO input to each button can use up a lot of GPIO pins.  Numeric input requires at least 10 buttons, plus however many additional control or function buttons.  This can quickly get expensive, GPIO pin-wise, and also connector-wise if the keypad is off the uC PCB as it often would be.  A very common response to this expense is to wire buttons (keys, etc) in a matrix.  By connecting our buttons in an...

## C++ on microcontrollers 2 - LPCXpresso, LPC-link, Code Sourcery, lpc21isp, linkerscript, LPC1114 startup

previous parts: 1

This blog series is about the use of C++ for modern microcontrollers. My plan is to show the gradual development of a basic I/O library. I will introduce the object-oriented C++ features that are used step by step, to provide a gentle yet practical introduction into C++ for C programmers.  Reader input is very much appreciated, you might even steer me in the direction you find most interesting.

I teach my students that...