Tuesday, January 7, 2020

FMA Unit 1.2 8051 Microcontroller Architecture


8051 Microcontroller Architecture
The 8051 Microcontroller is one of the basic type of microcontroller, designed by Intel in 1980’s. This microcontroller was based on Harvard Architecture and developed primarily for use in embedded systems technology.


A. Central Processor Unit (CPU)
·       The CPU is the brain of any processing device of the microcontroller.
·    It monitors and controls all operations that are performed on the Microcontroller units.
·   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.

B. Memory

·  The Program memory (ROM) is used to store the program of the microcontroller. This program tells microcontroller to do specific tasks.
·  The data memory (RAM) is used to store data temporarily for operation.
·  8051 microcontroller has 4KB program memory (ROM) and also 128 bytes of data memory (RAM).

C. Control Bus

Basically Bus is a collection of wires which work as a communication channel or medium for transfer of Data. It has two types:-

·    Address Bus: Microcontroller 8051 has a 16 bit address bus for transferring the data. It is used to address memory locations and to transfer the address from CPU to Memory of the microcontroller.
·   Data Bus: Microcontroller 8051 has 8 bits of the data bus, which is used to carry data of particular applications.

D. Input/Output Port
·   Microcontroller is used in embedded systems to control the various operations of machines. Therefore, to connect it to other machines, devices or peripherals I/O interfacing ports are required.
·   For this purpose microcontroller 8051 has 4 input, output ports to connect it to the other peripherals

E. Timers/Counters
·       8051 microcontroller has two 16 bit timers and counters.
·       These counters are again divided into a 8 bit register.
·       The timers are used for measurement of intervals to determine the pulse width of pulses.

F. Interrupts
·    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 Microcontroller 8051 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-
v  INTO
v  INT1
v  TFO
v  TF1
v  R1/T1

G. Oscillator
·    The microcontroller requires clock pulses for its operation, so it has an on-chip oscillator which works as a clock source for CPU.
·     The output pulses of oscillator are stable. Therefore, it enables synchronized work of all parts of the Microcontroller.

 

 

Applications of 8051 Microcontroller

Some of the applications of 8051 is mainly used in daily life & industrial applications also some of that applications are shown below
  • Light sensing and controlling devices
  • Temperature sensing and controlling  devices
  • Fire detection and safety devices
  • Automobile applications
  • Defense applications


FMA Unit 1.4 Memory Organization


8051 Memory Organization
8051 memory divided in to two types
   A.  Program Memory (ROM)
·       It can access up to 64 KB program memory (60 KB external and 4 KB internal program memory).
·       When 4KB of Internal ROM (address from 0000H to 0FFFH ) as well as 60KB of External ROM (address from 1000H to FFFFH) have to be used then EA (bar) pin is connected to Vcc i.e. EA (bar) = 1
 ·       When whole 64KB of External ROM (address from 0000H to FFFFH) has to be used then EA (bar) pin is connected to GND i.e. EA (bar) = 0


   B.  Data Memory (RAM)

·       It can address upto 64 KB of external data memory and 256 bytes of internal memory.
·       The internal data memory is divided into THREE different blocks.
a.     Lower  128 bytes (00H to 7FH)
b.    Upper 128 bytes ( 80H to FFH)
c.     SFRs (Specials Function Registers)





Structure of Internal RAM (00H to 7FH)
It has 128 bytes Internal RAM which organized in three areas:

A.1 -  Register bank area
·       There are four register banks ie. 0 to 3 each of 8 byte
·       Each bank made up of eight registers named R0 to R7.
·       In total Working registers from address 00H to 1FH organised as four register banks.
·       If any of the banks is not selected, then programmer can be use the area from 00H to 1FH .
Upon power ON or RESET Bank 0 is selected by default.

A.2 - Bit Addressable area of 16 Bytes
·       The microcontroller has reserved of internal RAM whose address ranges from 20H to 2FH.
·       These 16 Bytes provide us with 16 × 8 = 128 bits forming address bit.
·       The microcontroller has given addresses to these bits ranging from 00H to 7FH.
·       These location are called as Bit Addressable Locations.

A.3 -  General Purpose RAM area
·       This RAM is also called as scratch pad area
·       It lies above bit address area and as address 30H to 7FH
·       This RAM can be used as data RAM


Use of Internal RAM
·         It is not essential to utilise the entire area of internal RAM.
·         The microcontroller has instructions that allow the internal memory location to be use as data pointer.
·         The registers R0 & R1 in the four register banks can be used as a pointer to point the internal and external RAM both.
·         When the register R0 & R1 are used to access the external RAM, the 8 bits will be consider as LSB of 16 bit address and MSB is taken to be 00H by default

External Memory
·       External memory is used when the internal ROM and RAM memory is not sufficient on chip.
·       Two separate external memories are available by different control pins for enabling external ROM and RAM chips.
·       In 8051 family, external RAM of upto 64 KB and external ROM of upto 64 KB can be added on any chip.



