Articles

/Articles/

Bit Manipulation in C

Writing programs for embedded systems often requires the manipulation of individual bits. Below is a list of the most common operations. In the examples we are performing them on an unsigned long variable called ctrl_reg. Setting a bit We can set a bit using the bitwise OR operator (|): ctrl_reg |= 1UL << n; The [...]

By |2018-08-17T22:57:56+00:00February 2nd, 2018|Categories: Explained Simply|Tags: , , |0 Comments

Generate a Random Integer in Python

In this example we can see how to generate a random number in Python. import random x = random.randint(0,200) print x In the first row we import Python random module. It's contains different useful functions to generate random numbers. In the second row we use function randint from the imported module to generate integer between [...]

By |2017-11-25T22:19:08+00:00November 25th, 2017|Categories: How To|Tags: , |0 Comments

Install pip on Windows

What is pip? The pip command is a tool for installing and managing Python packages, such as those found in the Python Package Index. It makes the community's wealth of libraries accessible to everyone. New users are no longer excluded from using community libraries by the prohibitive difficulty of setup. It's a replacement for easy_install. When [...]

By |2017-11-25T17:10:07+00:00November 21st, 2017|Categories: How To|Tags: , |0 Comments

Memory Types Used in Embedded Systems

Hardware memory is used for storing information. In the case of embedded systems that may be the program data ,the program code itself, event logging etc. There are many types of technologies used when creating memory cells and many ways to categorize them, but we can distinguish two major categories based on the memory reaction [...]

By |2017-11-21T19:09:53+00:00November 15th, 2017|Categories: Explained Simply|Tags: , |1 Comment

Exception Types in Microcontrollers

Exceptions are events that disrupt the normal execution flow of the program. When an exception occurs the processor handles it by usually executing dedicated piece of code called exception handler. Each type of exception can have its own exception handler. In some literature sources exceptions and interrupts are analyzed as two different things. Expeptions being [...]

By |2017-09-24T07:59:16+00:00September 24th, 2017|Categories: Explained Simply|Tags: , |0 Comments

Adding an Options Page in WordPress Settings Menu

When you want to add an options page in WordPress, you need to use function add_options_page. This example will create one page containing a simple sting: add_action( 'admin_menu', 'my_menu' ); function my_menu() { add_options_page( 'Menu Title', 'Page Title', 'manage_options', 'page-slug', 'callback_fn' ); } function callback_fn() { echo "Some text"; } First part of the example adds [...]

By |2017-07-07T23:52:26+00:00July 7th, 2017|Categories: How To|Tags: , |0 Comments

Software and Hardware Breakpoints

A breakpoint is an intentional stopping place during an execution of a program. It is a powerful debugging feature allowing us to suspend the execution of the program at a certain point and examine the current values of variables and memory locations. The program can then be resumed from the exact point it was suspended. Adding or removing breakpoints [...]

By |2017-07-03T19:09:22+00:00July 3rd, 2017|Categories: Explained Simply|Tags: , |0 Comments

Build Stages of Embedded C Programs

We can generally define three levels of abstraction from the underlying hardware when we develop embedded programs: Machine Code  Assembly Language  High Level Language Machine code is the native language of the microprocessors (but it is not used for directly writing programs). So no matter at what level of abstraction we decide to write our [...]

By |2017-06-18T22:48:56+00:00June 18th, 2017|Categories: Explained Simply|Tags: , |0 Comments