Saturday 4 June 2016

Main Component of Microcontroller

Microcontroller is basically an On Chip Computer. I microcontroller all the Components such as CPU, Memory, I/O Devices, Interrupt Handler, Serial Communication Interface, Timer etc are fabricated on single chip.  As shown in figure below the entire component are connected to CPU via an internal bus and fabricated on the Chip. Module connects with the external word through I/O Module. There will be a fixed size of Program and Data memory in microcontroller. When developing product using Microcontroller we have to take care all these things in mind.


CPU (Central Processing Unit)
Central processing unit is the main part of microcontroller. CPU interacts with all modules through internal system bus. Main component of CPU are as follows:

ALU (Arithmetic Logic Unit) perform all the computational addition, subtraction, multiplication and digital operation task. ALU takes two input and give single output and store the data in specified address receives from registers.

Registers Files contains the working register of central processing unit. It contains the general purpose register for storing data address on which operation to be performed and special purpose register to such as Accumulator register or peripheral registers.

Control Unit (CU) determines which instruction to be executed next and configure the data path accordingly. Program counter register will use to monitor which instruction to be executed next. The control unit loads this instruction into the instruction register (IR), decodes the instruction, and sets up the data path to execute it. Data path configuration includes providing the appropriate inputs for the ALU (from registers or memory), selecting the right ALU operation, and making sure that the result is written to the correct destination (register or memory).

Stack Pointer points to the top of stack memory in microcontroller. Stack is the consecutive memory portion in the Data Ram memory to save the return address and status register during subroutine and interrupts call routine. There is a SFR register which points to the top of stack. When function call or interrupt occur Controller store the return address and status register to stack memory using PUSH instruction. When it will return from function of ISR it will retrieve the return address through POP instruction


Memory
In microcontroller there are mainly three types of memory, RAM, FLASH and EEPROM.  In microcontrollers the memory is limited. The architecture of microcontrollers may require that variable and constant should be in different memory.



RAM stands for random access memory. It is a type of Volatile memory. Means that this type of memory losses there data if power removed.  This memory stores the data that change repetitively in the program. The entire variables we defined in the program are stored in the RAM memory.

Flash Memory is non volatile memory. Means that data does not losses if power is removed. This type memory save data that does not change repetitive during program execution.  This memory also called program memory. This memory is same as BIOS in general computers.

EEPROM stands for electrically erasable programmable read only memory. This type of memory used to store variable which does not changes repetitively. This is a type of Non Volatile Memory. This memory is limited in Microcontrollers.


 I/O Module
This module used to communicate with the external environment. CPU communicated with this module with internal system bus.  The digital input functionality is used whenever the monitored signal should be interpreted digitally that is, when it only changes between the two states “high” (corresponding to logic 1) and “low” (corresponding to 0). The digital output functionality is used to set output pins to given voltage levels. The levels corresponding to high and low are again specified by the controller and depend on the controller’s operating voltage.

Timer
The timer module, which is strictly speaking a counter module, is an important part of every microcontroller, and most controllers provide one or more timers with 8 and/or 16 bit resolution. Timers are used for a variety of tasks ranging from simple delays over measurement of periods to waveform generation. The most basic use of the timer is in its function as a counter.


Serial Communication Devices
In microcontrollers Serial Communication module used to communicate with the external world.  In serial communication there is a specified protocol on which two modules communicates with each other.  In a microcontroller there one or more types of Serial communication modules.  Three basic serial communication peripherals are UART, SPI and I2C. 

Other devices

There are some other modules which are used for power optimization and proper working of microcontroller.  SLEEP module is used to reduce power consumption in the by entering controller in sleep mode. Watchdog Timer is used to monitoring the program execution. Once watch dog enabled it start down counting. When the counter value become zero a reset signal is triggered, which reset the microcontroller. To avoid reset software should update the watchdog counter before it becomes zero. 

No comments:

Post a Comment