Posts

Showing posts from 2019

Featured post

Arduino FreeRTOS Mutex Examples

In this section, we will explain using an example to demonstrate mutexes in Arduino using freeRTOSThere are two freeRTOS Mutex examples in this tutorial, the first example demands some hardware (LCD) While the second does not need any hardware, you can try out both if you have the resources.

In the last tutorial, we considered in detail: semaphores and mutexes and we also established the difference between binary semaphores and mutexes.
Just for a review:Recall that a mutex is a locking mechanism that implements the take and gives functionality in itself, unlike a binary semaphore. See this tutorial if you have not before continuing.
Example 1: Protecting the LCD Resource Using Mutex in freeRTOS
Program Description

In this program, we Demonstrated the use a 16x2 LCD display to implement a mutex.

The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. you can usually tell them by their 16-pin interface.

THE CIRCUIT

* LCD RS pin to digital…

Arduino FreeRTOS Mutex Examples

In this section, we will explain using an example to demonstrate mutexes in Arduino using freeRTOSThere are two freeRTOS Mutex examples in this tutorial, the first example demands some hardware (LCD) While the second does not need any hardware, you can try out both if you have the resources.

In the last tutorial, we considered in detail: semaphores and mutexes and we also established the difference between binary semaphores and mutexes.
Just for a review:Recall that a mutex is a locking mechanism that implements the take and gives functionality in itself, unlike a binary semaphore. See this tutorial if you have not before continuing.
Example 1: Protecting the LCD Resource Using Mutex in freeRTOS
Program Description

In this program, we Demonstrated the use a 16x2 LCD display to implement a mutex.

The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. you can usually tell them by their 16-pin interface.

THE CIRCUIT

* LCD RS pin to digital…

Arduino FreeRTOS Tutorial 05: Binary Semaphores and Mutexes

Semaphores and Mutexes are interesting operating system concept that is used for synchronization, resource management and protecting access to resources.

So far in our FreeRTOS Tutorial series, we have dealt with tasks and scheduling algorithms. In the process of the tutorial, we stumbled across an Operating system's concept called Semaphores and Mutexes, though you may not have noticed it.

The Idea

You might have observed while playing around with task priorities, that a high priority task could pre-empt a lower priority task at any time whether or not the low priority task has completed its execution. This is a common feature in a multi-tasking environment and it can cause data corruption, data integrity losses, etc. Thus, there is a need to protect resources, and control access using semaphores and mutexes.

Students usually find it difficult to understand this concept so I will be given an explanation using some illustrations, and also provide a code snippet for implementation o…

Arduino FreeRTOS Tutorial 04: Understanding Task Scheduling and Control

In the last Free RTOS Arduino tutorial, we were able to show how a task can be implemented and executed. We also saw how to delete a task that we no longer need after a while.

In this tutorial, we are going to learn and understand how task scheduling and execution work.

To properly understand this, we will be using an example to illustrate this.

In this example, we are creating two tasks with the same priority and in the second example, with two different priorities.
#include <Arduino_FreeRTOS.h> void setup() { Serial.begin(9600); xTaskCreate(Task1, "Task 1", 100, NULL, 1, NULL); xTaskCreate(Task2, "Task 2", 100, NULL, 1, NULL); vTaskStartScheduler(); // hands over control to kernel. Task execution begins } void loop(){ } ============================== void Task1(void* pvParameters) { for(;;) { Serial.println("Task1 is currently being executed"); vTaskDelay(500/portTICK_PERIOD_MS); } } void Task2(void* pvParameters) { for(;…

Arduino FreeRTOS Beginner Tutorial: Task Creation, Scheduling, Deleting

Tasks are basically functions that you want to execute. A task can be as simple as blinking a led, printing a string on an LCD.

Your program or embedded application is a combination of various tasks.

In the previous tutorial, we showed how to install freeRTOS in Arduino and we have also covered a quick introduction to RTOS.

In this tutorial we will be considering the following:

How to create tasks
Prioritizing tasks
How to delete tasks
How to run the scheduler
Features of tasks in freeRTOS.
In free RTOS, tasks have some features that you must adhere to when creating them.

It must not have an end. There should be no terminating statement (return statement)
A task should run continuously. To implement this, you will need to use an infinite loop in the tasks
Tasks have priorities. The priority of a task determines its pre-emptive nature. A task of higher priority can pre-empt one of lower priority. This is useful to enable you to achieve your hard and soft real-time requirements.
How to Create …

Arduino FreeRTOS Tutorial: Getting Started

For the next week, we will be starting a FreeRTOS series, we have already completed a basic introduction to RTOS. In this tutorial series, we will be implementing an RTOS (Real-Time Operating Systems) using FreeRTOS.

