Sei sulla pagina 1di 35

CHAPTER 1 INTRODUCTION

1.1 INTRODUCTION TO COMPANY


C.S Technologies is a Multi Domain Organization, covering almost all major trends of modern day technology. From the day of our establishment, we have been constantly widening our horizons and spreading out our feathers to meet the ever increasing demands of our clients. We deal basically internationally and nationally according to demand of our clients. C.s technologies is a prestigious name for embedded system products and solutions, enabling Engineers and system development companies to rapidly and cost effectively innovate, differentiate, and win in their markets. The top management has hands on experience in the design, development and manufacture of microcontroller based systems.With latest industrial equipments, instruments and softwares we provide a complete set of engineering package for development of existing and new projects. We provide complete solution in project designing and developing phase for industries. The Training at C.s is offered in the areas of Embedded Systems Design, ARM, Electronic Design Automation and VLSI. The course content is designed keeping in mind the current and future requirements of the industry. We also interact regularly with technical members of renowned industries to verify the relevance of the content to the industry expectation and upgrade the content accordingly. This up-gradation happens every six months. The following courses are provided in CS Technologies .Net Technologies The Java Technologies. Linux Admin. CCNA. MCSE. Embedded System. VLSI.

1.2 EMBEDDED SYSTEM


Embedded system is the core of every intelligent device. Every-thing around you from a simple watch to the space ship is using embedded systems. Your mobile phones, PDAs, Washing Machines, Microwave Ovens, Automobile and all the automated electronics gadgets are having one or another form of embedded systems responsible for their intelligent functioning. Microcontrollers are the most important unit for every embedded system. Main 1

aim of this Training module is to make the students skill full and efficient for all the hardware and software related concepts required to make a complete embedded product. Course Content MCS-51 Architecture and Hardware Details MCS-51 Instruction Set Programming in Assembly Interfacing LEDs Interfacing Single & Multi Seven Segments Interfacing Switches & Key Pad Interfacing DC Motors Interfacing Stepper Motors Interfacing Devices working at 220 Volts AC Interfacing Digital Sensors(Infrared, Inductive proximity, Capacitive Proximity) Interfacing I2C protocol based memory chips Interfacing Sensors (Temp, Humidity, Light, Gas, Ultrasonic etc) Interfacing RTC, RAM, EEPROM etc

1.3

VLSI (Very Large Scale Integration)

With the hardware market booming with the rise demand in chip driven products in consumer electronics, medical electronics, communication, aero-space, computers etc. More and more chip designing companies have set up their units in India eying on the Indian talents; besides many of the Indian Major IT companies have forayed in ASIC design in a big way. With the design & manufacturing market (both domestic & international) expanding rapidly, there is an enhanced demand of trained professionals who will boost the technical work force in this domain. Course Content MOS Fundamentals and Characterization NMOS/ PMOS/ CMOS Technologies Fabrication Principles Different Styles of Fabrication for NMOS/PMOS/CMOS Design with CMOS Gates Characterization of CMOS Circuits Scaling Effects Sub-Micron Designs Parasitic Extraction and Calculations Subsystem Design

1.4 CCNA
Planning and designing (implementation and operation) design an IP addressing scheme to meet design requirement select an appropriate routing protocol based on user requirement 2

design a simple internet work using cisco technology develop an access list to meet user specitications choose wan services to meet customer requirement configure routing protocols given user requirements configure ip addressess, subnet masks and gateway addressess on routers and hosts configure a router for additional administrative functionality configure a switch with vlans and inter-switch communcation customise a switch configuration to meet specified

1.5 .NET TECHNOLOGIES


o o o o o o o o o o o o .NET Architecture Working with XML DNA Programming Model/Limitations of DNA Getting Started with .NET Architecture of .NET The Solution Microsoft.Net Common Language Runtime (CLR) .Net Development Environment XML C# Win Forms and Controls Applying Objects and Components Exception Handling Creating Custom Controls Interfaces, Structures and Enumerations Delegates and Events Multithreading

1.6

THE JAVA TECHNOLOGIES

The Java Language Data Types, Variables and Arrays Operators, Control Statements Introducing Classes A Closer Look at Methods and Classes Inheritance Packages and Interfaces Exception Handling Multithreaded Programming I/O, Applets, and other Topics The Dynamic Billboard Applet

CHAPTER 2 PROJECT REVIEW

2.1

EMBEDDED SYSTEM
An embedded system can be defined as a control system or computer system designed to perform a specific task. It is usually embedded as part of a complete device including hardware and mechanical parts. Embedded systems control many of the common devices in use today. It is usually embedded as part of a complete device including hardware and mechanical parts. Embedded systems range from no user interface at all, dedicated only to one task , to complex graphical user interfaces that resemble modern computer desktop operating systems. Since the embedded system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product, or increasing the reliability and performance. Some embedded systems are mass-produced, benefiting from economies of scale. Physically, embedded systems range from portable devices such as digital watches and MP4 players, to large stationary installations like traffic lights, factory controllers, or the systems controlling nuclear power plants. Complexity varies from low, with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or enclosure.

