MP
Figure 3. 8051 Architecture Central Processor Unit (CPU)CPU is the brain of any processing device of the microcontroller. It monitors and controls all operations that are performed on the Microcontroller units. It reads program written in ROM memory and executes them and does the expected task of that application.InterruptsInterrupt is a subroutine call that interrupts the microcontrollers main operations or work and causes it to execute any other program, at the time of operation. 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.Generally, five interrupt sources are there in 8051 Microcontroller. INTOTFO INT1 TF1 R1/T1 (INT0) ̅ and (INT1) ̅ are external interrupts that could be negative edge triggered or low level triggered. When All these interrupts are activated, set the corresponding flags except for serial interrupt.The interrupt flags are cleared when the processor branches to the interrupt service routine (ISR). The timers and serial port interrupts are external interrupts.MemoryThe program tells microcontroller to do specific tasks. These programs require a memory where they can be saved and read by Microcontroller to perform specific operations of a task. BUSBus is a collection of wires that work as a communication channel or medium for transfer of Data. These buses consist of 8, 16 or more wires of the microcontroller. Thus, these can carry 8 bits,16 bits simultaneously. Here two types of buses that are shown in belowAddress Bus Data Bus OscillatorThe 8051 microcontroller has an on-chip oscillator that works as a clock source for Central Processing Unit of the microcontroller. The output pulses of oscillator are stable. Therefore, it enables synchronized work of all parts of the 8051 Microcontroller.Input/Output PortNormally microcontroller is used in embedded systems to control the operation of machines in the microcontroller. Therefore, to connect to other machines, devices or peripherals we require I/O interfacing ports in the microcontroller interface. For this purpose, microcontroller 8051 has 4 input, output ports to connect it to the other peripheralsTimers/Counters8051 microcontroller has two 16-bit timers and counters. These counters are again divided into 8-bit register. The timers are used for measurement of intervals to determine the pulse width of pulses.
Unit-1Fundamentals of Microprocessors
1.1 Fundamentals of Microprocessor Architecture The microprocessor is one of the components of the microcomputer. The MPU (microprocessor unit) is the heart of every microcomputer. It performs several functions, including. 1. Providing timing and control signals for all elements of the µC 2. Fetching instructions and data from memory 3. Transferring data to and from memory and I/O devices4.Decoding instructions 5. Performing arithmetic and logic operations called for by instructions 6. Responding to I/O generated control signals such as RESET and INTERRUPT.The microprocessor can be divided into three segments, arithmetic/logic unit (ALU), register unit, and control unit. Arithmetic and Logic Unit: The computing functions are performed on data. The CPU performs arithmetic operations such as addition and subtraction, and logic operations such as AND, OR, and exclusive OR. Results are stored either in register or in memory or sent to output devices. Register Unit: This area of the microprocessor consists of various registers. These registers are used primarily to store data temporarily during the executing of a program. Some of the registers are accessible to the user through instructions. Control Unit: The control unit provides the necessary timing and control signals all these operations in the microcomputer. It controls the flow of data between the microprocessor and peripherals (including memory). Input: The input section transfers data and instructions in binary from the outside world to the microprocessor. It includes devices such as keyboards, teletypes, and analog-to-digital converters. Output :The output section transfers data from the microprocessor to output devices such as light emitting diodes (LEDs), cathode-ray-tubes (CRTs), printers, magnetic tape, or another computer. Typically, single-board computers include LEDs and seven-segment LEDs as output devices. Memory: Memory stores binary information such as instructions and data,and provides that information to the microprocessor whenever necessary. To execute programs, the microprocessor reads instructions and data from memory and performs the computing operations in its ALU section. Key Takeaways:The microprocessor is usually a single IC that contains all the circuitry of the control and arithmetic-logic units-in other words, the CPU
1.2 8-bit Microprocessor and Microcontroller Architecture 8085 Architecture
Figure 1. 8085 8-bit Microprocessor architecture The 8085 microprocessor is an 8-bit processor available as a 40-pin IC package and uses +5 V for power. The data bus width is 8-bit and address bus is 16-bit, therefore it can address 216 = 64 KB of memory.Arithmetic and Logic Unit:The ALU performs the arithmetic and logical operations such as Addition (ADD), Subtraction (SUB), AND, OR etc. It uses data from memory and from Accumulator to perform operations. The results of the arithmetic and logical operations are stored in the accumulator. Registers The 8085 includes six registers, one accumulator and one flag register, as shown in Figure. In addition, it has two 16-bit registers: stack pointer and program counter.8085 has six general-purpose registers to store 8-bit data; these are identified as B, C, D, E, H and L. If combined the register pairs - BC, DE and HL perform some 16-bit operations. The programmer can use these registers to store or copy data into the register by using data copy instructions.
Figure 2. Register Organisation Program Counter (PC) :The 16-bit register deals with sequencing the execution of instructions. This register is a memory pointer. The microprocessor uses this register to sequence the execution of the instructions. The function of the program counter is to point to the memory address from which the next byte is to be fetched. When byte is being fetched, the program counter is automatically incremented by one to point to the next memory location. Stack Pointer (SP): The stack pointer is also a 16-bit register, used as a memory pointer. It points to a memory location in R/W memory, called stack. The beginning of the stack is defined by loading 16- bit address in the stack pointer. Instruction Register/Decoder: This is an 8-bit register that temporarily stores the current instruction of a program. Decoder then takes instruction and decodes or interprets the instruction. Decoded instruction then passed to next stage.Control Unit: Generates signals on data bus, address bus and control bus within microprocessor to carry out the instruction, which has been decoded.Typical buses and their timing are: • Data Bus: Data bus carries data in binary form between microprocessor and other external units such as memory. It is used to transmit data that is information, results of arithmetic etc between memory and the microprocessor. Data bus is bidirectional in nature. • Address Bus: The address bus carries address and is one way bus from microprocessor to the memory or other devices. 8085 microprocessors contain 16-bit address bus and are generally identified as A0 - A15. The higher order address lines (A8 – A15) are unidirectional and the lower order lines (A0 – A7) are multiplexed (time-shared) with the eight data bits (D0 – D7) and hence, they are bidirectional. • Control Bus: Control bus are various lines which have specific functions for coordinating and controlling microprocessor operations. The control bus carries control signals partly unidirectional and partly bidirectional. 8051 Architecture
Virtually all 8-bit processors have a wider address bus, as an 8-address bus would only address 256 bytes of memory.Modern 8-bit based on RISC typically have many more registers. For example, the Atmel 8-bit AVRs have 32 general-purpose 8-bit registers, and the last six (R26:R27, R28:R29 and R30:R31) can be paired and used as 16-bit pointer (index) registers, named X, Y and Z.16-bit processors have 16-bit data and address registers, and a 16-bit or larger address bus.Most of 16-bit microcontroller has 16-bit registers, of which four are dedicated to special purposes: Most MSP430’s can only address 64K of memory but some have an extension to address 20-bits.Most 32-bit microcontrollers use RISC designs, typically MIPS or ARM .They have 32-bit data and address registers, and 32-bit addressing.ARM Cortex microcontrollers have 16 32-bit registers, of which 13 are general-purpose registers, R0-R12; R13 is the stack pointer, R14 is the link register, and R15 is the program counter. Some parts have 32 64-bit floating point registers.
1.4 Definition of embedded system and its characteristics An embedded system is a dedicated computer system which is designed to work for single or few specific functions often within the larger system. Embedded Systems are:Built in function with little or no human intervention Specially designed keeping in consideration the tasks that need completion in the most efficient way Most of our gadgets like washing machines, microwave ovens, ATMs and mobile phones have embedded system in them. Characteristics: Most of the Embedded Systems are task specific. They do the same task repeatedly /continuously over their lifetime. Embedded systems perform the task within a certain time frame. They have minimal or no user interface (UI). A fully automatic washing machine works on its own after the programme is set and stops once the task is over. Embedded systems are built to achieve certain efficiency levels. They are small sized, which work with less power and not too expensive. Microcontroller or microprocessors are used to design embedded systems. Embedded systems need connected peripherals to attach input & output devices.
Embedded System is a system unit that is used to create any automation device or to control any machines using Micro Controller.Micro Controller is an Integrated Circuit that has a processor, Memory, Timer. A micro controller can be programmed with any dedicated task.Consider the example of Washing Machine:In a washing machine there are different functions that is programmed in a Micro Controller, like for rotating the motor and and for automatic filling the water.The whole circuit that uses different integrated circuit for different task can be called as Embedded System and the integrated circuit which is programmed for a dedicated task is called as a Micro Controller.
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. Normally, this microcontroller was developed using NMOS technology, which requires more power to operate. Therefore, Intel redesigned Microcontroller 8051 using CMOS technology and their updated versions came with a letter C for instance an 80C51 which is an 8 bit microcontroller. These latest Microcontrollers requires less power to operate in comparison to their previous versions. The 8051 Microcontroller has two buses and two memory spaces of 64K X 8 size for program and data units. It has an 8-- bit processing unit and 8- bit accumulator units.Key Takeaways:It is an 8-bit microcontroller. It is built with 40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM storage, 2 16-bit timers. References:The 8051 Microcontroller and Embedded Systems using Assembly and C by Muhammad Ali Mazidi. The 8051 Microcontroller by I. Scott Mackenzie, Raphael C.W Phan
8051 Microcontrollers: Internals, Instructions, Programming, and Interfacing Book by Subrata Ghoshal
8051 Microcontroller Based Embedded Systems Textbook by MANISH K PATEL
Advanced PIC Microcontroller Projects in C Book by Dogan Ibrahim
0 matching results found
Browse by Topics