Академический Документы
Профессиональный Документы
Культура Документы
6/25/15
INTRODUCTION
An interrupt -signal to the microprocessor
from a device -attention.
An interrupt -event that stops the current
process -CPU -attend to the task needing
completion.
Polling-based program (non-interrupt driven)
continuously polls or tests whether data
-ready -received or transmitted.
6/25/15
INTERRUPTS
Whenever any device needs its service,
-notifies the microcontroller by sending
-interrupt signal.
The microcontroller interrupts whatever it is
doing and serves the device.
The program associated with the interrupt is
-Interrupt service routine (ISR) or interrupt
handler.
6/25/15
SYNTAX
ISR(interrupt_vector_name )
{
// Code for interrupt handler
}
6/25/15
6/25/15
POLLING
The microcontroller continuously monitors
the status of a given device- status condition
is met, it performs the service.
After that, it moves on to monitor the next
device until each one is serviced.
Polling can monitor the status of several
devices and serve -as certain conditions are
met -not -efficient -use -microcontroller.
6/25/15
6/25/15
SYNTAX
While(1)
{
get device status
if(service required)
{
service_routine ;
}
normal_execution;
}
6/25/15
10
INTERRUPTS
Interrupts signal is sent
microprocessor
whenever
POLLING
to Microprocessor
continuously
Priority based execution i.e. when Not priority based execution since it
its service is required by many checks all devices in a round robin
devices it provides service based on fashion.
priority.
Microcontroller can ignore a device Microcontroller
request for its service.
6/25/15
cannot
ignore
11
time
since
it microcontrollers
time
by
polling
and unstructured.
uses
power.
code
leads
to
variable
PURPOSE OF
INTERRUPTS
Coordinating
I/O operations
Notifies the CPU that an input is ready or an
output can be changed
Timing
Periodic (clock-driven) interrupts remind the
CPU of the passage of time
Multi-tasking
Updating counters
Timing during interactive programs
6/25/15
13
Errors
Interrupts can notify error situations
Practical uses/examples
Change direction of a motor.
Auto wiper speed increased or decreased.
Pressing a pause button on a VCR
6/25/15
14
THANK YOU
6/25/15
15