Hello.
Welcome back.
In this lesson we shall give a brief overview of interrupt programming.
A single microprocessor can save several devices.
There are two ways to do this.
We can either use interrupt or pull in method in the interrupt method whenever any device needs servers.
The device notifies DCP by sending it an interrupt signal.
Receive an uninterrupted signal.
The CPD you interrupt whatever it is doing and serves the device.
The program associated with the interrupt is called the interrupt service routine or the ISI or the
interrupt handler in pulling the seat.
You continuously monitors the status of a given device when the status condition is met.
The CPSU performs the service.
After that the CPM moves to monitor the next device until each one is serviced.
Poland is often characterized by things like if conditions or do polling can monitor the status of several
devices and serve each of them assets and conditions are met.
It is not an efficient use of the time.
The pooling method wastes much of the CPE use time by pooling devices that do not need service.
So in order to avoid tying down to sleep you interrupt are used for instance in a timer.
We might wait until a determined amount of time elapses and while waiting.
We cannot do anything else.
This is a waste of the CPS time that could have been used to perform some useful tasks.
On the other hand if we use the interrupt method the CPR you can go about doing other tasks and when
the count flag is raised the timer will interrupt the CPE you to let him know that the time is elapsed.
Like I mentioned earlier for every interrupt there must be a program associated with it.
When an interrupt occurs this program is executed to perform a certain service for the interrupt this
program is commonly referred to as the interrupt service routine or the IRS are or the interrupt handler
as we can see in this arrangement.
In the process or there are pieces that are associated with the hardware interrupt I are cute over here
stands for interrupt.
So we have IQ zero IQ so we have IQ zero IQ one all the way through IQ and these are input signals into
the CPI you when the signals are triggered the CPI pushes the program counter register or the P.C. onto
the stock and loads the program counter register with the address of the interrupt service routine.
This causes the interrupt service routine to be executed this table over here shows what is known as
the interrupt effect or on the left we've got the one for cortex M0 plus and on the right we've got
the ones for the one for cortex and for an M M7 this image is taken from the generic user guide and
we can find a similar table in or cortex and microcontroller data sheet.
The first column here says exception no.
The next column says the interrupt.
No.
The third column says the offset and the fourth column sees the effect all you can think of the effect
or us the name of the interrupt as we can tell from the offset for every interrupt.
There are four byte of memory allocated in the interrupt vector table.
These four memory locations provide the addresses of the interrupt service routine for which the interrupt
was invoked the end Vic is known as the nested effect or interrupt controller.
The end Vic of the cortex M has room for a total of two hundred and fifty five interrupt and exceptions
the end of the can and cortex and assigns the first fifteen interrupt for internal use.
Now let's take a look at interrupt prioritise in the cortex in the Reset.
And then my in hard fought exceptions.
How fixed priority levels are set by itself and cannot be changed among the reset and in my end hard
fought the reset has the highest priority which is minus 3.
The lower the number the higher the priority.
For instance if Booth and my and a different interrupt which is not reset are activated at the same
time the enemy is responded to first since the enemy has a higher priority than other interrupt requests.
Apart from the reset interrupts request the rest of the exceptions and interrupts request help lower
priorities and configurable meaning priority levels can be set by We The program is programmable priority
levels are values between 0 and 7 with 7 as the lowest priority that we can set and 0 as the highest
priority that we can set.
So this order is for this very short.
Both of you on interrupt you have any questions just let me know and I shall see you in the next lesson.