/Tag: microcontollers

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

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) [...]

By |2017-05-11T19:08:55+00:00May 11th, 2017|Categories: Explained Simply|Tags: , |0 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 [...]

By |2017-04-15T21:37:46+00:00April 15th, 2017|Categories: Explained Simply|Tags: , |1 Comment