Why do you need external interrupt?

Thread Starter

Djsarakar

Joined Jul 26, 2020
214
Hi,
I know what are external interrupt but i dont know when the really needs in project. I want to design a system that really needs external interrupt.

For this I started searching project's on the internet. I have read many old threads but At most, I get information only for leds and buttons. I have not yet seen such a project that will show that interrupt really needed in this project.

I was very struggling in my last thread because I had chosen a difficult example for myself. So my first objective is that I should have a well define Problem Statement. I am looking help to develop well define problem statement that show external interrupt really needed in the project
 
Last edited:

jpanhalt

Joined Jan 18, 2008
10,087
That a very broad question. An external interrupt is "needed" for the same reasons an internal interrupt is needed but for a source that is external. External means not part of the MCU physically.

Please list 3 external interrupts that you know about so the reasons can be discussed in more specific terms. Alternatively, here's one device that can produce external interrupts (DRDY and FAULT): https://datasheets.maximintegrated.com/en/ds/MAX31856.pdf

Why do you think a designer might utilize one or both based on your extensive Google research to date?
 

Thread Starter

Djsarakar

Joined Jul 26, 2020
214
Please list 3 external interrupts that you know about so the reasons can be discussed in more specific terms.
Fire alarm in bus system
The bus's electronic system has a lot of input and output devices. It has a fire sensor when it detects fire in bus, system should be ring buzzer. if we write a sequence code for the bus then the system will be slow so we need to do external interrupt for smoke sensor

Industrial applications Emergency stop button : when the system is doing thousand tasks but suddenly any fault or error detect in the system, System should be shut down quickly ,thus it requires external interrupt for emergency button
 

trebla

Joined Jun 29, 2019
184
The button is only for example, instead button man can use various incoming digital signals to change program flow or external watcdog for MCU resetting. Some cases using the external interrupt simplifies program structure but makes debugging harder. It depends from application nature.

Edit: You can use button polling routine instead of external interrupt but if your polling routine is waiting for some other routines processing end, to it may take too much time to recognize a button press.
 
Last edited:

AlbertHall

Joined Jun 4, 2014
10,234
I have a flink magic clock this uses a 'wand' with LEDs on it which it waggles backwards and forwards and lights the LEDs in the correct sequence to form a display. As the display is produced whichever way the wand is swinging, synchronising the display with the movement of the wand is critical so each character is displayed in exactly the same place whether the wand is moving left to right or right to left.

It does this by the wand breaking an IR beam. The signal from that is connected to an external interrupt so the software timing is accurately linked to the wand movement.
It also times the pulses to coils which keep the wand swiging.

1597057076457.png
 

jpanhalt

Joined Jan 18, 2008
10,087
Fire alarm in bus system
The bus's electronic system has a lot of input and output devices. It has a fire sensor when it detects fire in bus, system should be ring buzzer. if we write a sequence code for the bus then the system will be slow so we need to do external interrupt for smoke sensor

Industrial applications Emergency stop button : when the system is doing thousand tasks but suddenly any fault or error detect in the system, System should be shut down quickly ,thus it requires external interrupt for emergency button
Those seem to be good reasons that you already understood.

Why did you ask the question?
 

Thread Starter

Djsarakar

Joined Jul 26, 2020
214
OK, in you fire alarm example, why would you chose an interrupt instead of polling the sensors?
That was my question?

As a designer I would always think my system should to be fast and efficient. Bus system is doing multitasking. When there are multiple tasks to do, CPU will execute task one by one in sequence.

assuming there are 2000 tasks to complete in program and at 60th task is fire detection, When fire detect open emergency window.

When the system start, it will start to execute from task 1. suppose CPU is doing the task 12 and there is smoke in the bus it will not directly jump to 60.

In the polling method , CPU just waste the time that reason interrupt should use

Do we really need external intererupt in this case?

This is my understanding of how interrupt would be used. I have no idea how interrupt use in a big project.
 
Last edited:

trebla

Joined Jun 29, 2019
184
Imagine situaton if fire started inside bus and CPU is doing task 61 and then fire alarm polling task is by 999 tasks away. And maybe some task is struggling to communicate with remote server and delaying fire alarm polling even more.
 

jpanhalt

Joined Jan 18, 2008
10,087

Analog Ground

Joined Apr 24, 2019
416
I have combined a microcontroller with an FPGA many times to get the best of both technologies. The external interrupt of the microcontroller was a good way for the FPGA to wake up or get the attention of the microcontroller for critical, time sensitive events. For example, in one project, the FPGA was monitoring the current consumption of a sensor array. If the current exceeded a threshold, the FPGA notified the microcontroller with an external interrupt and the microcontroller than communicated with a server PC.
 
Top