EmbeddedRelated.com
Tutorials
The 2024 Embedded Online Conference

Introduction to Microcontrollers - Beginnings

Mike Silva August 20, 201313 comments

Welcome to this Introduction to Microcontroller Programming tutorial series. If you are looking to learn the basics of embedded programming for microcontrollers (and a bit of embedded hardware design as well), I hope these tutorials will help you along that journey. These are my first postings here, and I am writing this tutorial series because over the years I have seen countless newbies asking the same questions and tripping over the same stumbling blocks, and I thought I might be able to...


Intro to Microcontrollers Part 2: AVR Microcontrollers

July 11, 2013
Introduction

This is part 2 of my playing around with AVR microcontrollers. Last time, I had a basic setup which could program an AVR using the Arduino ISP. I used it to drive a simple 7-segment, multiplexed 4-digit LED display. This is a follow up where I try out some of the other features the ATTiny24A has to offer. I also decided to invest some money in an AVR Dragon programmer/debugger so I'll go over some basic playing and setup with this device. I'll also discuss some of the problems...


MSP430 LaunchPad Tutorial - Part 4 - UART Transmission

Enrico Garante July 3, 201320 comments

Today we are going to learn how to communicate using UART with the Launchpad. For this purpose I will replace the default microcontroller that comes with the board with the MSP430G2553. It is the most powerful device in the MSP430 Value Line and it comes with an integrated hardware UART module, along with 16 Kb of Flash memory, 512 bytes of SRAM and an 8-channel, 10 bit ADC.

UART communication can be useful when dealing with sensors: as a basic example, we could...


MSP430 LaunchPad Tutorial - Part 3 - ADC

Enrico Garante June 25, 20138 comments

In this new episode of our journey into MSP430 I will explain the basics of Analog to Digital Conversion on the MSP430G2231.We will write a program that will read an ADC channel and will toggle some leds based on the result of the conversion. 

We start as usual with the inclusion of the header file for the MSP430G2231, the leds stuff and with the definition of a variable that will store the result of the conversion. We also declare a function that will initialize the ADC...


MSP430 Launchpad Tutorial - Part 2 - Interrupts and timers

Enrico Garante June 17, 201342 comments

What is an "interrupt"? It is a signal that informs our MCU that a certain event has happened, causing the interruption of the normal flow of the main program and the execution of an "interrupt routine", that handles the event and takes a specified action.

Interrupts are essential to avoid wasting the processor's valuable time in polling loops, waiting for external events (in fact they are used in Real-Time Operating Systems,


An Introduction to Embedded Development

Peter Johansson June 14, 20133 comments
This blog is a series to provide an introduction to embedded development for the aspiring embedded developer. No prior embedded development experience will be assumed, but you should have a reasonable understanding of the C language and knowledge of basic electronics. It will focus on the TI MSP430, but present topics in a generic way that can be easily translated to other processors. Welcome!

Hello, and welcome to my blog! This blog will be somewhat different from most...


MSP430 Launchpad Tutorial - Part 1 - Basics

Enrico Garante June 14, 201320 comments

TI's LaunchPad is a complete MSP430 development environment: all you have to do is download and install CCS IDE (login required), connect your G2231-ready LaunchPad to your computer with the included mini-usb cable, and you are ready to code!

Texas Instrument MSP430 LaunchPad

So, let's see how to start a new project in Code Composer Studio. This IDE is derived from Eclipse, so if you used it before you shouldn't have much problems.

We'll write a simple program that will...


Endianness and Serial Communication

Stephen Friederichs May 20, 20131 comment

Endianness is a consideration that is easily overlooked in the design of embedded systems. I myself am amply guilty of this oversight. It’s something you don’t ever have to worry about if you’re only working with a single processor or two processors that have the same endianness.  You can even avoid it if you have two processors that have different endianness but never transmit data between themselves that consists of more than one byte.  It’s easy to lull...


C Programming Techniques: Function Call Inlining

Fabien Le Mentec April 29, 20137 comments
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...


Debugging with Heartbeat LEDs

Stephen Friederichs April 1, 2013

