Home|Embedded Systems

Everything related to embedded systems: microcontrollers, firmware, practical examples, hardware related tips, etc.

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

2019-05-18T23:18:47+03:00By |Categories: Embedded Systems|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

2019-05-18T23:16:23+03:00By |Categories: Embedded Systems|Tags: |0 Comments

Global and Local Variables in Embedded C Programs

There are two main concepts that have to be explained in order for us to fully understand the differences between global and local variables in C programs: Scope  -  determines the region of the program where a variable can be accessed Storage Duration - determines when a variable is created and destroyed (lifetime of the variable)

2019-05-18T23:36:48+03:00By |Categories: Embedded Systems|Tags: |0 Comments

Memory Layout of Embedded C Programs

The memory layout of C programs consists of several segments. The segments accessible to a user program are shown in the figure below:   Fig. 1 C program memory layout Code Segment (.text)   This segment stores the executable program code (the machine instructions). Variables defined with the const type qualifier can also be placed

2019-05-18T23:19:36+03:00By |Categories: Embedded Systems|Tags: |4 Comments

The Boot Process of a Microcontroller

Overview Even though the boot process can be a complex sequence involving multiple steps it always starts with the same first step. When the power-on reset sequence is finished and the CPU comes out of reset, the program counter is pointing to the address of the reset vector (boot vector). This address contains the first instruction that

2019-05-18T23:41:04+03:00By |Categories: Embedded Systems|Tags: |1 Comment

The Concept of Heap and Its Usage in Embedded Systems

Overview A typical memory representation of a C language program consists of following segments:  Code (Text) segment - contains the program code (machine instructions)  Data segment - contains the static data (global/static variables)  Stack segment (see our article on the topic The Concept of Stack and Its Usage in Microprocessors)  Heap segment Fig.1 Memory Segments

2019-05-18T23:23:52+03:00By |Categories: Embedded Systems|Tags: |0 Comments

The Concept of Stack and Its Usage in Microprocessors

Overview In general we can describe the stack as a temporary storage for data.  The access to data in the stack is organized as Last In First Out (LIFO), which means that the last data stored in the stack is the first than can be retrieved and the first data stored in the stack is the last

2019-05-18T23:28:00+03:00By |Categories: Embedded Systems|Tags: |1 Comment

Application of MODBUS Protocol in Microcontrollers

MODBUS© Protocol is a messaging structure, widely used for master-slave communication between devices. Only one master (at the same time) is connected to the bus, and one or several (247 maximum number) slaves nodes are also connected to the same serial bus. When a MODBUS master wants information from a device, the master sends a message that contains

2019-05-18T23:33:17+03:00By |Categories: Embedded Systems|Tags: |1 Comment