EmbeddedRelated.com

Getting Started With CUDA C on an Nvidia Jetson: GPU Architecture

Mohammed Billoo March 28, 2024

In the previous blog post (Getting Started With CUDA C on Jetson Nvidia: Hello CUDA World!) I showed how to develop applications targeted at a GPU on a Nvidia Jetson Nano. As we observed in that blog post, performing a calculation on a 1-D array on a GPU had no performance benefit compared to a traditional CPU implementation, even on an array with many elements. In this blog post, we will learn about the GPU architecture to better explain the behavior and to understand the applications where a GPU shines (hint: it has to do with graphics).


Understanding Microchip 8-bit PIC Configuration

Luther Stanton March 26, 2024

The second post of a five part series picks up getting started developing with Microchip 8-bit PIC Microcontroller by examining the how and why of processor configuration. Topics discussed include selecting the oscillator to use during processor startup and refining the configuration once the application starts. A walk through of the code generated by the Microchip IDE provides a concrete example of the specific Configuration Word and SFR values needed to configure the project specific clock configuration.


C to C++: Templates and Generics – Supercharging Type Flexibility

Jacob Beningo March 24, 2024

"C to C++: Templates and Generics – Supercharging Type Flexibility" illuminates the rigidity of C when managing multiple types and the confusion of code replication or macro complexity. In contrast, C++ offers templates, acting as type-agnostic blueprints for classes and functions, which allows for the creation of versatile and reusable code without redundancy. By using templates, developers can define operations like add once and apply them to any data type, simplifying codebases significantly. Generics further this concept, enabling a single code structure to handle diverse data types efficiently—a boon for embedded systems where operations must be performed on varying data, yet code efficiency is critical due to resource limitations. The blog walks through practical applications, showcasing how templates streamline processes and ensure type safety with static_assert, all while weighing the pros and cons of their use in embedded software, advocating for careful practice to harness their full potential.


Using (Apache) NuttX Buttons Subsystem

Alan C Assis March 22, 2024

Previously in this EmbeddedRelated article, we saw how to use LEDs Subsystem on NuttX testing on RaspberryPi Pico. In the same way we avoided using GPIO Subsystem to control LEDs we can avoid using GPIO Subsystem to read Buttons inputs. That is right, NuttX has an Input Device Subsystem like Linux and today we will learn how to use it.

Buttons are one of the simplest user input interface and after the famous "hello world LED" example they are probably the second thing that...


Simple C++ State Machine Engine

Massimiliano Pagani March 14, 2024

When implementing state machines in your project it is an advantage to rely on a tried and tested state machine engine. This component is reused for every kind of application and helps the developer focus on the domain part of the software. In this article, the design process that turns a custom C++ code into a finite-state machine engine is fully described with motivations and tradeoffs for each iteration.


Getting Started With CUDA C on an Nvidia Jetson: Hello CUDA World!

Mohammed Billoo March 13, 2024

In this blog post, I introduce CUDA, which is a framework designed to allow developers to take advantage of Nvidia's GPU hardware acceleration to efficiently implement certain type of applications. I demonstrate an implementation to perform vector addition using CUDA C and compare it against the traditional implementation in "regular" C.


Modeling Gate Drive Diodes

Jason Sachs March 11, 20241 comment

This is a short article about how to analyze the diode in some gate drive circuits when figuring out turn-off characteristics --- specifically, determining the relationship between gate drive current and gate voltage during turn-off of a power transistor.


Getting Started with the Microchip PIC® Microcontroller

Luther Stanton March 11, 2024

This first post of a five part series looks at the available hardware options for getting started with Microchip 8-bit PIC® Microcontroller, explores the MPLAB® X Integrated Development Environment and walks through setting up a project to expose the configured clock to an external pin and implement a single output GPIO to light an LED.


Make Your Own MCU Boards (2023 Teardown Conference)

Nathan Jones March 7, 2024

Ditch the development boards! Products like the Nucleo development boards serve a wonderful purpose, but they’re ill-suited for projects that need to be small and cheap, such as hobby projects or products just beginning a production run. In this talk (a recording from the 2023 Teardown Conference), you’ll learn how to put a microcontroller or other custom circuit on a PCB a little larger than a stick of gum for less than $3 a board.


BusyBox; The Swiss Army Knife of Embedded Linux

George Emad March 2, 2024

In this article we cover the BusyBox, how it's designed to be optimized for embedded targets, and how to configure and build it in different ways, we also covered the license and limitation, which led to the development of ToyBox, I hope you enjoyed the article, please leave a comment for any correction or suggestions.


Introduction to Microcontrollers - Beginnings

Mike Silva August 20, 201314 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...


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,


VHDL tutorial - A practical example - part 3 - VHDL testbench

Gene Breniman June 25, 20118 comments

In part 1 of this series we focused on the hardware design, including some of the VHDL definitions of the I/O characteristics of the CPLD part.  In part 2, we described the VHDL logic of the CPLD for this design.  In part 3, we will show the entire VHDL design and the associated tests used to prove that we have, in fact, designed what we started out to design.

First, let's pull all of the pieces of the prior design together into a...


Analyzing the Linker Map file with a little help from the ELF and the DWARF

Govind Mukundan December 27, 201522 comments

When you're writing firmware, there always comes a time when you need to check the resources consumed by your efforts - perhaps because you're running out of RAM or Flash or you want to optimize something. The map file generated by your linker is a useful tool to aid in the resource analysis. I wanted to filter and sort the data generated in an interactive way so I wrote a C# WinForms application that reads the data from the map and presents it in a list view (using the awesome


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


How FPGAs work, and why you'll buy one

Yossi Kreinin June 20, 201315 comments

Today, pretty much everyone has a CPU, a DSP and a GPU, buried somewhere in their PC, phone, car, etc. Most don't know or care that they bought any of these, but they did.

Will everyone, at some future point, also buy an FPGA? The market size of FPGAs today is about 1% of the annual global semiconductor sales (~$3B vs ~$300B). Will FPGA eventually...


Understanding and Preventing Overflow (I Had Too Much to Add Last Night)

Jason Sachs December 4, 2013

Happy Thanksgiving! Maybe the memory of eating too much turkey is fresh in your mind. If so, this would be a good time to talk about overflow.

In the world of floating-point arithmetic, overflow is possible but not particularly common. You can get it when numbers become too large; IEEE double-precision floating-point numbers support a range of just under 21024, and if you go beyond that you have problems:

for k in [10, 100, 1000, 1020, 1023, 1023.9, 1023.9999, 1024]: try: ...

How to Read a Power MOSFET Datasheet

Jason Sachs September 15, 201514 comments

One of my pet peeves is when my fellow engineers misinterpret component datasheets. This happened a few times recently in separate instances, all involving power MOSFETs. So it’s time for me to get on my soapbox. Listen up!

I was going to post an article on how to read component datasheets in general. But MOSFETs are a good place to start, and are a little more specific. I’m not the first person to write something about how to read datasheets; here are some other good...


Adventures in Signal Processing with Python

Jason Sachs June 23, 201311 comments

Author’s note: This article was originally called Adventures in Signal Processing with Python (MATLAB? We don’t need no stinkin' MATLAB!) — the allusion to The Treasure of the Sierra Madre has been removed, in deference to being a good neighbor to The MathWorks. While I don’t make it a secret of my dislike of many aspects of MATLAB — which I mention later in this article — I do hope they can improve their software and reduce the price. Please note this...


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