Special Function Registers (SFRs)
·       SFRs are placed in the address space immediately above 128 bytes of RAM from 80H to FFH.
·       Out of these 128 Memory Locations (80H to FFH), there are only 21 locations that are actually assigned to SFRs. Each SFR has one Byte Address and also a unique name which specifies its purpose.
·       Since the SFRs are a part of the Internal RAM Structure, you can access SFRs as if you access the Internal RAM. The main difference is the address space: first 128 Bytes (00H to 7FH) is for regular Internal RAM and next 128 Bytes (80H to FFH) is for SFRs.
·       The SFRs are used to program and control different hardware peripherals like Timers, Serial Port, I/O Ports etc
·       Suppose some of the address (80H to FFH) is not used, when writing the data to such unused location the data will be lost it not stored anywhere.



FMA Unit 1.3 8051 microcontroller PIN Diagram



  • Pins 1 to 8 (Port 1) –This port doesn’t serve any other functions. It is internally pulled up, bi-directional I/O port.
  • Pin 9 (RST) − It is a RESET pin, which is used to reset the microcontroller to its initial values.
·         Pins 10 to 17 (Port 3) − This port serves some functions.
ü Pin 10 (RXD): It is a Serial Communication Input.
ü Pin 11 (TXD): It is a Serial Communication output


















ü Pin 12 (): Input of Interrupt 0
ü Pin 13 (): Input of Interrupt 1




ü Pin 14 (T0): Input of Counter 0 clock
ü Pin 15 (T1): Input of Counter 1 clock



ü Pin 16 (): Writing Signal to write content on external RAM.
ü Pin 17 (): Reading Signal to read contents of external RAM.
  • Pin 18 (XTAL2) and Pin 19 (XTAL1) − These pins are used for interfacing an external crystal to get the system clock.
  • Pin 20 (GND) − It is ground pin.
  • Pins 21 to 28 − These pins are known as Port 2. It can be configured as Input Output Pins. But, this is only possible when  any external memory not used. If we use external memory, then these pins will work as high order address bus (A8 to A15).
  • Pin 29 − This pin is used to enable external program memory. If we use an external ROM for storing the program, then logic 0 appears on it.
·         Pin 30   This is the Address Latch Enable Pin. Using this Pins, external address can be separated from data (as they are multiplexed by 8051).During Flash Programming, this pin acts as program pulse input (PROG).
·        Pin 31 – This is the External Access Enable Pin i.e. allows external Program Memory. During Flash Programming, this Pin receives 12V Programming Enable Voltage (VPP).
  • Pins 32 to 39 − These pins are known as Port 0. These pins can be used as input output pins when any external memory not used. When ALE or Pin 30 is at 1, then this port is used as data bus: when the ALE pin is at 0, then this port is used as a lower order address bus (A0 to A7)
  • Pin 40 − This pin is used to provide power supply to the circuit.
⅃¯¯¯¯EA¯

Wednesday, April 3, 2019

Question Bank for Prelim

Question Bank for Prelim

1
Draw 8051 based system to interface DAC. Write a program to generate triangular wave.
2
Explain the following microcontroller development tools
(1) Assembler  (2) Simulator  (3) Compiler.
3
Draw and explain functional block diagram of 8255 PPI
4
Explain the control word format of 8255 PPI. Write the control word to program all ports as output ports
5
With the help of block diagram explain measurement of power factor.
6
Draw an interfacing diagram and write program for speed control of a stepper motor.
7
Draw a schematic diagram for speed control of stepper motor using 8051 microcontroller
8
Draw interfacing diagram of LCD with 8051. Also explain function of LCD pins.

Monday, March 25, 2019

Assignment Fundamental of Microcontroller and its Application


Assignment
Fundamental of Microcontroller and its Application

1.  Draw a schematic diagram for speed control of stepper motor using 8051 microcontroller. [7]
2.      With the help of block diagram explain measurement of power.
3.      With the help of block diagram, explain the interfacing of simple keyboard with 8051 microcontroller.
4.     Draw and explain with schematic diagram for Power Factor measurement using 8051 microcontroller. [7]
OR
4.     With the help of block diagram, show how power factor can be measured using 8051. [6]
OR
4.     With the help of block diagram explain measurement of power factor.
OR
4.      Draw and explain power factor measurement using 8051. [7]
5.   Draw interfacing diagram of LCD with 8051. Also explain function of LCD pins. [6]
6.   With the help of block diagram, show how temperature can be measured using 8051. [6]
7. Draw block diagram and explain the DC motor interfacing to 8051 microcontroller [7]
8.     Draw circuit diagram and write program for relay interfacing using 8051. [7]
9.   Draw an interfacing diagram and write program for speed control of a stepper motor. [7]
10. Write an assembly language program for 8051 to rotate stepper motor in clockwise and anticlockwise direction with step angle 1.8º. [6]
11. Write a program to rotate a motor 64° in the clockwise direction. The motor has a step angle of 2°. Use the normal 4 step sequence. [6].
12. Write a program to rotate the DC motor for a given speed. [6]
13. Write a program to monitor a status of SW, if SW is connected to Pin P2.1 and do the following : [6]
a)     If SW = 1 DC Motor rotate in Clockwise direction
b)   If SW = 0 DC motor rotate in anticlockwise direction

LAST DATE OF SUBMISSION OF ASSIGNMENT IS 05/04/2019