Saturday, July 13, 2013

Advantages & Disadvantages

Advantages of Microcontrollers

a)      Microcontrollers act as a microcomputer without any digital parts.
b)     As the higher integration inside microcontroller reduce cost and size of the system.
c)      Usage of microcontroller is simple, easy for troubleshoot and system maintaining.
d)     Most of the pins are programmable by the user for performing different functions.
e)      Easily interface additional RAM, ROM,I/O ports.
f)       Low time required for performing operations.

Disadvantages of Microcontrollers

a)      Microcontrollers have got more complex architecture than that of microprocessors.
b)     Only perform limited number of executions simultaneously.
c)      Mostly used in micro-equipments.
d)     Cannot interface high power devices directly.

Comparison between Microprocessor & Microcontroller

Microprocessors                                                                                          Microcontrollers
1It is only a general purpose computer CPUIt is a micro computer itself
2Memory, I/O ports, timers, interrupts are not available inside the chipAll are integrated inside the microcontroller chip
3This must have many additional digital components to perform its operationCan function as a micro computer without any additional components.
4Systems become bulkier and expensive.Make the system simple, economic and compact
5Not capable for handling Boolean functionsHandling Boolean functions
6Higher accessing time requiredLow accessing time
7Very few pins are programmableMost of the pins are programmable
8Very few number of bit handling instructionsMany bit handling instructions
9Widely Used in modern PC  and laptopswidely in small control systems
E.g.INTEL 8086,INTEL Pentium seriesINTEL8051,89960,PIC16F877

Block Diagram & Function of Microcontroller

Block Diagram

  • CPU
CPU is the brain of a microcontroller .CPU is responsible for fetching the instruction, decodes it, then finally executed. CPU connects every part of a microcontroller into a single system. The primary function of CPU is fetching and decoding instructions. Instruction fetched from program memory must be decoded by the CPU.
  • Memory
The function of memory in a microcontroller is same as microprocessor. It is used to store data and program. A microcontroller usually has a certain amount of RAM and ROM (EEPROM, EPROM, etc) or flash memories for storing program source codes.
  • Parallel input/output ports
Parallel input/output ports are mainly used to drive/interface various devices such as LCD’S, LED’S, printers, memories, etc to a microcontroller.
  • Serial ports
Serial ports provide various serial interfaces between microcontroller and other peripherals like parallel ports.
  • Timers/counters
This is the one of the useful function of a microcontroller. A microcontroller may have more than one timer and counters. The timers and counters provide all timing and counting functions inside the microcontroller. The major operations of this section are perform clock functions, modulations, pulse generations, frequency measuring, making oscillations, etc. This also can be used for counting external pulses.
  • Analog to Digital Converter (ADC)
ADC converters are used for converting the analog signal to digital form. The input signal in this converter should be in analog form (e.g. sensor output) and the output from this unit is in digital form. The digital output can be use for various digital applications (e.g. measurement devices).
  • Digital to Analog Converter (DAC)
DAC perform reversal operation of ADC conversion.DAC convert the digital signal into analog format. It usually used for controlling analog devices like DC motors, various drives, etc.
  • Interrupt control
The interrupt control used for providing interrupt (delay) for a working program .The interrupt may be external (activated by using interrupt pin) or internal (by using interrupt instruction during programming).
  • Special functioning block
Some microcontrollers used only for some special applications (e.g. space systems and robotics) these controllers containing additional ports to perform such special operations. This considered as special functioning block.


Introduction of Microcontroller

microcontroller (sometimes abbreviated µCuC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR Flash or OTP ROM  is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications.


1) A microcontroller basically contains one or more following components:
  • Central processing unit(CPU)
  • Random Access Memory)(RAM)
  • Read Only Memory(ROM)
  • Input/output ports
  • Timers and Counters
  • Interrupt Controls
  • Analog to digital converters
  • Digital  analog converters
  • Serial interfacing ports
  • Oscillatory circuits
2) A microcontroller internally consists of all features required for a computing system and functions as a computer without adding any external digital parts in it.
3) Most of the pins in the microcontroller chip can be made programmable by the user.
4) A microcontroller has many bit handling instructions that can be easily understood by the programmer.
5) A microcontroller is capable of handling Boolean functions.
6) Higher speed and performance.
7) On-chip ROM structure in a microcontroller provides better firmware security.
8 ) Easy to design with low cost and small size.

