The User has no control over the work of the CPU directly. It reads program written in ROM memory and executes them and do the expected task of that application. As its name suggests, Interrupt is a subroutine call that interrupts of the microcontrollers main operations or work and causes it to execute any other program, which is more important at the time of operation.
The feature of Interrupt is very useful as it helps in case of emergency operations. An Interrupts gives us a mechanism to put on hold the ongoing operations, execute a subroutine and then again resumes to another type of operations.
The Microcontroller can be configured in such a way that it temporarily terminates or pause the main program at the occurrence of interrupts. When a subroutine is completed, Then the execution of main program starts. Generally five interrupt sources are there in Microcontroller. There are 5 vectored interrupts are shown in below.
When All these interrupts are activated, set the corresponding flogs except for serial interrupt,. The interrupt flags are cleared when the processor branches to the interrupt service routine ISR. The external interrupt flags are cleared when the processor branches to the interrupt service routine, provides the interrupt is a negative edge triggered whereas the timers and serial port interrupts two of them are external interrupts, two of them are timer interrupts and one serial port interrupt terminal in general.
Microcontroller requires a program which is a collection of instructions. This program tells microcontroller to do specific tasks. These programs require a memory on which these can be saved and read by Microcontroller to perform specific operations of a particular task. The memory which is used to store the program of the microcontroller is known as code memory or Program memory of applications.
The program counter points to the next instruction that the CPU executes. We will discuss Interrupts, Timers, counters, and Serial Communication in detail with concrete examples in upcoming tutorials. Figure 1 shows the pin diagram of a only difference is that it has some addition features. As we can see there are four 8 bit ports P0,P1,P2 and P3. All the ports can be used either as input and output. You would also observe some of the pins have additional functions. We will discuss additional features with relevant topics.
Although most of the peripherals are not connected directly, it is essential to understand the way in which micro-controller, reads or writes bits to the port pins. The micrcontroller sends and receives binary 1s or 0s on each of the pins. All the four ports are similar, expect P0 which deos not have internal pull up.
To write 0 to pin of the microcontroller:. To write 1 to pin of the microcontroller:. To read 0 from the pin of the microcontroller:. Interrupts provide a method to postpone or delay the current process, performs a sub-routine task and then restart the standard program again. Memory : For operation Micro-controller required a program. This program guides the microcontroller to perform the specific tasks.
This program installed in microcontroller required some on chip memory for the storage of the program. Microcontroller also required memory for storage of data and operands for the short duration. Bus : Bus is a group of wires which uses as a communication canal or acts as means of data transfer.
The different bus configuration includes 8, 16 or more cables. Therefore, a bus can bear 8 bits, 16 bits all together. Oscillator : As the microcontroller is digital circuit therefore it needs timer for their operation. To perform timer operation inside microcontroller it required externally connected or on-chip oscillator. Microcontroller is used inside an embedded system for managing the function of devices. Therefore, uses the two 16 bit counters and timers.
For the operation of this timers and counters the oscillator is used inside microcontroller. JavaTpoint offers too many high quality services. Mail us on [email protected] , to get more information about given services. Please mail your requirement at [email protected] Duration: 1 week to 2 week. Embedded Systems. Reinforcement Learning. R Programming.
0コメント