In this article I’ll discuss one of the most basic debugging tools in an embedded system: the heartbeat LED.  Picture this: you’re developing your first program for a new microcontroller. You’ve written the code, configured the programmer, downloaded the HEX file and now... what Your program is running - isn’t it?

Truth is that it’s hard to tell with most embedded software.  Compared to desktop or even server applications embedded software tend not to have very many...


Coding Step 2 - Source Control

Articles in this series:

When I first started out in programming, version control was not an introductory topic. Not in the least because it required a 'server' (ie, a computer which a teenaged me couldn't afford) but because it seemed difficult and only useful to teams rather than...


How to make a heap profiler

Yossi Kreinin May 23, 20141 comment

We'll see how to make a heap profiler. Example code for this post makes up heapprof, a working 250-line heap profiler for programs using malloc/free.

It works out of the box on Linux (tested on "real" programs like gdb and python). The main point though is being easy to port and modify to suit your needs. The code, build and test scripts are at github.

Why roll your own heap profiler?

  • It's easy! And fun, if you're that sort of person. What, not reasons enough? OK, how...

Cracking the (embedded) Coding Interview

Manasi Rajan March 23, 2023

You never forget the day you land your first job. 

The thrill of receiving that call from your recruiter to tell you that you bagged your dream role! The relief when you finally see the offer letter you’ve been working towards for years. The pride in your parents' voices when you call home and say “Hey look Ma, I’ve made it!”

But before that, there’s the grueling screening process to get through. Tech interviews often last up to three months and companies can have five...


Linux Kernel Development - Part 1: Hello Kernel!

Denis Cavalli June 2, 20192 comments

Our very first program in every language or framework usually is the notorious "Hello World" program. For this Linux Kernel Modules Development introduction we will follow the same concept, but instead of the usual "Hello World" we will make a "Hello Kernel!" and you will understand the reason in a few moments. Note that in this article I will not focus on a deep explanation about this topic for the moment, since this is only the introduction.

But before we dive into code we need to have the...


C++ on microcontrollers 4 – input pins, and decoding a rotary switch

Wouter van Ooijen November 12, 20112 comments

previous parts: 1, 2, 3

 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.

So far I...


Arduino robotics #2 - chassis, locomotion and power

Lonnie Honeycutt October 16, 20131 comment
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. 

Coding Step 3 - High-Level Requirements

Stephen Friederichs August 17, 20152 comments

Articles in this series:

If this series of articles has been light on one thing it's 'coding'. If it's been light on two things the second is 'embedded'. In three articles I haven't gotten past Hello World on a desktop PC. That changes (slowly) with this article. In this article I'll...


Embedded Programming Video Course Shows How OOP Works Under the Hood

Miro Samek September 29, 2019

If you'd like to understand how Object-Oriented Programming (OOP) really works under the hood, here is a free video course for you:

OOP part-1: Encapsulation: This first lesson on Object-Oriented Programming (OOP) introduces the concept of Encapsulation, which is the ability to package data and functions together into classes. You'll see how you can emulate Encapsulation in C, what kind of code is generated, and how to debug such code. Next, you will translate the C design into C++ using...


Debugging with Heartbeat LEDs

Stephen Friederichs April 1, 2013

In this article I’ll discuss one of the most basic debugging tools in an embedded system: the heartbeat LED.  Picture this: you’re developing your first program for a new microcontroller. You’ve written the code, configured the programmer, downloaded the HEX file and now... what Your program is running - isn’t it?

Truth is that it’s hard to tell with most embedded software.  Compared to desktop or even server applications embedded software tend not to have very many...


Good old multiplexed keypad in an embedded system

Jayaraman Kiruthi Vasan April 17, 20118 comments

Good old multiplexed keypad in embedded systems

(My www.embeddedrelated.com Blog No.1)

Touch-screens, rotary encoder switches and other navigational aids rule the user interface these days.  Navigation through menus and sub-menus is child’s play as icons and thumbnails rule the screen.

 

Jumping from one screen to another, switching between programs and event notification pop-ups are made possible due to high...


The 2024 Embedded Online Conference