Академический Документы
Профессиональный Документы
Культура Документы
1.1 Introduction
An Embedded product uses the microprocessor(or microcontroller) to do a specific task only. A printer is an example of Embedded system since the processor inside it performs one task only namely getting the data and printing it.In contrast to this Pentium based PC can be used for any no. of applications such as word processor, print server, bank teller terminal, video game player, network server or internet terminal. Software for variety of applications can be loaded and run. Of course the reason a PC can perform multiple task is that it has RAM memory and an operating system that loads the application software into RAM & lets the CPU run it. In an Embedded system there is only one application software that is typically burned into ROM. An x86PC contains or is connected to various Embedded Products such as keyboard, printer, modem, Disc controller, Sound card, CD-Rom Driver, Mouse & so on. Each one of these peripherals has a microcontroller inside it that performs only one task. For example inside every mouse there is microcontroller to perform the task of finding the mouse position and sending it to PC. Although microcontroller are preferred choice for many Embedded systems, There are times that a microcontroller is inadequate for the task. For this reason in recent years many manufactures of general purpose microprocessors such as INTEL, Motorolla, AMD & Cyrix have targeted their microprocessors for the high end of Embedded market. While INTEL, AMD, Cyrix push their x86 processors for both the embedded and desktop pc market,
Motorolla is determined to keep the 68000 families alive by targeting it mainly for high end of embedded system. One of the most critical needs of the embedded system is to decrease power consumptions and space. This can be achieved by integrating more functions into the CPU chips. All the embedded processors based on the x86 and 680x0 have low power consumptions in additions to some forms of I/O, Com port & ROM all on a single chip. In higher performance Embedded system the trend is to integrate more & more function on the CPU chip & let the designer decide which feature he/she wants to use.
Microcontrollers/Microprocessors
CHAPTER 2
A microcontroller can be considered a self-contained system with a processor, memory and peripherals and can be used as an embedded system. The majority of microcontrollers in use today are embedded in other machinery, such as automobiles, telephones, appliances, and peripherals for computer systems. These are called embedded systems. While some embedded systems are very sophisticated, many have minimal requirements for memory and program length, with no operating system, and low software complexity. Typical input and output devices include switches, relays, solenoids, LEDs, small or custom LCD displays, radio frequency devices, and sensors for data such as temperature, humidity, light level etc.
A microprocessor is a general-purpose digital computer central processing unit (CPU). CPU is stand-alone, RAM, ROM, I/O, timer are separate.The block diagram of a
CPU
GeneralPurpose Micro-
Data Bus
Serial COM Port
processor
RAM
ROM
I/O
Port
Timer
Microprocessor
RAM and I/O ports. 2.Expensive and versatile
Microcontroller
2.For applications in which cost, power and space are critical 3.Specific purpose
1.Designer can decide on the amount of ROM, 1.Fixed amount of on-chip ROM, RAM, I/O ports
3.Multipurpose
4. Concerned with rapid movement of the code & within the chip. data from the external addresses to the chip. Table:-1
4 reg banks. 128 user defined software flags. 8-bit data bus 16-bit address bus 32 general purpose registers each of 8 bits 16 bit timers (usually 2, but may have more, or less). 3 internal and 2 external interrupts. Bit as well as byte addressable RAM area of 16 bytes. Four 8-bit ports, (short models have two 8-bit ports). 16-bit program counter and data pointer. 1 Microsecond instruction cycle with 12 MHz Crystal.
8051 models may also have a number of special, model-specific features, such as UARTs, ADC, OpAmps, etc...
PIN 9:
PIN 9 is the reset pin which is used reset the microcontrollers internal registers and ports upon starting up. (Pin should be held high for 2 machine cycles.)
amplifier hence we need to only connect a crystal at these pins to provide clock pulses to the circuit.
respectively. The 8051 chip needs +5V 500mA to function properly, although there are lower powered versions like the Atmel 2051 which is a scaled down version of the 8051 which runs on +3V.
PIN 30 is called ALE (address latch enable), which is used when multiple memory chips are connected to the controller and only one of them needs to be selected. PIN 29 is called PSEN. This is "program store enable". In order to use the external memory it is required to provide the low voltage (0) on both PSEN and EA pins.
CHAPTER 3
3.1 Architectural features & Description 3.1.1 The Central Processing Unit
The central processing unit (CPU) does all the computing: it fetches, decodes and executes program instructions and directs the flow of data to and from memory. The CPU performs the calculations required by program instructions and places the results of these calculations, if required, into memory space. Most CPUs are synchronous. This means that they depend on the cycles of a processor clock. A clock generates a high-frequency square wave usually driven by a crystal, a RC (resistor capacitor) or an external source. The clock is sometimes referred to as an oscillator. The clock speed, or oscillation rate, is measured in megahertz (MHz), which represents one million cycles/second. For example, if the clock speed is 3 MHz then there are 3,000,000-clock cycles/second. Clock configurations are micro controller dependent.
These include: 1. THE STACK POINTER: The stack pointer contains the address of the next location on the stack. The address in the stack pointer is decremented when data is pushed on the stack and incremented when data is popped from the stack. 2. THE INDEX REGISTER: The index register is used to specify an address when certain addressing modes are used. It is also known as the pointer register. The Microchip devices use the name FSR (file select register). 3. THE PROGRAM COUNTER: The PC holds the address of the next instruction in program memory space. It contains the address of the next instruction the CPU will process. As each instruction is fetched and processed by the ALU, the CPU increments the PC and thereby steps through the program stored in the program memory space. 4. THE ACCUMULATOR: The accumulator is a register that can hold operands or results of operations as necessary. The Microchip devices use the name W (working) register. Other registers may reflect results from the instruction just executed, control the options available on the device, and enable access to certain areas of memory.
Direct Memory
The 8051 has 256 bytes of internal addressable RAM, although only the first 128 bytes are available for general use by the programmer. The first 128 bytes of RAM (from 0x00 to 0x7F) are called the Direct Memory, and can be used to store data.
A and B Registers
The A register is located in the SFR memory location 0xE0. The A register works in a similar fashion to the AX register of x86 processors. The A register is called the accumulator, and by default it receives the result of all arithmetic operations. The B register is used in a similar manner, except that it can receive the extended answers from the multiply and divide operations. When not being used for multiplication and Division, the B register is available as an extra general-purpose register.
CHAPTER 4
Interfacing of Various Devices with Microcontroller
Above is shown the circuitry of regulated power supply using a bridge rectifier. The power supply incorporates shunt capacitor circuit along with 7805 and 7812 voltage regulator IC. For the interfacing of various components Vcc of 5 Volts has been supplied. Also the various sensors incorporated in the project have been provided the Vcc in parallel with the supply.
Fig.14 Seven
Segmented Display