2.2 2.2.1.

CHARACTERISTICS
Embedded systems are designed to do some specific task, rather than be a generalpurpose computer for multiple tasks. Some also have real-time performance constraints that must be met, for reasons such as safety and usability; others may have low or no performance requirements, allowing the system hardware to be simplified to reduce costs.

2.2.2. Embedded systems are not always standalone devices. Many embedded systems consist of small, computerized parts within a larger device that serves a more general purpose. For example, the Gibson Robot Guitar features an embedded system for tuning the strings, but the overall purpose of the Robot Guitar is, of course, to play music. Similarly, an embedded system in an automobile provides a specific function as a subsystem of the car itself. 2.2.3. The program instructions written for embedded systems are referred to as firmware, and are stored in read-only memory or Flash memory chips. They run with limited computer hardware resources: little memory, small or non-existent keyboard and/or screen. 4

2.3

USES
The uses of embedded systems are virtually limitless, because every day new products are introduced to the market that utilizes embedded computers in novel ways. In recent years, hardware such as microprocessors, microcontrollers, and FPGA chips have become much cheaper. So when implementing a new form of control, it's wiser to just buy the generic chip and write your own custom software for it. Producing a custommade chip to handle a particular task or set of tasks costs far more time and money. Many embedded computers even come with extensive libraries, so that "writing your own software" becomes a very trivial task indeed. From an implementation viewpoint, there is a major difference between a computer and an embedded system. Embedded systems are often required to provide Real-Time response. A Real-Time system is defined as a system whose correctness depends on the timeliness of its response. Examples of such systems are flight control systems of an aircraft, sensor systems in nuclear reactors and power plants. For these systems, delay in response is a fatal error. A more relaxed version of Real-Time Systems is the one where timely response with small delays is acceptable. Example of such a system would be the Scheduling Display System on the railway platforms.

2.4

Importance of Embedded Systems

Embedded systems are playing important roles in our lives every day, even though they might not necessarily be visible. Some of the embedded systems we use every day control the menu system on television, the timer in a microwave oven, a cell phone, an MP3 player or any other device with some amount of intelligence built-in. In fact, recent poll data shows that embedded computer systems currently outnumber humans in the USA. Embedded systems are a rapidly growing industry where growth opportunities are numerous. This industry needs brilliancy and capability to develop new ideas to achieve the target in a short and easiest way. There are many job opportunities for such people. This is the most important need to study the embedded systems. There are many applications based on embedded systems. Even from a refrigerator, cell phone to a jet plane embedded system is used.

2.5

Drawbacks

2.5.1. Embedded computers may be economical, but they are often prone to some very specific problems. A PC computer may ship with a glitch in the software, and once discovered, a software patch can often be shipped out to fix the problem. An embedded system, however, is frequently programmed once, and the software cannot be patched. Even if it is possible to patch faulty software on an embedded system, the process is frequently far too complicated for the user. 5

2.5.2. Another problem with embedded computers is that they are often installed in systems for which unreliability is not an option. For instance, the computer controlling the brakes in your car cannot be allowed to fail under any condition. The targeting computer in a missile is not allowed to fail and accidentally target friendly units. As such, many of the programming techniques used when throwing together production software cannot be used in embedded systems. Reliability must be guaranteed before the chip leaves the factory. This means that every embedded system needs to be tested and analyzed extensively. 2.5.3. An embedded system will have very few resources when compared to full blown computing systems like a desktop computer, the memory capacity and processing power in an embedded system is limited. It is more challenging to develop an embedded system when compared to developing an application for a desktop system as we are developing a program for a very constricted environment. Some embedded systems run a scaled down version of operating system called an RTOS (real time operating system)

2.6

MICROCONTROLLER

A microcontroller is a small computer on a single integrated circuit consisting of a relatively simple CPU combined with support functions such as a crystal oscillator The success of the Intel 8051 spawned a number of clones which are collectively referred to as the MCS-51 family of microcontrollers, which includes chips from vendors such as Atmel, Philips, Infineon, and Texas Instruments.

2.6.1 About the 8051 Microcontroller


The Intel 8051 microcontroller is one of the most popular general purpose microcontrollers in use today. The Intel 8051 is an 8-bit microcontroller which means that most available operations are limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended. The Short and Standard chips are often available in DIP form, but the Extended 8051 models often have a different form factor, and are not "dropin compatible". All these things are called 8051 because they can all be programmed using 8051 assembly language, and they all share certain features (although the different models all have their own special features). Some of the features that have made the 8051 popular are: 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 6

