Microcontroller Embedded C Programming

Foundation course on Embedded C programming using STM32 Microcontroller.

Last updated 2022-01-10 | 4.6

- 'C' programming from scratch
- Data types
- variables
- declarations
-
- Importance of Bit-Wise operators in "Embedded" programming

What you'll learn

'C' programming from scratch
Data types
variables
declarations

Importance of Bit-Wise operators in "Embedded" programming
Bit manipulation techniques using bit-wise operators and examples
Bit extraction and working with memory mapped peripheral registers
Other operators of 'C' (arithmatic
logical
relation
assignment )
Functions in 'C'
Implicit and explicit casting and its importance
Pointers and casting
Pointers arithmetic and importance of pointer datatypes
Accessing memory mapped peripheral registers using pointers
Structures and unions
Importance of structures in peripheral register access
Structure and bit fields
Configuring peripheral register addresses using bit fields
Structures and pointers
interfacing LEDs
Keypad
Const and volatile type qualifiers
importance of volatile during compiler optimization
const data
const pointer
cont volatile explanation with examples
Importance of const
Loops : for
while
do while

* Requirements

* Basic understanding of number systems
* logic gates
* bits and bytes.
* STM32F407 discovery board is required if you want to try out code on the target

Description

  • 'C' programming from scratch
  • Data types,variables, declarations,
  • Importance of Bit-Wise operators in "Embedded" programming
  • Bit manipulation techniques using bit-wise operators and examples
  • Bit extraction and working with memory mapped peripheral registers
  • Other operators of 'C' (arithmatic, logical, relation, assignment )
  • Functions in 'C'
  • Implicit and explicit casting and its importance
  • Pointers and casting
  • Pointers arithmetic and importance of pointer datatypes
  • Accessing memory mapped peripheral registers using pointers
  • Structures and unions
  • Importance of structures in peripheral register access
  • Structure and bit fields
  • Configuring peripheral register addresses using bit fields
  • Structures and pointers
  • interfacing LEDs, Keypad
  • Const and volatile type qualifiers
  • importance of volatile during compiler optimization
  • const data, const pointer, cont volatile explanation with examples
  • Importance of const
  • Loops : for, while, do while

Course content

31 sections • 193 lectures

About the instructor Preview 00:17

Programming languages for Embedded Systems Preview 02:40

History of 'C' and standardization Preview 02:43

Course repository Preview 00:02

Important Note Preview 00:42

Downloading IDE Preview 02:28

Key features of the STM32CubeIDE Preview 02:08

Installing STM32CubeIDE Preview 00:43

Installing STM32CubeIDE on Linux Preview 02:01

Installing compiler (GCC) for host Preview 01:43

Installing compiler (GCC) for host (WINDOWS) Preview 06:12

Installing compiler (GCC) for host (LINUX) Preview 01:26

Installing compiler (GCC) for host (MAC) Preview 01:09

Importing course projects in to workspace Preview 11:08

Creating a project for the HOST Preview 03:41

Creating a project for the Target Preview 04:26

FPU warning fix Preview 00:33

Hardware/Software Requirements Preview 00:05

Meet the embedded target of this course Preview 03:27

OnlineGDB web tool Preview 00:57

Printf and Hello World Preview 11:57

Printf exercise solution Preview 03:44

Escape sequences in 'C' Preview 03:48

Printf exercise solution Preview 04:10

Printf exercise solution Preview 03:31

Commenting in 'C' Preview 03:39

Data types in 'C' Preview 05:09

'C' Integer data types and value ranges Preview 05:20

Char data type and variable definition Preview 05:39

Variable definition exercise Preview 08:29

Range calculation for 'char' data type Preview 07:35

Integer data type 'short int' and value range Preview 03:05

Integer data type 'int' and 'long' Preview 01:17

Sizeof Preview 06:06

Variables naming rules and definition vs declaration Preview 09:10

Declaration vs definition : An illustration Preview 02:49

Variables scope and illustration Preview 09:01

Variables scope and illustration contd Preview 04:03

Summary of local and global variables Preview 01:03

Address of variables Preview 04:37

Address of variables contd. Preview 08:16

Storage class specifiers in 'C' Preview 06:55

Use cases of 'static' with variables Preview 06:16

Use cases of 'static' with functions Preview 03:52

'Extern' storage class specifier Preview 01:18

ASCII codes Preview 06:26

Introduction to functions in 'C' Preview 09:51

Function prototypes Preview 03:08

Returning data from a function Preview 02:13

Function exercise Preview 12:37

Typecasting in 'C' Preview 07:45

Typecasting in 'C' contd Preview 01:39

Embedded - 'Hello World' Preview 14:06

Testing printf over ARM Cortex M4 ITM+SWO line Preview 08:12

Issues with IDE Preview 03:52

Testing printf over OpenOCD semihosting Preview 05:59

Run Sizeof on Embedded Target Preview 01:19

Sizeof testing Preview 04:38

Compiler settings on STM32CubeIDE Preview 04:46

Embedded project build process Preview 08:38

What is a Microcontroller ? Preview 13:38

Code memory of the microcontroller Preview 04:02

Code and Data of the program using memory browser Preview 09:32

Analyzing ELF file using GNU tools Preview 12:08

Disassembly Preview 09:22

IDE option for Instruction level debugging Preview 01:00

Manipulating decimal numbers in 'C' Preview 02:29

Single vs double precision Preview 03:39

Working with float and double variables Preview 06:32

Scanf introduction Preview 03:54

Scanf exercise implementation Preview 12:46

