Beyond Arduino C For Embedded Applications

Learn how to write better code for your embedded hardware or IoT projects like professionals, not beginners, do.

Last updated 2022-01-10 | 4

- Create professional grade embedded applications.
- Produce embedded applications employing THE most widely used programming language ever.
- Benefit from a wide variety of C compiler and preprocessor tricks to help you make better embedded applications.

What you'll learn

Create professional grade embedded applications.
Produce embedded applications employing THE most widely used programming language ever.
Benefit from a wide variety of C compiler and preprocessor tricks to help you make better embedded applications.

* Requirements

* You should know Basic Microcontroller Programming. This course assumes you know how to program
* so general good programming practices are assumed and not enforced in this course (meaningful variable names
* commenting your code
* indentation
* etc.)
* You should at least be familiar with the C Programming Language (Good news
* just so you know: The Arduino uses C).

Description

In this fourth part of the Beyond Arduino series, you'll learn many techniques to produce more efficient and professional embedded applications. It's time to leave the toy programs behind.

You'll learn how to handle memory-attached hardware registers properly, how to perform bitwise manipulation of data, how to handle interrupts on your microcontroller development platform, and many other techniques which you aren't always aware of because of the immense body of elements that conceal the details in many beginner platforms, like the Arduino, for the sake of simplicity.

You'll also learn how to deal with very basic, typically 8-bit, microcontrollers that don't have a Floating Point Unit and still write code that gets the job done in the best way possible even with the limited resources available. 

After grasping this knowledge, we expect you to think differently when designing your embedded applications in the future. By adding these best practices to your bag of tricks, you'll get one step closer to making embedded applications like a professional, and hopefully you'll feel less like a beginner.

Who this course is for:

  • Arduino Developers.
  • Software Developers.
  • Makers.

Course content

8 sections • 131 lectures

Course Structure Preview 03:13

Instructor Introduction Preview 01:30

Motivation #1 Preview 04:52

Motivation #2 Preview 03:39

What's with the C/C++ thing? Preview 03:06

Introduction Preview 04:14

Characteristics of C Preview 01:36

C is a Compiled Programming Language Preview 03:37

C vs. Java Preview 04:18

Syntax Preview 02:51

Hello World Preview 01:38

Variables and Arithmetic Preview 02:30

If-Then-Else Statements Preview 01:43

Case Statements Preview 01:45

Loops Preview 03:21

Supported Data Types Preview 01:39

Different Sizes of int - Arduino Preview 03:14

Different Sizes of int - Keil Preview 02:55

Different Sizes of int - CodeWarrior Preview 02:46

Chars aren't characters Preview 02:38

No Strings in C Preview 00:33

Character Arrays Preview 01:53

No Booleans Either Preview 01:07

Arrays Preview 01:26

Pointers Preview 01:03

Pointers Example Code Preview 03:44

Pointers can be Indexed and Arrays Indirected Preview 04:30

Fun with Pointers

Functions Preview 01:18

Functions Example Code Preview 03:20

Passing Parameters by Value or Reference Preview 00:36

Example of Pointers and Parameters Preview 03:06

The C Preprocessor Preview 02:56

Defining Constants Preview 05:36

#define vs const Preview 03:50

Which is Better? Preview 01:09

Conditional Inclusion of Code Preview 04:22

Conditional Inclusion of Code Example Preview 02:35

Embedded Debugging with a Knife in the Woods Preview 01:15

The #else Directive Preview 01:43

Wikipedia Example Preview 01:39

Live Demo: Conditional Inclusion of Code Preview 05:29

Include Guards Preview 03:16

Key Ideas Preview 01:01

The C Compiler Preview 01:50

Use Portable Data Types Preview 04:50

First, a Thought Experiment Preview 01:40

The Answers Preview 01:02

Reason #1: Multiprocessors Preview 03:11

Reason #2: Multithreading Preview 02:00

Reason #3: Hardware-Attached Variables Preview 03:33

Reason #4: Interrupts Preview 02:30

The volatile Qualifier Preview 02:36

volatile Demo in Codewarrior Preview 06:11

Time Consuming Blocking Delays Preview 04:01

Example: Blocking Delays Preview 01:08

LPC1114 Tutorial Preview 05:59

The KEIL Project Preview 01:08

The delay() Function Preview 05:13

The Rest of the Code Preview 02:24

The main() Function Preview 02:59

The walk() Function Preview 01:33

Remember the const Qualifier Preview 02:46

Bit Manipulation Preview 00:52

Bit Masking Preview 01:49

The trick: Binary Masks Preview 00:54

How to Set a Bit Preview 02:35

How to Clear a Bit Preview 02:19

Setting and Clearing Multiple Bits Preview 02:11

A Real Microcontroller Example Preview 02:05

Setting and clearing select bits Preview 03:26

Reacting to Select Bits Preview 02:44

Reacting to Select bits Preview 01:03

Inverting Select Bits Preview 03:43

Inverting Select Bits Preview 00:42

A Meaningful Code Example Preview 00:48

Implementation Tips Preview 04:00

More Clever ways to access bits Preview 02:39

A Code Example Preview 03:47

Bit Masking Demo in Arduino Preview 06:23

Set and Clear bits here and there

Toggle a bit

Bit Fields Preview 01:17

Bit Fields Demo in Dev C++ Preview 08:14

Bit Fields Demo in CodeWarrior Preview 05:48

Bit Fields in Libraries Preview 10:03

Key Ideas Preview 01:44

Alternatives to Functions Preview 01:01

Lookup Tables Preview 01:38

Lookup Table Definition Preview 01:04

Lookup Tables Example Code Preview 05:04

Lookup Tables Caveats Preview 04:04

Lookup Tables Demo in Arduino Preview 08:47

Lookup Tables in ROM or RAM Preview 03:04

Tradeoff between Lookup Tables and Traditional Functions Preview 02:05

Macro Functions Preview 02:26

Points for the Macro Function Preview 01:16

Points for the Traditional Function Preview 03:24

Macro Functions Preview 01:48

Function Inlining Preview 01:13

Inline Functions Preview 01:15

Forcing vs. Suggesting Preview 01:47

Macros vs Inline Functions Preview 00:45

Key Ideas Preview 00:42

What to do Without a Floating Point Unit Preview 01:04

About Floating Point Numbers Preview 02:44

Floating Point Number Formats Preview 02:40

Binary 32 Floating Point Format - IEEE 754 Preview 05:29

Floats are Not Perfect Preview 01:40

Some Numbers are Impossible to Represent as floats Preview 01:47

Floating Point Types in C Preview 02:36

About FPUs Preview 01:32

How FPU-less microcontrollers manage without an FPU Preview 02:25

Software Implementations of Floats Preview 02:42

Float Inaccuracies Preview 02:04

Inaccuracies Demo in Dev C++ Preview 08:45

Fixed Point Numbers Preview 03:51

Powers of 2 Scaling Factors Preview 04:16

Fixed Point Math Preview 02:52

Standardized Fixed Point Formats Preview 02:07

Fixed Point is a Real Option Preview 00:48

A Fixed Point Library Preview 03:21

Fixed vs. Floating Point Demo in Arduino Preview 07:41

A Very Clever Fixed Point Trick Preview 01:57

Just Integers Preview 04:01

Wait! Having an FPU isn't a Silver Bullet Preview 01:57

Key Ideas Preview 01:25

Think of All the Things we Learned Preview 01:10

What's Next? Preview 02:35

Farewell Preview 00:33

Bonus Lecture: LabsLand and more from Closure Labs! Preview 01:16