2.6.2. Typical applications


8051 chips are used in a wide variety of control systems, telecom applications and robotics as well as in the automotive industry. By some estimation, 8051 family chips make up over 50% of the embedded chip market.

P89V51RD2 Microcontroller. (fig 2.1)

2.7

Pin Diagram

Phillips controller P89V51RD2 is used for interfacing. The Pin Diagram of 8051 microcontroller is as shown in below figure:-

(fig 2.2) 7

2.8.

EXPLANATION OF P89V51RD2

Description: 8-bit 80C51 5 V Low Power 64 KB Flash Microcontroller with 1 KB RAM. The P89V51RD2 is an 80C51 Microcontroller with 64 KB Flash And 1024 Bytes of Data RAM. A Key Feature of The P89V51RD2 is its X2 Mode Option. The Design Engineer CAN Choose to Run The Application With The Conventional 80C51 Clock Rate (12 Clocks Per Machine Cycle) or Select The X2 Mode (6 Clocks Per Machine Cycle) to Achieve Twice The Throughput at The Same Clock Frequency. Another Way to Benefit From This Feature is to Keep The Same Performance by Reducing The Clock Frequency by Half, Thus Dramatically Reducing The Emi. The Flash Program Memory Supports Both Parallel Programming and in Serial In-system Programming (ISP).

2.8.1 PORTS
There are four 8-bit ports: P0, P1, P2 and P3. PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which can be used for a variety of interfacing tasks. The other ports P0, P2 and P3 have dual roles or additional functions associated with them based upon the context of their usage. PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has additional functions such as, serial transmit and receive pins, 2 external interrupt pins, 2 external counter inputs, read and write pins for memory access. PORT P2 (pins 21 to 28): PORT P2 can also be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P2 will act as an address bus in conjunction with PORT P0 to access external memory. PORT P2 acts as A8-A15, as can be seen from fig 1.1 PORT P0 (pins 32 to 39) PORT P0 can be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P0 acts as a multiplexed address and data bus that can be used to access external memory in conjunction with PORT P2. P0 acts as AD0-AD7.

2.8.2

BASIC PINS

PIN 9: PIN 9 is the reset pin which is used reset the microcontrollers internal registers and ports upon starting up.2 machine cycle should be high at this pin.

PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only connect a crystal at these pins to provide clock pulses to the circuit. At frequency 11.0592, UART clock (61.8432 MHz); allows integer division to common baud rates.

CRYSTAL OSCILLATOR (fig.2.3) PIN 40 and 20: Pins 40 and 20 are VCC and ground 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. PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in flash memory. In order to program this we need to supply a voltage of +12V at pin 31. 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 select enable". In order to use the external memory it is required to provide the low voltage (0) on both PSEN and EA pins.

2.8.3

RESET

A reset button is a button that can reset a device. On computers, the reset button clears the memory and reboots the machine forcibly. Reset buttons are found on circuit breakers to reset the circuit. This button can cause data corruption so this button often doesn't exist on many machines. Usually, in computers, it is present as a small button, possibly recessed into the case, to prevent accidentally pressing it.

RESET BUTTON (fig.2.4)

2.9

Data and Program Memory

The 8051 Microprocessor can be programmed in PL/M, 8051 Assembly, C and a number of other high-level languages. Many compilers even have support for compiling C++ for an 8051.

Program Start Address

The 8051 starts executing program instructions from address 0x00 in the program 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.

2.10

TOOLS USED FOR P89V51RD2

Tool used for programming the P89V51RD2 is KEIL. The Keil 8051 Development Tools are designed to solve the complex problems facing embedded software developers. The use of C language to program microcontrollers is becoming too
common. And most of the time its not easy to build an application in assembly which instead you can make easily in C. So its important that you know C language for microcontroller which is commonly known as Embedded C. we are going to use Keil C51 Compiler.

Flash Magic is used as the burner for our controller.

(fig.2.5)

10

2.11

ISP (IN SYSTEM PROGRAMMING)

