Non-Vectored: Here all the interrupts have common ISR. Here the address of the ISR is fixed and the control is transferred to that address and the ISR takes care of the rest. Vectored: In this case, devices that interrupt provide us with the source of the interrupt by passing the interrupt vector address. Vectored Interrupts and Non-Vectored Interrupts: The external port interrupts used here come under this category. They also depend on peripherals and their functions. When an interrupt occurs and if it can be masked by a CPU instruction, then it is Maskable Interrupt. This is generated by sources like Oscillator faults and an edge manually given to the RST/NMI (in NMI mode). Once the General Interrupt is enabled, the non-maskable interrupt cannot be diverted from processing. These interrupts cannot be masked by the CPU instructions. ![]() It can occur due to supply voltage (Vcc) and due to a low signal in RST/NMI pin with Reset mode selected and can also occur due to reasons like watchdog timer overflow and security key violation. The interrupts in MSP430 come under the following types. When it is awakened by an external signal’s edge transition through a GPIO port, the ISR is executed and the CPU again returns back to the Low Power Mode. It can also be used to wake the CPU from Low power modes too. They are called in when the tasks with higher priority are needed to be executed by pre-empting the current running task. Interrupts are needed to save the polling overhead in an embedded system. Also check other MSP430 based tutorials using Energia IDE and CCS by following the link. To know the basics like CCS environment setup for the MSP430G2 launchpad, follow this link getting started with MSP430 using CCS because we will not get into details of that in this tutorial. ![]() In this tutorial, we have used the external interrupts on MSP430 to toggle different LEDs. When an external interrupt is given by the change of state using a push-button, the control is transferred (pre-empted) to the ISR and it does the needful. The interrupt handler can be used to initiate the other peripherals like DMA. Consider a pre-set timer is reset and an interrupt is triggered when the time reaches the value in the timer register. Most times in an Embedded interrupt also facilitates communication between two peripherals of the CPU. Interrupts need not always be external it can be internal too. Here, the system can’t predict your external interrupt to its time keeping processes and can’t ask you to wait since it is busy incrementing the seconds' value on your watch. What would you do? You simply press a button that changes to the menu that enables you to change the time zone. ![]() Consider a simple digital watch which is programmed to just show you time, now imagine you want to change its time zone.
0 Comments
Leave a Reply. |