Programming: Introduction

The beauty of the microcontroller is that it can be programmed to fit different roles. We can program the microcontroller to act as a thermometer that senses the ambient temperature and displays the recorded temperature. Or we can program it to play a small game using the screen and joystick. To tailor the microcontroller for our need, we develop software for it. We accomplish this by writing code. Different coding languages suit different needs. Higher-level coding languages like Java, C++, and Python work at a higher abstraction level, where the strict details of how the computer processes and executes the code are hidden. Lower-end languages, by contrast, deal more closely with specifics of the machine they are using. For this course, we will be using Embedded C to program the MSP432. Embedded C is considered a high-level language. However, it is more lightweight and less sophisticated than C++ or Java. Understanding the differences between C and C++ may require a deeper understanding of the programming styles and memory management that is beyond the scope of this course.

To develop readable high-quality programs, we need to review several programming concepts that you might have seen before. These topics are covered under this section. They include use of macros, enum, and typedef; using pointers, using structures; using static variables; and working with ASCII code.Â