In-System Programming (abbreviated ISP) is the ability of some programmable logic devices, microcontrollers, and other programmable electronic chips to be programmed while installed in a complete system, rather than requiring the chip to be programmed prior to installing it into the system. The primary advantage of this feature is that it allows manufacturers of electronic devices to integrate programming and testing into a single production phase, rather than requiring a separate programming stage prior to assembling the system. This may allow manufacturers to program the chips in their own system's production line instead of buying preprogrammed chips from a manufacturer or distributor, making it feasible to apply code or design changes in the middle of a production run. Typically, chips supporting ISP have internal circuitry to generate any necessary programming voltage from the system's normal supply voltage, and communicate with the programmer via a serial protocol. Most programmable logic devices use a variant of the JTAG protocol for ISP, in order to facilitate easier integration with automated testing procedures. Other devices usually use proprietary protocols or protocols defined by older standards. In systems complex enough to require moderately large glue logic, designers may implement a JTAG-controlled programming subsystem for non-JTAG devices such as flash memory and microcontrollers, allowing the entire programming and test procedure to be accomplished under the control of a single protocol. In-System Programming with 8051-Based Microcontrollers In-system programming is a valuable feature that allows system firmware to be upgraded without disassembling the embedded system to physically replace memory. Most Maxim 8051-based microcontrollers can be reprogrammed from a PC or laptop via an inexpensive RS-232 serial interface and a few logic gates. When launched, the insystem programming feature auto bauds to the detected baud rate and begins execution of a command-driven, ROM-based bootstrap loader. The free, PC-based Microcontroller Tool Kit programming utility is available from Maxim Embedded designs with in-system programmability allow generic products to be software-customized right before shipment. The feature also reduces life cycle cost by permitting existing applications to be upgraded without disassembling the application. Secure microcontrollers such as the DS5002FP and DS5250 can use this feature to load the customer's proprietary software into the application where it will be automatically encrypted and protected against unauthorized access.

11

2.12

TIMERS & COUNTERS

Counter units (aka, timer units) are crucial components of most embedded systems and included in many microcontrollers. Here's a primer on the hardware. In some cases, a timer measures elapsed time (counting processor cycles or clock ticks). In others, we want to count external events. The names counter and timer can be used interchangeably when talking about the hardware. The difference in terminology has more to do with how the hardware is used in a given application.

A SIMPLE TIMER (fig.2.6) Figure shows a simple timer similar to those often included on-chip within a microcontroller. You could build something similar from a couple of 74HC161 counters or a programmable logic device. The timer shown consists of a loadable 8-bit count register, an input clock signal, and an output signal. Software loads the count register with an initial value between 0x00 and 0xFF. Each subsequent transition of the input clock signal increments that value. When the 8-bit count overflows, the output signal is asserted. The output signal may thereby trigger an interrupt at the processor or set a bit that the processor can read. To restart the timer, software reloads the count register with the same or a different initial value. If a counter is an up counter, it counts up from the initial value toward 0xFF. A down counter counts down, toward 0x00. A typical counter will have some means to start the counter running once it is loaded, usually by setting a bit in a control register. This is not shown in the figure. A real counter would generally also provide a way for the processor to read the current value of the count register at any time, over the data bus.

12

2.13

INTERRUPTS

Sometimes things will happen in a system when the processor is simply not ready. In fact, sometimes things change that require immediate attention. Can you imagine, sitting at your PC, that you were to hit buttons on the keyboard, and nothing happens on your computer? May be the processor was busy, and it just didnt check to see if you were hitting any buttons at that time. The solution to this problem is something called an "Interrupt." Interrupts are events that cause the microprocessor to stop what it is doing, and handle a high-priority task first. After the interrupt is handled, the microprocessor goes back to whatever it was doing before. In this way, we can be assured that highpriority inputs are never ignored Interrupts are a commonly used technique for computer multitasking, especially in realtime computing. Such a system is said to be interrupt-driven. An act of interrupting is referred to as an interrupt request (IRQ). Types of Interrupts: Level-triggered

A level-triggered interrupt is a class of interrupts where the presence of an unserviced interrupt is indicated by a high level (1), or low level (0), of the interrupt request line. A device wishing to signal an interrupt drives the line to its active level, and then holds it at that level until serviced. It ceases asserting the line when the CPU commands it to or otherwise handles the condition that caused it to signal the interrupt. Edge-triggered

An edge-triggered interrupt is a class of interrupts that are signaled by a level transition on the interrupt line, either a falling edge (1 to 0) or a rising edge (0 to 1). A device wishing to signal an interrupt drives a pulse onto the line and then releases the line to its quiescent state. If the pulse is too short to be detected by polled I/O then special hardware may be required to detect the edge. Typical uses Typical uses of interrupts include the following: system timers, disks I/O, power-off signals, and traps. Other interrupts exist to transfer data bytes using UARTs or Ethernet; sense key-presses; control motors; or anything else the equipment must do. .Interrupt routine example Microchip PIC 18Fxxxx Microcontroller, compiled under MPLAB C18 compiler. The routine displays the number of interrupts occurred on port A, while it keeps toggling LEDs on port D:

13

CHAPTER 3 PROJECT WORK 3.1 8051 MICROCONTROLLER KIT


