Skip to Content
Programming Embedded Systems in C and C++
book

Programming Embedded Systems in C and C++

by Michael Barr
January 1999
Beginner to intermediate
200 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Programming Embedded Systems in C and C++
Learn How to Communicate 49
opcode—to put aside the processor’s current work and transfer control to the
interrupt service routine. Many of the processor’s registers must be saved in mem-
ory, and lower-priority interrupts must be disabled. So in practice both methods
are used frequently. Interrupts are used when efficiency is paramount or multiple
devices must be monitored simultaneously. Polling is used when the processor
must respond to some event more quickly than is possible using interrupts.
Interrupt Map
Most embedded systems have only a handful of interrupts. Associated with each of
these are an interrupt pin (on the outside of the processor chip) and an ISR. In
order for the processor to execute the correct ISR, a mapping must exist between
interrupt pins and ISRs. This mapping usually takes the form of an interrupt vec-
tor table. The vector table is usually just an array of pointers to functions, located
at some known memory address. The processor uses the interrupt type (a unique
number associated with each interrupt pin) as its index into this array. The value
stored at that location in the vector table is usually just the address of the ISR to be
executed.
*
It is important to initialize the interrupt vector table correctly. (If it is done incorrectly,
the ISR might be executed in response to the wrong interrupt or never executed at
all.) The first part of this process is to create ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

You might also like

Embedded Systems Object-Oriented Programming in C and C++

Embedded Systems Object-Oriented Programming in C and C++

Israel Gbati

Publisher Resources

ISBN: 1565923545Catalog PageErrata