Day 2 Walking in Circles

The Plan

It is funny how many stories of expeditions gone wrong culminate with a revealing moment where the explorers realize they got desperately lost and have been walking in circles for a while. In embedded-control programming it’s the opposite: Our programs need a framework, a structure so that the flow of code can be managed, and this usually is built around one main loop.

Today we will review the basics of the loops syntax in C, and we’ll also take the opportunity to introduce a first peripheral module: the 16-bit Timer1. Two new MPLAB© SIM features will be used for the first time: the Animate mode and the Logic Analyzer view.

Preparation

For this second lesson, we will need the same basic software components ...

Get Programming 32-bit Microcontrollers in C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.