To better appreciate this tutorial, we will be taking a project that will encompass all we need to understand in FreeRTOS, I will propose a simple project to help us digest the concept of RTOS using FreeRTOS.

This tutorial series will cover the following contents:

Basic Introduction to FreeRTOS
FreeRTOS Installation
Task Creation, States, Scheduling and Deleting
Semaphores and Mutexes
RTOS VS FreeRTOS
FreeRTOS is to RTOS what windows OS is to OS. FreeRTOS provides the implementation of an RTOS for embedded application, however, freeRTOS is not a full OS, it is more accurately called freeRTOS Kernel because its functions is limited to kernel services of core real time scheduling functionality, inter-task communication, timing and synchronization only.
Why should you use FreeRT…

CyberSpace Security: How to protect yourself from Attacks

Cyberspace Threats and how to protect yourself from these attacks.




Recent studies have shown that a new type of threat is emerging on a global scale. Due to the proliferation and adoption of computer technology in various parts of the world, every data leaves a digital footprint, Cyber threats and attacks are being launched on-a-second basis: attacking financial institutions, tech companies, web servers, hosting companies, websites, applications, IoT services, etc.




Your inability to understand and mitigate yourself from these Cyber attacks will make you very vulnerable and insecure. For instance, your mobile bank app is at risk if you cannot protect your Android device from these attacks.




In this post we intend to achieve the following objectives:




Explain what these threats are and peculiar casesHow these threats can be mitigated and checkedSafety measures you should take in protecting yourself and your organization



CyberSpace and CyberSpace Threats



Cyberspace is a recent word in the En…

Digital Systems and Stability Analysis using Jury's Stability Test

In this post, we will be introducing digital control systems, their advantages, and disadvantages, we will also perform a comparison between digital and analog control systems. Then we will proceed to sampling and Shannons sampling theorem and how it is applied practically, we will also see some sampling circuits and review Zero Order Hold DAC. Finally, we will look into analysis of the response of digital systems using difference equations and Stability analysis of Digital Control Systems using Jury's stability criterion, we will explain how to plot the Jury's table using an example to illustrate the process and how to make statements about the stability of the system.

So many theories and analytical tools exist in classical analog control system analysis, however, due to the shifts in technology, control algorithms are now been implemented using digital systems and microprocessor-based controllers, this is because of its numerous advantages, recent studies have shifted focus…

Understanding Real Time Operating Systems [R.T.O.S]

It is very important for computer science students and electronic and computer engineers to understand real time operating systems. In this post, a solid background of RTOS will be established and you will be able to understand the basics and features of a real time OS.

Real time operating systems sounds strange at a glance, you can immediately suggest that it is an operating system that responds in real time. In an RTOS, tasks are given a deadline to complete, missing a deadline can cause undesired to catastrophic damages.

How then is it different from a General Purpose Operating system?

Where are they applied?

What features makes a given Operating system an RTOS?

Is there a way I can implement RTOS in my project if yes, how?

In this article, I will endeavor to answer all the questions listed above. If you would like to go through the history of RTOS, Wikipedia presents a good summary here.
What is an RTOS?
Let’s define an Operating system first.

An operating system is a system progra…

Procedure for Electricity Generation in a power plant

The Procedure for Electricity generation in a thermal Power plant is a rather intricate and continuous process that utilizes many engineering applications, equipment, and control mechanisms so as to efficiently produce the required output. It encompasses the production and purification of feedwater, demineralization of the feedwater, steam generation process and the efficient use of the steam by the turbines for power generation.

Basing this post on the engineering training received from Nigerian's biggest Power Plant (Egbin), The Electrical Power generation process involves the following stages:

Deep-well Water Production Process.
Water Treatment Process.
Demineralization Process.
Steam Generation Process (Boiler).
Steam Work Process (Turbine & Generator).
Water Production and Treatment Process
The Deep Well Water: The Deep-well can be said to be an industrial-sized borehole. The Deep-well is preferably used over the conventional stream or water body because it requires less modifi…

Basic Overview of the Internet of Things (IoT) and its Challenges

Understanding the Internet of things can be a very exciteful journey, in this post, we are going to fully explore the topics of interest. First, we define the term internet of things, then see some popular IoT examples, IoT companies, protocols used in IoT Applications and what the scope of IoT is.

Internet of things is a novel and fast growing technology in the world of information, communication and computing technology that soon will be affecting and structuring the lives and living standards of man on a global scale. Despise this wonderful potential, it has great challenges that if not handled effectively can be catastrophic. This article concludes by evaluating these challenges.
What is ( IoT )Internet of Things?
There is currently no agreed definition of the term internet of things, however, what all definitions have in common is the idea that the previous version of the Internet was about data created by people, while the internet of things is about data created by things. The b…