1
00:00:01,280 --> 00:00:01,680
Hello.

2
00:00:01,700 --> 00:00:02,410
Welcome back.

3
00:00:02,420 --> 00:00:06,980
In this lesson we shall give a brief overview of interrupt programming.

4
00:00:06,980 --> 00:00:11,420
A single microprocessor can save several devices.

5
00:00:11,420 --> 00:00:13,850
There are two ways to do this.

6
00:00:13,880 --> 00:00:21,540
We can either use interrupt or pull in method in the interrupt method whenever any device needs servers.

7
00:00:21,590 --> 00:00:26,640
The device notifies DCP by sending it an interrupt signal.

8
00:00:26,780 --> 00:00:28,810
Receive an uninterrupted signal.

9
00:00:28,850 --> 00:00:33,970
The CPD you interrupt whatever it is doing and serves the device.

10
00:00:34,040 --> 00:00:41,750
The program associated with the interrupt is called the interrupt service routine or the ISI or the

11
00:00:41,750 --> 00:00:45,390
interrupt handler in pulling the seat.

12
00:00:45,390 --> 00:00:51,590
You continuously monitors the status of a given device when the status condition is met.

13
00:00:51,590 --> 00:00:53,690
The CPSU performs the service.

14
00:00:53,690 --> 00:01:00,000
After that the CPM moves to monitor the next device until each one is serviced.

15
00:01:00,000 --> 00:01:08,270
Poland is often characterized by things like if conditions or do polling can monitor the status of several

16
00:01:08,270 --> 00:01:13,790
devices and serve each of them assets and conditions are met.

17
00:01:13,790 --> 00:01:17,390
It is not an efficient use of the time.

18
00:01:17,510 --> 00:01:25,190
The pooling method wastes much of the CPE use time by pooling devices that do not need service.

19
00:01:25,280 --> 00:01:32,940
So in order to avoid tying down to sleep you interrupt are used for instance in a timer.

20
00:01:32,960 --> 00:01:39,850
We might wait until a determined amount of time elapses and while waiting.

21
00:01:39,890 --> 00:01:42,430
We cannot do anything else.

22
00:01:42,470 --> 00:01:49,160
This is a waste of the CPS time that could have been used to perform some useful tasks.

23
00:01:49,160 --> 00:01:56,330
On the other hand if we use the interrupt method the CPR you can go about doing other tasks and when

24
00:01:56,330 --> 00:02:04,250
the count flag is raised the timer will interrupt the CPE you to let him know that the time is elapsed.

25
00:02:04,370 --> 00:02:10,650
Like I mentioned earlier for every interrupt there must be a program associated with it.

26
00:02:10,820 --> 00:02:17,900
When an interrupt occurs this program is executed to perform a certain service for the interrupt this

27
00:02:17,900 --> 00:02:25,370
program is commonly referred to as the interrupt service routine or the IRS are or the interrupt handler

28
00:02:26,030 --> 00:02:28,290
as we can see in this arrangement.

29
00:02:28,430 --> 00:02:35,870
In the process or there are pieces that are associated with the hardware interrupt I are cute over here

30
00:02:36,350 --> 00:02:37,850
stands for interrupt.

31
00:02:37,850 --> 00:02:50,320
So we have IQ zero IQ so we have IQ zero IQ one all the way through IQ and these are input signals into

32
00:02:50,320 --> 00:02:59,140
the CPI you when the signals are triggered the CPI pushes the program counter register or the P.C. onto

33
00:02:59,140 --> 00:03:04,960
the stock and loads the program counter register with the address of the interrupt service routine.

34
00:03:04,960 --> 00:03:12,320
This causes the interrupt service routine to be executed this table over here shows what is known as

35
00:03:12,320 --> 00:03:18,980
the interrupt effect or on the left we've got the one for cortex M0 plus and on the right we've got

36
00:03:18,980 --> 00:03:27,770
the ones for the one for cortex and for an M M7 this image is taken from the generic user guide and

37
00:03:27,770 --> 00:03:33,880
we can find a similar table in or cortex and microcontroller data sheet.

38
00:03:33,980 --> 00:03:36,870
The first column here says exception no.

39
00:03:36,890 --> 00:03:39,080
The next column says the interrupt.

40
00:03:39,090 --> 00:03:39,690
No.

41
00:03:39,740 --> 00:03:46,380
The third column says the offset and the fourth column sees the effect all you can think of the effect

42
00:03:46,380 --> 00:03:53,050
or us the name of the interrupt as we can tell from the offset for every interrupt.

43
00:03:53,060 --> 00:03:58,160
There are four byte of memory allocated in the interrupt vector table.

44
00:03:58,160 --> 00:04:04,910
These four memory locations provide the addresses of the interrupt service routine for which the interrupt

45
00:04:04,910 --> 00:04:12,160
was invoked the end Vic is known as the nested effect or interrupt controller.

46
00:04:12,300 --> 00:04:19,110
The end Vic of the cortex M has room for a total of two hundred and fifty five interrupt and exceptions

47
00:04:19,450 --> 00:04:26,200
the end of the can and cortex and assigns the first fifteen interrupt for internal use.

48
00:04:26,220 --> 00:04:34,820
Now let's take a look at interrupt prioritise in the cortex in the Reset.

49
00:04:34,940 --> 00:04:37,520
And then my in hard fought exceptions.

50
00:04:37,520 --> 00:04:47,370
How fixed priority levels are set by itself and cannot be changed among the reset and in my end hard

51
00:04:47,370 --> 00:04:52,400
fought the reset has the highest priority which is minus 3.

52
00:04:52,590 --> 00:04:56,370
The lower the number the higher the priority.

53
00:04:56,370 --> 00:05:05,340
For instance if Booth and my and a different interrupt which is not reset are activated at the same

54
00:05:05,340 --> 00:05:14,170
time the enemy is responded to first since the enemy has a higher priority than other interrupt requests.

55
00:05:14,290 --> 00:05:21,840
Apart from the reset interrupts request the rest of the exceptions and interrupts request help lower

56
00:05:21,840 --> 00:05:31,880
priorities and configurable meaning priority levels can be set by We The program is programmable priority

57
00:05:31,880 --> 00:05:40,910
levels are values between 0 and 7 with 7 as the lowest priority that we can set and 0 as the highest

58
00:05:40,910 --> 00:05:43,650
priority that we can set.

59
00:05:43,890 --> 00:05:45,770
So this order is for this very short.

60
00:05:45,780 --> 00:05:53,040
Both of you on interrupt you have any questions just let me know and I shall see you in the next lesson.