Scanf exercise implementation contd. Preview 03:51

Scanf exercise Preview 01:00

Scanf exercise implementation Preview 02:54

Scanf and float with scientific notation Preview 02:45

Pointers in 'C' Preview 02:56

Pointer variables and pointer data types Preview 06:22

Pointer variables and initialization Preview 05:16

Read and Write operation on pointers Preview 03:52

Pointer exercise implementation Preview 06:34

Significance of pointer data types Preview 08:17

Significance of pointer data types Preview 09:43

Operators in 'C' Preview 10:06

Unary operator in 'C' Preview 04:26

Unary operators with pointers Preview 01:42

Relational operators in 'C' Preview 03:48

Logical operators in 'C' Preview 05:58

'if' statement Preview 09:17

if statement exercise Preview 00:07

'if' statement exercise solution Preview 04:30

'if' and 'else' Preview 03:21

'if' and 'else' exercise implementation part-1 Preview 04:55

'if' and 'else' exercise implementation part-2 Preview 04:10

'if' and 'else' exercise implementation part-3 Preview 04:57

'if -else-if' ladder statements Preview 02:14

'if-else-if' ladder exercise Preview 01:10

'if-else-if' ladder exercise solution Preview 08:55

Conditional operator Preview 06:43

switch case statement in 'C' Preview 04:44

switch case exercise Preview 01:59

switch case exercise solution Preview 07:38

switch case exercise solution contd. Preview 02:55

Bitwise operators in 'C' Preview 05:51

Bitwise AND and bitwise OR Preview 01:05

Applicability of bitwise operators : Testing of bits Preview 04:25

Finding a number even or odd using testing of bits Preview 01:44

Applicability of bitwise operators : Setting of bits Preview 02:20

Applicability of bitwise operators : Clearing of bits Preview 04:03

Applicability of bitwise operators : xor Preview 02:35

Coding to Turn on an LED Preview 05:27

Controlling IO pin using software Preview 01:42

Processor addressable memory regions Preview 05:46

STM32 memory map Preview 03:56

Memory mapped peripheral registers and IO access Preview 05:35

Procedure to turn ON the LED Preview 02:47

Enabling peripheral clock Preview 05:51

Calculating peripheral register addresses Preview 04:19

LED ON exercise coding Preview 16:06

Bitwise right shift operator Preview 03:52

Bitwise left shift operator Preview 03:17

Applicability of bitwise shift operators Preview 04:17

Modifying LED on exercise using bitwise shift operators Preview 02:28

Bit Extraction Preview 03:08

Looping in 'C' Preview 01:10

While loop Preview 02:52

while loop exercise Preview 02:12

while loop and semicolon Preview 03:31

while loop exercise Preview 05:49

'do while' loop Preview 03:04

'for' loop Preview 04:14

'for' loop exercise Preview 03:53

'for' loop number pyramid exercise Preview 01:31

'for' loop exercise solution Preview 03:44

modifying LED on with software delay Preview 01:44

LED toggle using software delay Preview 06:34

'const' type qualifier Preview 08:02

placements of 'const' variables in memory Preview 03:14

'const' usage and different case studies Preview 05:15

'const' usage and different case studies contd Preview 04:09

IO pin read exercise Preview 03:11

IO pin read exercise implementation Preview 09:38

Compiler optimization and flags Preview 03:58

Different compiler optimization levels Preview 03:48

Analyzing pin read exercise disassembly with O0 and O2 Preview 06:44

volatile and effect of optimization Preview 06:15

When to use volatile qualifier ? Preview 04:07

Using volatile to fix issues with the pin-read exercise Preview 02:42

Using 'volatile' with ISR Part-1 Preview 04:30

Using 'volatile' with ISR Part-2 Preview 03:25

Usage of const and volatile together Preview 04:16

Introduction to structures Preview 03:42

Accessing structure member elements Preview 09:09

Sizeof of a structure Preview 02:43

Aligned and un-aligned data storage Preview 01:59

Structure padding Preview 09:44

Calculating structure size manually with and without padding Preview 03:05

Assembly code analysis of packed and non packed structure Preview 05:39

Typedef and structure Preview 06:02

Structures and pointers Preview 10:43

Structure exercise Preview 01:59

Structure exercise implementation Preview 07:25

Structure and bit fields Preview 07:22

Structure and bit fields contd. Preview 02:24

Bit-field exercise : Creating bit-field structure for peripheral registers Preview 10:20

Bit-field structure for RCC_AHB1ENR Preview 00:58

Bit-field structure for GPIOx_ODR Preview 01:30

Modifying led toggle exercise with structures and bit fields Preview 07:26

Testing Preview 01:30

Keypad interfacing Preview 04:52

Why pull-up resistors? Preview 04:44

Detecting key press event Preview 02:43

Flow chart for implementation Preview 07:37

Keypad key read code implementation Preview 11:58

Delay analysis Preview 04:38

Arrays in 'C' Preview 06:23

Read-Write operation on an array Preview 14:36

Passing array to a function Preview 07:36

Swapping of arrays Preview 08:54

Swapping of arrays contd. Preview 02:14

Strings in 'C' Preview 09:41

String literal Preview 05:21

String variable Vs string literal Preview 18:49

Inputting a string Preview 04:33

Scanf and scanset Preview 06:58

Exercise Preview 16:28

Pre-Processor directives in 'C' Preview 13:39

Conditional compilation directives Preview 13:15

'defined' operator Preview 05:15

Modifying led toggle exercise with macros Preview 05:04

BONUS LECTURE Preview 01:34