Programming on 8051 microcontroller kit has been using the following sections: LED (Light Emitting Diode) Seven Segment Relay Free Wheeling Diode LCD (Liquid Crystal Display) Buzzer Dip Switch Micro Switch / Push Button

MICROCONTROLLER KIT (fig.3.1) 14

3.2

LED (LIGHT EMITTING DIODE)


There are 8 LEDs corresponding to 8 bits of the microcontroller.

LEDS (fig.3.2) The programs run on microcontroller kit for LEDs are Program to rotate LEDs in clockwise direction

#include<reg51.h> void delay(); void main() { P1=0x00; while(1) { int j; P1=0x01; delay(); for(j=0;j<=7;j++) { P1=P1<<1; delay(); } } } void delay() { int i; for(i=0;i<=30000;i++); }

15

Write a program to rotate LEDs in anticlockwise direction

#include<reg51.h> void delay(); void main() { P1=0x00; while(1) { int j; P1=0x80; delay(); for(j=0;j<=7;j++) { P1=P1>>1; delay(); } } } void delay() { int i; for(i=0;i<=30000;i++); }

3.3 SEVEN SEGMENT DISPLAY


A seven-segment display (abbreviation: "7-segment) display"), less commonly known as a seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot-matrix displays. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information.

16

(fig.3.3)

(fig.3.4)

A seven segment display, as its name indicates, is composed of seven elements. Individually on or off, they can be combined to produce simplified representations of the Arabic numerals. Often the seven segments are arranged in an oblique, or italic, arrangement, which aids readability. The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top, middle, and bottom. Additionally, the seventh segment bisects the rectangle horizontally. There are also fourteen-segment displays and sixteen-segment displays (for full alphanumeric); however, these have mostly been replaced by dot-matrix displays. Seven segments are, effectively, the fewest required to represent each of the ten HinduArabic numerals with a distinct and recognizable glyph. Bloggers have experimented with six-segment and even five-segment displays with such novel shapes as curves, angular blocks and serifs for segments; however, these often require complicated and/or non-uniform shapes and sometimes create unrecognizable glyphs. In addition to the ten numerals, seven segment displays can be used to show letters of the Latin, Cyrillic and Greek alphabets including punctuation but only few representations are unambiguous and intuitive at the same time

Write a program to display 0 to 9 on seven segment display. #include<reg51.h> void delay(); void main() { int i; P2=0x01; for(i=0;i<8;i++) 17

{ P0=0XBF; delay(); P0=0x86; delay(); P0=0xDB; delay(); P0=0xCF; delay(); P0=0xE6; delay(); P0=0xED; delay(); P0=0xFD; delay(); P0=0x87; delay(); P0=0xFF; delay(); P0=0xF7; delay(); } } void delay() { for(int n=0;n<30000;n++); }

3.4

RELAY

A relay is an electrical switch that opens and closes under the control of another electrical circuit. In the original form, the switch is operated by an electromagnet to open or close one or many sets of contacts. Because a relay is able to control an output circuit of higher power than the input circuit, it can be considered to be, in a broad sense, a form of an electrical amplifier.

18

RELAY (fig.3.5) It consists of a coil of wire surrounding a soft iron core, an iron yoke, which provides a low reluctance path for magnetic flux, a moveable iron armature, and a set, or sets, of contacts; two in the relay pictured. The armature is hinged to the yoke and mechanically linked to a moving contact or contacts. It is held in place by a spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this condition, one of the two sets of contacts in the relay pictured is closed, and the other set is open. Other relays may have more or fewer sets of contacts depending on their function. The relay in the picture also has a wire connecting the armature to the yoke. This ensures continuity of the circuit between the moving contacts on the armature, and the circuit track on the Printed Circuit Board (PCB) via the yoke, which is soldered to the PCB. When an electric current is passed through the coil, the resulting magnetic field attracts the armature, and the consequent movement of the movable contact or contacts either makes or breaks a connection with a fixed contact. If the set of contacts was closed when the relay was de-energised, then the movement opens the contacts and breaks the connection, and vice versa if the contacts were open. When the current to the coil is switched off, the armature is returned by a force, approximately half as strong as the magnetic force, to its relaxed position. Usually this force is provided by a spring.
Write a program to switch relay with 5s delay.

#include<reg51.h> void delay(); sbit r=P1^5; void main() { 19

while(1) { r =0; delay(); r=1; delay(); } } void delay() { for(int m=0;m<5000;m++); { TM0D=0x01; TL0=0x66; TH0=0xFC; TR0=1; while(TF0= =0); TR0=0; TF0=0; } }

3.5

OPTOCOUPLER

