EmbeddedRelated.com
The 2024 Embedded Online Conference

Creating a Hardware Abstraction Layer (HAL) in C

Jacob Beningo October 23, 20233 comments

In my last post, C to C++: Using Abstract Interfaces to Create Hardware Abstraction Layers (HAL), I discussed how vital hardware abstraction layers are and how to use a C++ abstract interface to create them. You may be thinking, that’s great for C++, but I work in C! How do I create a HAL that can easily swap in and out different drivers? In today’s post, I will walk through exactly how to do that while using the I2C bus as an example.


Getting Started With Zephyr: Devicetree Overlays

Mohammed Billoo September 25, 2023

In this blog post, I show how the Devicetree overlay is a valuable construct in The Zephyr Project RTOS. Overlays allow embedded software engineers to override the default pin configuration specified in Zephyr for a particular board. In this blog post, I use I2C as an example. Specifically, I showed the default I2C pins used for the nRF52840 development kit in the nominal Zephyr Devicetree. Then, I demonstrated how an overlay can be used to override this pin configuration and the final result.


STM32 B-CAMS-OMV Walkthrough

Peter McLaughlin April 30, 20231 comment

The STM32 B-CAMS-OMV camera module offers an accessible way to get started with embedded vision. Coupled with the STM32H747I-DISCO discovery kit and the FP-AI-VISION1 function pack, it's possible to be up and running in minutes.

This video describes the camera connection interface to the discovery kit and the key software functions required to control the camera and process its data. We review the ISP (Image Signal Processor) interface with examples of image processing...


Libgpiod - Toggling GPIOs The Right Way In Embedded Linux

Mohammed Billoo January 24, 2023
Overview

