Book 006 LaMeres Emb Sys Design CoverNtoc
Book 006 LaMeres Emb Sys Design CoverNtoc
ADDITIONAL RESOURCES
Supporting videos will be posted to the author’s YouTube channel, which can be found at:
https://www.youtube.com/c/DigitalLogicProgramming_LaMeres. This channel contains many other
videos beyond embedded systems to help people learn digital logic, basic programming, and
robotics. Subscribe to this channel in order to be notified when new videos for this book are posted.
9.1.7 Using Literal Definitions from the MSP430.H Header File ............................. 228
9.2 DIGITAL OUTPUT PROGRAMMING .............................................................................. 228
9.3 DIGITAL INPUT PROGRAMMING.................................................................................. 231
SUMMARY ..................................................................................................................... 235
EXERCISE PROBLEMS .................................................................................................... 236
CHAPTER 10: THE STACK AND SUBROUTINES ....................................................... 237
10.1 THE STACK .......................................................................................................... 237
10.2 SUBROUTINES........................................................................................................ 241
SUMMARY ..................................................................................................................... 243
EXERCISE PROBLEMS .................................................................................................... 243
CHAPTER 11: INTRODUCTION TO INTERRUPTS ...................................................... 245
11.1 THE CONCEPT OF AN INTERRUPT ............................................................................ 245
11.1.1 Interrupt Flags (IFG) ..................................................................................... 245
11.1.2 Interrupt Priority and Enabling ...................................................................... 246
11.1.3 Interrupt Vectors ........................................................................................... 248
11.1.4 Operation of the STACK during an IRQ ....................................................... 249
11.1.5 Interrupt Service Routines (ISR) ................................................................... 250
11.1.6 Nested Interrupts .......................................................................................... 250
11.1.7 Interrupt Servicing Summary ........................................................................ 251
11.1.8 MSP430FR2355 Interrupts ........................................................................... 252
11.2 MSP430FR2355 PORT INTERRUPTS ..................................................................... 254
SUMMARY ..................................................................................................................... 259
EXERCISE PROBLEMS .................................................................................................... 260
CHAPTER 12: INTRODUCTION TO TIMERS ............................................................... 261
12.1 TIMER OVERVIEW .................................................................................................. 261
12.2 TIMER OVERFLOWS ON THE MSP430FR2355 ........................................................ 266
12.3 TIMER COMPARES ON THE MSP430FR2355 .......................................................... 277
12.4 CREATING PULSE WIDTH MODULATED SIGNALS USING TIMER COMPARES ................ 281
12.5 TIMER CAPTURES ON THE MSP430FR2355 ........................................................... 285
SUMMARY ..................................................................................................................... 285
EXERCISE PROBLEMS .................................................................................................... 286
CHAPTER 13: SWITCHING TO THE C LANGUAGE ................................................... 289
13.1 C CONSTRUCTS ON THE MSP430 .......................................................................... 289
13.1.1 While() Loops in C ........................................................................................ 290
13.1.2 For() Loops in C ............................................................................................ 292
13.1.3 If/Else Statements in C ................................................................................. 293
13.1.4 Switch/Case Statements in C ....................................................................... 293
13.1.5 Arithmetic Operators in C ............................................................................. 294
13.1.6 Bitwise Logic Operators in C ........................................................................ 295
13.2 DIGITAL I/O IN C .................................................................................................... 298
13.3 INTERRUPTS IN C ................................................................................................... 301
13.4 TIMERS IN C .......................................................................................................... 304
SUMMARY ..................................................................................................................... 311
EXERCISE PROBLEMS .................................................................................................... 312
viii • Table of Contents