There are many situations where signals and data need to be transferred from one subsystem to another within a piece of electronics equipment, or from one piece of equipment to another, without making a direct ohmic electrical connection. Often this is because the source and destination are (or may be at times) at very different voltage levels, like a microprocessor which is operating from 5V DC but being used to control a triac which is switching 240V AC. In such situations the link between the two must be an isolated one, to protect the microprocessor from over voltage damage. Relays can of course provide this kind of isolation, but even small relays tend to be fairly bulky compared with ICs and many of todays other miniature circuit components. Because theyre electro-mechanical, relays are also not as reliable and only capable of relatively low speed operation. Where small size, higher speed and greater reliability are important, a much better alternative is to use an optocoupler. These use a beam of light to transmit the signals or data across an electrical barrier, and achieve excellent isolation. Optocouplers typically come in a small 6-pin or 8-pin IC package, but are essentially a combination of two distinct devices: an optical transmitter, typically a gallium arsenide

20

OPTOCOUPLER (fig.3.6)

3.6 STEPPER MOTOR


A stepper motor is a brushless, synchronous electric motor that can divide a full rotation into a large number of steps. The motors position can be controlled precisely, without any feedback mechanism. Stepper motors are similar to switched reluctance motors (which are very large stepping motors with a reduced pole count, and generally are closed-loop commutated.)

STEPPER MOTOR (fig.3.7) Stepper motors operate differently from normal DC motors, which rotate when voltage is applied to their terminals. Stepper motors, on the other hand, effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. The electromagnets are energized by an external control circuit, such as a micro controller. To make the motor shaft turn, first one electromagnet is given power, which makes the gear's teeth magnetically attracted to the electromagnet's teeth. When the gear's teeth are thus aligned to the first electromagnet, they are slightly offset from the next electromagnet. So when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the next one, and from there the process is repeated. Each of those slight rotations is called a "step," with an integer number of steps making a full rotation. In that way, the motor can be turned by a precise angle

21

3.7

LIQUID CRYSTAL DISPLAY (LCD)

A liquid crystal display (LCD) is an electronically-modulated optical device shaped into a thin, flat panel made up of any number of color or monochrome pixels filled with liquid crystals and arrayed in front of a light source (backlight) or reflector. It is often used in battery-powered electronic devices because it requires very small amounts of electric power.

LCD DISPLAY (fig.3.8)

INTERFACING LCD

Schematic: 4-bit interfacing 16x2 LCD (fig.3.9) Write a program to display Engineers on liquid crystal display (LCD). #include<reg51.h> sbit rs=P0^0; sbit e=P0^1 ; void delay(); void cmd(); void dat(); void main() 22