We all know that GPIO is one of the core elements of any embedded system. We use GPIOs to control LEDs and use them to monitor switches and button presses. In modern embedded systems, GPIOs can also be used as pins for other peripheral busses, such as SPI and I2C. Similar to the previous article on interacting with peripherals on an SPI bus in userspace via SPIdev (https://www.embeddedrelated.com/showarticle/1485.php), we can also control GPIOs from userspace on an embedded...


How to Give Persistent Names To USB-Serial Devices on Ubuntu 14.04

Tayyar GUZEL May 22, 20171 comment

If you have a bunch of USB-serial devices connected to your dock station and you needed to bind your USB-serial devices under static names so that all the USB-serial devices don't get to be assigned to random names by "udev" manager when you re-plug your laptop to the dock station, follow the instructions below. I will share the udev rules I created as a reference and give the step by step instructions to achieve persistent naming. All the steps worked on my Ubuntu 14.04...


Handling latency in data acquisition systems

Fabien Le Mentec November 8, 2015

In recent projects, I found myself working with data acquisition systems. For instance: PCIe/10GbE readouts for 2D XRay detectors (RASHPA slides, RASHPA paper) instruments mixing 1D signal acquisition and triggering, microcontroller based system for audio transmission: (NRF spearker)


Data Validity in Embedded Systems

Stephen Friederichs October 5, 20131 comment

If you take a high-level view of software systems you might say that the overall goal of software is to generate outputs from inputs. It’s a gross simplification of a nuanced and complex field but the truth of the statement is unarguable: data goes in, is manipulated and then is spat out again.That’s what software does. The simplicity of the statement contributes to the joy of Computer Science majors who take an abstract view of everything from software to love but infuriates...


A simple working I2C (TWI) level shifter

Dr Cagri Tanriover July 16, 20132 comments

Recently, I had to interface two hardware platforms via an I2C bus (a.k.a. two-wire interface, TWI) to query temperature and real-time clock information. This task is relatively straightforward on the software side. However, because the power supply of the two platforms were different (one at 3.3V and the other at 5V), the I2C busses could not be connected to one another directly and a level shifter was required between them.

 There are commercially available I2C level shifters such as...


LCD Control with an MCU

Dr Cagri Tanriover November 17, 20129 comments

 Controlling a liquid crystal display (LCD) to indicate a few ASCII characters should not be a big challenge as a project. That’s exactly what I thought when I decided to include a 2 line by 16 character display in my current project. My initial thought was. “How difficult could it be with all the resources on the internet and my embedded development expertise primarily in telecoms?” Let me tell you it is not as straightforward as I thought it would be and therefore I...


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...


C++ on microcontrollers 1 - introduction, and an output pin class

Wouter van Ooijen October 9, 20117 comments

 

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 am lazy. I am also a programmer. Luckily, being a lazy...


How to Give Persistent Names To USB-Serial Devices on Ubuntu 14.04

Tayyar GUZEL May 22, 20171 comment

If you have a bunch of USB-serial devices connected to your dock station and you needed to bind your USB-serial devices under static names so that all the USB-serial devices don't get to be assigned to random names by "udev" manager when you re-plug your laptop to the dock station, follow the instructions below. I will share the udev rules I created as a reference and give the step by step instructions to achieve persistent naming. All the steps worked on my Ubuntu 14.04...


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...


Creating a Hardware Abstraction Layer (HAL) in C

Jacob Beningo October 23, 20233 comments

In my last post, C to C++: Using Abstract Interfaces to Create Hardware Abstraction Layers (HAL), I discussed how vital hardware abstraction layers are and how to use a C++ abstract interface to create them. You may be thinking, that’s great for C++, but I work in C! How do I create a HAL that can easily swap in and out different drivers? In today’s post, I will walk through exactly how to do that while using the I2C bus as an example.


Libgpiod - Toggling GPIOs The Right Way In Embedded Linux

Mohammed Billoo January 24, 2023
Overview

We all know that GPIO is one of the core elements of any embedded system. We use GPIOs to control LEDs and use them to monitor switches and button presses. In modern embedded systems, GPIOs can also be used as pins for other peripheral busses, such as SPI and I2C. Similar to the previous article on interacting with peripherals on an SPI bus in userspace via SPIdev (https://www.embeddedrelated.com/showarticle/1485.php), we can also control GPIOs from userspace on an embedded...


A simple working I2C (TWI) level shifter

Dr Cagri Tanriover July 16, 20132 comments

Recently, I had to interface two hardware platforms via an I2C bus (a.k.a. two-wire interface, TWI) to query temperature and real-time clock information. This task is relatively straightforward on the software side. However, because the power supply of the two platforms were different (one at 3.3V and the other at 5V), the I2C busses could not be connected to one another directly and a level shifter was required between them.

 There are commercially available I2C level shifters such as...


C++ on microcontrollers 3 – a first shot at an hc595 class with 8 output pins

Wouter van Ooijen November 2, 2011

 previous parts: 1, 2

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.

In the first part of...


Getting Started With Zephyr: Devicetree Overlays

Mohammed Billoo September 25, 2023

In this blog post, I show how the Devicetree overlay is a valuable construct in The Zephyr Project RTOS. Overlays allow embedded software engineers to override the default pin configuration specified in Zephyr for a particular board. In this blog post, I use I2C as an example. Specifically, I showed the default I2C pins used for the nRF52840 development kit in the nominal Zephyr Devicetree. Then, I demonstrated how an overlay can be used to override this pin configuration and the final result.


LCD Control with an MCU

Dr Cagri Tanriover November 17, 20129 comments

 Controlling a liquid crystal display (LCD) to indicate a few ASCII characters should not be a big challenge as a project. That’s exactly what I thought when I decided to include a 2 line by 16 character display in my current project. My initial thought was. “How difficult could it be with all the resources on the internet and my embedded development expertise primarily in telecoms?” Let me tell you it is not as straightforward as I thought it would be and therefore I...


Data Validity in Embedded Systems

Stephen Friederichs October 5, 20131 comment

If you take a high-level view of software systems you might say that the overall goal of software is to generate outputs from inputs. It’s a gross simplification of a nuanced and complex field but the truth of the statement is unarguable: data goes in, is manipulated and then is spat out again.That’s what software does. The simplicity of the statement contributes to the joy of Computer Science majors who take an abstract view of everything from software to love but infuriates...


The 2024 Embedded Online Conference