System Bus

system bus is a single computer bus that connects the major components of a computer system. The technique was developed to reduce costs and improve modularity. It combines the functions of a data bus to carry information, an address bus to determine where it should be sent, and a control bus to determine its operation. Although popular in the 1970s and 1980s, modern computers use a variety of separate buses adapted to more specific needs.


There are three buses in Microprocessor:
1.Address Bus
2.Data Bus
3.Control Bus




1.Address Bus:-Genearlly, Microprocessor has 16 bit address bus. The bus over which the CPU sends out the address of the memory location is known as Address bus. The address bus carries the address of memory location to be written or to be read from.
The address bus is unidirectional. It means bits flowing occurs only in one direction, only from microprocessor to peripheral devices.

2.Data Bus:-8085 Microprocessor has 8 bit data bus. So it can be used to carry the 8 bit data starting from 00000000H(00H) to 11111111H(FFH). Here 'H' tells the Hexadecimal Number. It is bidirectional. These lines are used for data flowing in both direction means data can be transferred or can be received through these lines. The data bus also connects the I/O ports and CPU. The largest number that can appear on the data bus is 11111111.

It has 8 parallel lines of data bus. So it can access upto 2^8 = 256 data bus lines.

3.Control Bus:-The control bus is used for sending control signals to the memory and I/O devices. The CPU sends control signal on the control bus to enable the outputs of addressed memory devices or I/O port devices.

Some of the control bus signals are as follows:
1.Memory read
2.Memory write
3.I/O read
4.I/O write.



Saturday, July 6, 2013

Internal Structure and Basic Operation of Microprocesor

Arithmetic Logic Unit The ALU, or the arithmetic and logic unit, is the section of the processor that is involved with executing operations of an arithmetic or logical nature. It works in conjunction with the register array for many of these, in particular, the accumulator and flag registers. The accumulator holds the results of operations, while the flag register contains a number of individual bits that are used to store information about the last operation carried out by the ALU. More on these registers can be found in the register array section.
Control Unit The control unit is arguably the most complicated part of this model CPU, and is responsible for controlling much of the operation of the rest of the processor. It does this by issuing control signals to the other areas of the processor, instructing them on what should be performed next

Accumulator or A register is an 8-bit register used for arithmetic, logic, I/O and load/store operations.

Program counter is a 16-bit register.

Stack pointer is a 16 bit register. This register is always incremented/decremented by 2.

Fetching & Execution Cycles

Fetching cycle is the basic operation cycle of a computer. It is the process by which a computer retrieves a program instruction from its memory, determines what actions the instruction requires, and carries out those actions. This cycle is repeated continuously by the central processing unit (CPU), from bootup to when the computer is shut down.

Execute cycle is the instruction in order to work out what actions should be performed to execute it. This involves examining the opcode to see which of the machine codes in the CPU's instruction set it corresponds to, and also checking which addressing mode needs to be used to obtain any required data. Therefore, using the CPU model from this tutorial, bits 16 to 23 should be examined.

Definition

NIBBLE - In computing, a nibble (often nybble or even nyble to match the vowels of byte) is a four-bit aggregation,or half an octet. As a nibble contains 4 bits, there are sixteen possible values, so a nibble corresponds to a single hexadecimal digit (thus, it is often referred to as a "hex digit" or "hexit").

 BYTE - A byte is a unit of measurement used to measure data. One byte contains eight binary bits, or a series of eight zeros and ones. Therefore, each byte can be used to represent 2^8 or 256 different values. The byte was originally developed to store a single character, since 256 values is sufficient to represent all standard lowercase and uppercase letters, numbers, and symbolsA byte is a unit of measurement used to measure data. One byte contains eight binary bits, or a series of eight zeros and ones. Therefore, each byte can be used to represent 2^8 or 256 different values.

 WORD - word is a term for the natural unit of data used by a particular processor design. A word is basically a fixed-sized group of bits that are handled as a unit by the instruction set and/or hardware of the processor. The number of bits in a word (the word size, word width, or word length) is an important characteristic of any specific processor design or computer architecture.

Evolution of MicroP

Basic Components Computer System using Block Diagram

The Figure of Basic Computer System with block diagram..