{ P2=0x38; //5x7 matrix cmd(); delay(); P2=0x0E //cursor blink cmd(); delay(); P2=0x01; //clear screen cmd(); delay(); P2=0x06; //right increment cmd(); delay(); P2=0x80; //to display first line cmd(); delay(); P2=Engineers; dat(); delay(); } void delay() { int n; for(n=0;n<30000;n++); } void cmd() { rs=0; e=1; e=0; } void dat() { rs=1; e=1; e=0; }

23

3.8

BUZZER

A buzzer is a signaling device, usually electronic, typically used in automobiles, household appliances such as a microwave oven, or game shows. It most commonly consists of a number of switches or sensors connected to a control unit that determines if and which button was pushed or a preset time has lapsed, and usually illuminates a light on the appropriate button or control panel, and sounds a warning in the form of a continuous or intermittent buzzing or beeping sound. Initially this device was based on an electromechanical system which was identical to an electric bell without the metal gong (which makes the ringing noise). Often these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding board. Another implementation with some ACconnected devices was to implement a circuit to make the AC current into a noise loud enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric sounder which makes a high-pitched tone. Usually these were hooked up to "driver" circuits which varied the pitch of the sound or pulsed the sound on and off.

(fig.3.10) In game shows it is also known as a "lockout system," because when one person signals ("buzzes in"), all others are locked out from signaling. Several game shows have large buzzer buttons which are identified as "plungers". The word "buzzer" comes from the rasping noise that buzzers made when they were electromechanical devices, operated from stepped-down AC line voltage at 50 or 60 cycles. Other sounds commonly used to indicate that a button has been pressed are a ring or a beep.

3.9

DIP SWITCH
A DIP switch is a set of manual electric switches that are packaged in a group in a standard dual in-line package (DIP) (the whole package unit may also be referred to as a DIP switch in the singular). This type of switch is designed to be used on a printed circuit board along with other electronic components and is commonly used to customize the behavior of an electronic device for specific situations. DIP switches are an alternative to 24

jumper blocks. Their main advantages are that they are quicker to change and there are no parts to lose.

DIP SWITCH (fig3.11) The DIP switch package also has socket pins or mounting leads to provide an electrical path from the switch contacts to the circuit board. Although circuits can use the electrical contacts directly, it is more common to convert them into high and low signals. In this case the circuit board also needs interface circuitry for the DIP switch, consisting of a series of pull-up or pull-down resistors, a buffer, decode logic, and other components. Typically the devices firmware reads the DIP switches. They were also often used on arcade games in the 1980s and early 1990s to store settings, before the advent of cheaper, battery-backed RAM and were very commonly used to set security codes on garage door openers as well as on some early cordless phones. This design, which used up to twelve switches in a group, was used to avoid interference from other nearby door opener remotes or other devices. Current garage door openers use rolling code systems for better security. . Recently (since the late 1990s), DIP switches have become less common in consumer electronics. Reasons include the trend toward smaller products, the demand for easier configuration through setting screens, and the falling price of non-volatile memory. But DIP switches are still widely used in industrial equipment because they are inexpensive and easy to incorporate into circuit designs, and because they allow settings to be checked at a glance without powering the system on. Write a program To glow LED in clockwise direction when P2.0=1 To glow LED in anticlockwise direction when P2.1=1 To glow LED in zigzag manner when P2.2=1 To toggle P1.5 with a delay of 1s when P2.3=1 To toggle P1.7 with a delay of 2s when P2.4=1 #include<reg51.h> void delay1(); void delay2(); 25

void delay3(); sbit r=P2^0; sbit t=P2^1; sbit y=P2^2; sbit p=P2^3; sbit b=P2^4; sbit c=P1^5; sbit d=P1^7; void main() { int I; while(1) { if(r = = 1) { P1=0x01; delay1(); for(i=0;i<=7;i++) { P1=P1<<1; delay1(); } } if(t = = 1) { P1=0x80; delay1(); for(i=0;i<=7;i++) { P1=P1>>1; delay1(); } } if(y = = 1) { P1=0x01; delay1(); P1=0x40; delay1(); P1=0x04; delay1(); P1=0x10; delay1(); } if(p = = 1) { P1=0x00; 26

c=1; delay2(); c=0; delay2(); } if(b = = 1) { P1=0x00; d=1; delay3(); d=0; delay3(); } } } void delay1() { for(int n=0;n<30000;n++); } void delay2() { for(int m=0;m<1000;m++); { TM0D=0x01; TL0=0x66; TH0=0xFC; TR0=1; while(TF0= =0); TR0=0; TF0=0; } } void delay3() { for(int m=0;m<2000;m++); { TM0D=0x01; TL0=0x66; TH0=0xFC; TR0=1; while(TF0= =0); TR0=0; TF0=0; } }

27

3.10

MICRO SWITCH

A push-button (also spelled pushbutton) or simply button is a simple switch mechanism for controlling some aspect of a machine or a process. Buttons are typically made out of hard material, usually plastic or metal. The surface is usually flat or shaped to accommodate the human finger or hand, so as to be easily depressed or pushed. Buttons are most often biased switches, though even many un-biased buttons (due to their physical nature) require a spring to return to their un-pushed state. Different people use different terms for the pushing of the button, such as press, depress, mash, and punch.

MICRO SWITCH (fig.3.12) In industrial and commercial applications push buttons can be linked together by a mechanical linkage so that the act of pushing one button causes the other button to be released. In this way, a stop button can "force" a start button to be released. This method of linkage is used in simple manual operations in which the machine or process have no electrical circuits for control.

Write a program such that

If we press Switch 1 then LED glow in clockwise direction If we press Switch 2 then relay 1 gets on. If we press Switch 3 then relay 2 gets on. If we press Switch 4 then buzzer beeps.

#include<reg51.h> void delay(); sbit r=P2^0; sbit s=P2^1; sbit t=P2^2; sbit u=P2^3; sbit buz=P1^4; sbit re1=P1^5; sbit re2=P1^6; int i,j; 28

void main() { while(1) { if(r = = 1) { P0=0; P0=0x01; delay(); for(i=0;i<=7;i++) { P0=P0<<1; delay(); } } else if(s = = 1) { P1=0; re2=1; delay(); } else if(t = = 1) { P1=0; re1=1; delay(); } else if(u = = 1) { 0P1=0; buz=1; delay(); } else { P0=0; P1=0; P2=0; } } } void delay() { for(int n=0;n<30000;n++);

29

CHAPTER 4 RESULTS AND DISCUSSION

INTERFACING OF LIQUID CRYSTAL DISPLAY (LCD) WITH 8051 MICROCONTROLLER


4.1 A liquid crystal display (LCD) is an electronically-modulated optical device shaped into a thin, flat panel made up of any number of color or monochrome pixels filled with liquid crystals and arrayed in front of a light source (backlight) or reflector. It is often used in battery-powered electronic devices because it requires very small amounts of electric power.

(fig.4.1)

30

program to display STOP WATCH on liquid crystal display (LCD)

#include<reg51.h> sbit rs=P1^0; sbit e=P1^1; sbit sw1=P1^2; sbit sw2=P1^3; unsigned char min[3]="Min"; unsigned char sec[3]="Sec"; unsigned char hur[4]="Hour"; void dat(); void delay(); void cmd(); void main() { int g,h,i,j,k,l,a,b,c;

P0=0x38; cmd(); delay(); P0=0x0c; cmd(); delay(); P0=0x01; cmd(); delay(); P0=0x06; cmd(); delay(); P0=0x80; cmd(); delay(); for(c=0;c<=3;c++) { P0=hur[c]; dat(); delay(); } P0=0x85; cmd(); delay(); for(a=0;a<=2;a++) { P0=min[a]; 31

dat(); delay(); } P0=0x89; cmd(); delay(); for(b=0;b<=2;b++) { P0=sec[b]; dat(); delay(); } while(1) {

Output at lcd.

(fig.4.2)

32

CHAPTER 5 CONCLUSIONS AND SCOPE FOR FUTURE WORK

5.1 Conclusion
A lot of advancements have taken place in Embedded systems, and we have long left the traditional real-time operating systems.In the present times, Embedded software has found immediate application in telecommunications, defense instruments, railroad networks, consumer electronics, electronic payments, and smart cards industry. Embedded systems created ripples in the scientific world with its innovation of autonomous robots that could be deployed for personal use. The wide popularity and unparalleled charm associated with robot pets of branded electronic companies, proves the difference Embedded technologies can make for us, and our lives. Looking at its diversity of applications and potential for production of highly innovative products, Embedded systems can be considered as the primary technology of the future. In the Embedded market we find two major trends.

The symbiotic relationship between the Embedded software vendors and the original equipment manufacturers (OEMs) that is the real driver for research and development of new applications based on Embedded programming. The growth and direction of the Embedded Operating System (EOS) market, and the challenges associated with increasing complexity of Embedded applications that demand more powerful, lower cost hardware and better connectivity. Embedded systems are gaining increasing importance in all aspects of engineering. It is expected that in the near future roughly no technical artifact will exist without embedded information technology. There is a tendency to software oriented embedded and/or dependable systems, based on standardized micro-controller cores. This implies that the design of embedded real-time software and real-time operating systems will play a dominant role in this field. As more and more networks of micro-controllers are applied, real-time communication systems and in general the design of distributed embedded systems will gain importance. As high-performance embedded computing components have become available the challenges of designing embedded systems have become more acute.

5.2 SCOPE

With IC design capability, EDA software skills, testing, simulation, verification, and libraries taking the concept all the way to tape out, the design eco-system is in place; 33

we need to get the Fab ecosystem in place; under Fab-City, initiative, SIA (Semiconductor Industry Association) in India has made a presentation to the Union Finance Minister and we expect that also to be in place over the next two years. The demand side is in place; BEL, ECIL for Defense Electronics, BPL for Telecom, Videocon (after Thompson Picture Tubes plant acquisition, Videocon is the worlds No 3 TV tube manufacturer) for consumer electronics, VXL for thin clients (No 3 globally, as per Gartner) are examples of Indian corporations; Motorola, Philips, Siemens, GE, Nokia, Samsung, Elcoteq, Flextronics are present and increasing their stake in India; that should take care of demand; of course the global demand is there too On the market side, with 2 million mobile consumers a month, mobile market is growing; TV, DVD, MP3, music, ring tones are growing everyday (Indians download million a day of paid ring tones @ Rs 6 (minimum)); with Narayana Hrudayalaya and others creating Healthcare Destination for the world (5,000 beds for heart surgery and shooting for 10% of global heart surgeries at Narayana Hrudayalaya alone), healthcare industry and imaging equipment is bound to grow; GE Wipro are working on a global product (Ultra sound, Laptop form factor, $ 1,000 price point device that would make ultra sound as common place as stethoscope for EVERY doctor). So there is a huge market Academia, Industry and Government are coming together; I see a great potential for embedded systems in India; let us hope that before the next Freescale Tech Forum in 2006 there will be products whose ideas are generated by the people sitting right in this room (700+ professionals). That alone will make me happy to attend Freescale Tech Forum 2006!

34

REFERENCES

http://en.wikipedia.org/wiki/Embedded_system http://en.wikipedia.org/wiki/Microcontroller http://www.scribd.com/search?query=embedded+system http://searchenterpriselinux.techtarget.com/definition/embedded-system http://www.bookshoppers.in/book.aspx?id=1662 http://www.csasia.in/ http://www.8051projects.info/

35

Potrebbero piacerti anche