EasyManuals Logo

Texas Instruments MSP430 Student Guide

Texas Instruments MSP430
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #222 background imageLoading...
Page #222 background image
Interrupts and TI-RTOS Scheduling
We also discussed the idea of foreground and background threads as part of the interrupts
chapter. In the case shown below (on the left), the endless loop in main() will run forever and be
pre-empted by higher-priority hardware interrupts.
main() {
init code
}
while(1) {
nonRT Fxn
}
H/W ISR
get data
process
printf()
Foreground / Background Scheduling
RTOS Scheduler
Idle
nonRT
+ instrumentation
Idle events run in sequence when no Hwi’s are posted
Hwi is ISR with automatic vector table generation + context save/restore
Hwi performs “process” typical use is to perform HRT need, then post
“follow-up activity”
main() {
init
BIOS_start()
}
Hwi
get data
process
LOG_info1()
TI-RTOS utilizes these same concepts … only the names and threads change a little bit.
Rather than main() containing both the setup and loop code as described earlier, TI-RTOS
creates an Idle thread that operates in place of the while{} loop found previously in main(). In
other words, rather than adding your functions to a while{} loop, TI-RTOS has you add them to
Idle. (TI-RTOS includes a GUI configuration tool that makes this very easy to do.)
Since interrupts are part of the MSP430’s hardware, they essentially work the same way when
using TI-RTOS. What changes when using RTOS are:
TI-RTOS calls them Hwi threads … for Hardware Interrupts
Much of the coding effort is handled automatically for you by TI-RTOS (very nice)
Don’t worry, though, you’re not locked into anything. You can mix-and-match how you handle
interrupts. Let TI-RTOS manage some of your interrupts while handling others in your own code,
just as we described in this chapter.
Hint: When using TI-RTOS, the author prefers to let it manage all of the interrupts because its
easier that way. Only
Only in a rare caselike to save a few CPU cycles would there be a need to managed
an interrupt outside of TI-RTOS. Thusfar, the only reason Ive actually done this is to
provde that it works.
5 - 32 MSP430 Workshop - Interrupts

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals