x
Menu

Embedded Systems Programming

Other,

Updated On 02 Feb, 19

Overview

Getting Started - Counting - Flow of Control - Variables and Pointers - Blinking the LED - Preprocessor and volatile - Bit-wise operators in C - Arrays and Pointer Arithmetic - Functions and the Stack - Modules, Recursion, AAPCS - Stack Overflow and Other Pitfalls of Functions - stdint.h and mixing types - structures and CMSIS - startup code part - interrupts

Includes

Lecture 4: Variables and Pointers

4.1 ( 11 )


Lecture Details

This lesson shows how the ARM processor accesses variables in memory
and introduces POINTERs in C.

The lesson starts by moving the counter variable out of the main
function to the top of the file. This makes the variable no longer
local, but rather allocated in memory.

Next, you see the huge difference this causes in the compiled code.
You learn about the load and store instructions and the difference
between the RISC (Reduced Instruction Set Computer) architecture
and the CISC (Complex Instruction Set Compturer) architecture.

Next, you see how the fundamental concept of a memory address is
represented in the C language by means of a POINTER.

You will learn how to declare and initialize a pointer. You will
learn how to obtain the address of a variable with the & operator
and how to de-reference a pointer with the operator.

Next, you will see how to create an alias of a variable with a pointer
and you see how the compiled code gets simplified by using a pointer.

You will use your first breakpoint to quickly get to the interesting
part of the code.

Finally, the lesson shows a powerful technique of assigning an
arbitrary address to a pointer by casting a number, which is
very useful in embedded systems. You will also see how this technique
could be dangereous, if used carelessly.

In the next lesson will apply the knowledge from all lessons all the
previous lessons to blink an LED on the Stellaris Launchpad board.

Miro Samek
state-machine.com

---
YouTube PLAYLIST of the whole course
httpwww.youtube.complaylist?list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM

Course web-page
httpwww.state-machine.comquickstart

Ratings

0


0 Ratings
55%
30%
10%
3%
2%
Comments
comment person image

Sam

Excellent course helped me understand topic that i couldn't while attendinfg my college.

Reply
comment person image

Dembe

Great course. Thank you very much.

Reply
Send