All Projects

How to IoT: MQTT on Nucleo and ESP8266

Have you ever heard of Internet of Things? How about MQTT protocol? I think so. But maybe you didn’t start an IoT project of your own yet. If yes, the time is now. In this post you will find the details of my project on STM32F103 Nucleo board running FreeRTOS and ESP8266 WiFi module, logging temperature data to Eclipse MQTT broker using Paho Embedded…

Semaphore and Mutex on ARM Cortex-M

Once you go deep in microcontroller low-level stuff, concurrent tasks make you need mutex and semaphores for multi-thread synchronization or preventing race conditions. Here is how to implement mutual exclusion and semaphores on ARM Cortex-M3/M4 in C/C++ since it is not available on bare-metal 😆 1 Exclusive Access2 Cortex-M Solution3 Implementation3.1 Exclusive Read-Modify-Write3.2 Testing the Exclusive Monitor3.3 Mutex and Semaphore (Binary/Counting) Exclusive Access Synchronization…

PushME Keypad Reader for FreeRTOS

My fancy, event-based keypad reader library PushME is on my website for a while and its time to add FreeRTOS support now. Since reading multiple buttons and keeping track of events like long-press or repetitive-press is a critical task for many embedded projects, the FreeRTOS version will help you on medium to large scale FreeRTOS projects. Let’s get hands dirty 😎 1 Design with…

How To Debug Microcontroller Easily

You are an embedded firmware developer, you have a board and there is a problem as always, and you want to know what is wrong in there. Welcome to the club of desperate engineers! And good news, there is a solution that can make your life much easier ✨✨✨ Using BigBug you can print messages to track your software, as many as you want,…

Transistor-101: Practical Common Emitter Amplifier Design

The universe started with a big-bang, just like the story of electronics started with transistors. I dedicate this page to the most common application of bipolar transistors (BJT), specifically NPN transistor. You will find a practical design and analysis of a class-A, common-emitter amplifier in this post. My favourite SPICE software is LTspice and I will use it for simulation and design verification. Ready,…

Embedded MCU on Eclipse Setup

If you are into ARM microcontroller programming, you will notice the complexity of setting up a working environment and toolchain unless you are using a limited version of a non-free IDE like Keil MDK ARM or trial version of IAR Embedded Workbench but nothing is like using a totally free environment. GNU MCU Eclipse project is a life-saver at this point and here is…

STM32 Project From Scratch on Eclipse

If you want to use the popular STM32 ARM series of microcontrollers but you don’t like using example projects or templates and want to create your development environment from scratch, you are at the correct page. I will explain step by step how to create a project on Eclipse. 1 Brief2 Prerequisites3 Hands-on3.1 Creating an empty project3.2 MCU Peripheral Libraries3.3 Create Source Files3.4 Startup…

Convenient Way of Reading Keypad Buttons

Most of microcontroller coding tutorials’ second page is dedicated to reading pin or buttons. But for sure, that never means this is a trivial task and a keypad reader is easy to implement for a well designed MCU program that you should never underestimate. With this C keypad reader, you don’t have to struggle. 1 The Best Practice2 Features of PushME2.1 Key Definitions2.2 Debounce…

Getting Started with BananaPI Linux

Single board computers have been very popular in the community due to their low price and high flexibility and Banana Pi board, which is powered by Allwinner A20, is no exception. In this blog post you will find everything you need to prepare a Banana Pi Linux image from scratch. 1 Board setup2 Build environment2.1 Build OS2.2 Required packages3 Banana Pi BSP building3.1 U-boot…

Timebase for Everything: Ticker Real-Time

I covered the basics for making an embedded project which is also portable in the previous post Part1. Now it’s time to go one step further and implement a portable Ticker (a.k.a. system tick timer) for Porty. It will be the timebase of the system and may come in handy for basic time scheduling. 1 Features of the Ticker2 Project files3 Download Features of…

Create MCU Independent Embedded Code

One of the struggles in the embedded world is writing software that is reusable in other projects with different microcontrollers. The reason to that is every microprocessor has its own I/O and hardware structures. Good news! you can still write fully portable MCU software with the Porty framework 🙂 1 What is Porty?2 What does it offer?3 Project files4 Blinky example5 Download6 Compilation7 Conclusion What…

Simple and Efficient Task Scheduler

In embedded applications, punctuality is very critical. You always need to put the tasks on schedules and run them on specific moments. This is why some applications use a real-time operating system such as FreeRTOS or at least a task scheduler. If you are looking for a small-footprint task scheduler, you hit the jackpot because Punctual covers all of your needs! 1 What is…

Control The Lights with Any IR Remote

Have you ever wanted to turn off the lights without moving, especially when you started a film on TV or when you felt asleep after a busy day? If the switch is out of reach, it is most likely to leave the lights on. I inspired from that idea and built the perfect solution; an IR remote controlled light switch!💡 1 The solution2 Key…