Interrupt flag shows the result of an interrupt and interrupt enable bit is used to enable or to block the interrupt.In this tutorial we will study about the Polling and especially on the PIC Interrupt.
Many times it is also external systems, located outside the micro itself which are communicating with micro through control lines. An example of such a system is a digital thermometer, which is measure the temperature and at the end of the measurements transmitting the results to the PIC micro. Using this method, the microcontroller accesses at the exact time interval the external device, and gets the required information. The user is the one who determines the time intervals in which micro contacts the device. In the Polling method, the PIC microcontroller must access by himself the device and ask for the information it needs for processing. In fact we see that in the Polling method the external devices are not independent systems; they depend on the microcontroller, and only the micro is entitled to obtain access to the information it needs. The main drawback of this method when writing program is waste of time of microcontroller, which needs to wait and check whether the new information has arrived. Interrupt is the signal sent to the micro to mark the event that. Interrupt is requesting the processor to stop to perform the current program and to make time to execute a special code. In fact, the method of interrupt defines the option to transfer the information generated by internal or external systems inside the micro by them self Once the system has finished the task imposed on it, the processor will be notified that it can access and receive the information and use it. Pic18F4431 Adc Example Pic Ccs Free Itself ToThe request for the microcontroller to free itself to execute the interrupt could come from several sources. Common example is pressing on the key on the keyboard, which causes to the keyboard to send Interrupt to the microcontroller to read the information of the pressed key. In the multi-processor system, the processors can send to each other interrupts as a way to communicate. ![]() When the interrupt is blocked, the PIC microcontroller does not see the request for the interrupt and will not execute it. In fact the blocked interrupt will not be executed until it will be unblocked. For example: The processor is in the middle of a calculation, and we do not want to write into memory until the micro did not finish the calculation. In this situation, we will block the write to the memory interrupt. We will unblock the interrupt only after the processor finished the calculation, thus preventing him to write into the memory as long as it is in the middle of the action. There are some interrupts that can not be maskedblocked - NMI - Non Mask able Interrupts. They are used to report on critical hardware issues, such as the drop of voltage. In this situation we are interested in immediate response from the processor without the ability to ignore them. From the diagram below you can see all the sources of the interrupts, when xxIF is an interrupt flag and xxIE is an Interrupt Enable bit.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |