Skip to document

IARE Eslab Manual - hvu kmjh 8hik gj oiluih h uigygk g ugu i i

hvu kmjh 8hik gj oiluih h uigygk g ugu i i
Course

Social Philosophy (APHI401)

8 Documents
Students shared 8 documents in this course
Academic year: 2014/2015
Uploaded by:
0followers
9Uploads
0upvotes

Comments

Please sign in or register to post comments.

Preview text

EMBEDDED SYSTEMS

LAB MANUAL

Course Code : AEC Regulations : IARE - R Class : VII Semester Branch : ECE

Prepared By

Mrs. M Assistant Professor, ECE

Department of Electronics & Communication Engineering

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal – 500 043, Hyderabad

INDEX

  • 1 Lab Objective S. No Name of the Content PAGE NO.
  • 2 Introduction About Lab
  • 3 LAB CODE
  • 4 List of Lab Exercises
  • 5 Description about ES Concepts
  • 6 Programs List
  • 7 References

INTRODUCTION ABOUT LAB

There are 30 systems (Dell) installed in this Lab. Their configurations are as follows:

Processor : Intel(R) core (TM) - i3 -

CPU RAM : 4 GB

Hard Disk : 500 GB

Mouse : Optical Mouse

Network Interface card : Present

Software

1 All systems are configured in DUAL BOOT mode i, Students can boot from Windows 07 is very useful for students because they are familiar with different Operating Systems so that they can execute their programs in different programming environments.

2 Each student has a separate login for database access

3 Software installed: Keil Micro vision, OFFICE-07, Systems are provided for students in the1: ratio.

4 Systems are assigned numbers and same system is allotted for students when they do the lab.

LAB CODE

  1. Students should report to the concerned labs as per time table schedule.
  2. Students who turn up late to the labs will in no case be permitted to do the program scheduled for the day.
  3. After completion of the program, certification of the concerned staff in-charge in the observation book is necessary.
  4. Students should bring a notebook of about 100 pages and should enter the reading/observations into
  5. the notebook while performing the experiment.
  6. The record of observations along with the detailed experimental procedure of the experiment performed in the immediate last session should be submitted and certified by the staff member in-charge.
  7. Not more than three students in a group are permitted to perform the experiment on a setup.
  8. The group-wise division made in the beginning should be adhered to and no mix up student among different groups will be permitted later.
  9. The components required pertaining to the experiment should be collected from stores in-charge after duly filling in the requisition form.
  10. When the experiment is completed, students should disconnect the setup made by them, and should return all the components/instruments taken for the purpose.
  11. Any damage of the equipment or burn-out of components will be viewed seriously either by putting penalty or by dismissing the total group of students from the lab for the semester/year.
  12. Students should be present in the labs for the total scheduled duration.
  13. Students are required to prepare thoroughly to perform the experiment before coming to Laboratory.
  14. Procedure sheets/data sheets provided to the student’s groups should be maintained neatly and to be returned after the experiment.

Week – 12 Program to interface ADC device with P89V51RD2 and display value on LCD

Week – 13 Program to interface DAC device with P89V51RD2 and observer the analog output in CRO

Week – 14 Program to interface Relay with P89V51RD2 using transistor

Week – 15 Program to toggle LEDS using simple INTERRUPT

Description about ES Concepts:

Embedded systems are designed to do some specific task, rather than be a general-purpose computer for multiple tasks. Some also have real-time performance constraints that must be met, for reason such as safety and usability; others may have low or no performance requirements, allowing the system hardware to be simplified to reduce costs. Embedded systems are not always separate devices. Most often they are physically built-in to the devices they control.

The software written for embedded systems is often called firmware, and is stored in read-only memory or Flash memory chips rather than a disk drive. It often runs with limited computer hardware resources: small or no keyboard, screen, and little memory. Embedded systems range from no user interface at all — dedicated only to one task — to full user interfaces similar to desktop operating systems in devices such as PDAs. Simple embedded devices use buttons, LEDs, and small character- or digit-only displays, often with a simple menu system.

Embedded Systems components:

Introduction to 8051 Microcontroller:

 Microcontroller is a device which integrates number of components of a microprocessor system onto a single chip. It typically includes:-  CPU (Central Processing unit)  RAM & ROM  I/O inputs & outputs – Serial & Parallel  Timers  Interrupt Controller

By including the features that are specific to the task (Control), Cost is relatively low. Microcontroller are a “one chip solutions” which drastically reduces parts count and design costs.

Block Diagram:

8051 Basic Components:

 4K bytes internal ROM  128 bytes internal RAM  Four 8-bit I/O ports (P0 - P3).  Two 16-bit timers/counters  One serial interface

8051 Development Board (P89V51RD2) On board Peripherals:

  1. hex-key pad 2) seven segment display
  2. serial peripheral interface (spi) 4) led’ display
  3. analog to digital converter 6) lm35 temperature sensor
  4. digital to analog converter 8) rtc battery
  5. eeprom (i2c) 10) rtc
  6. lcd display 12) gnd and vcc
  7. lcd contrast (potentiometer) 14) p89v51rd
  8. crystal oscillator 16) max
  9. serial port connector 18) stepper motor driver
  10. buzzer 20) reset button
  11. push button switches 22) slide switches
  12. ps/2 connector 24) relay output connector
  13. power supply slide switch 26) power jack
  14. 7805 voltage regulator 28) bridge rectifier
  15. relay

Overview:

The UTS-MC-KIT-M7 has got P89V51RD2 microcontroller which has got 64KiloBytes of on chip Flash memory and 1 KiloBytes of RAM. The kit is has got on board 11 crystal for generating the on chip clock of 11.

A Key feature of the board is it has got so many interfaces, with different on board peripherals and has got expansion capability to add any further sensor and peripherals in future. This prototype board is very easy to use for 8051 architecture. This board is interfaced with LED’s, 7 SEG display, LCD display, Pushbutton. This Board can also be interfaced with PC via serial communication and can be viewed through hyper terminal. The LCD display can be connected easily through connectors. No soldering work /No lose contact/ just plug in the berg connectors.

The board has got on chip peripherals like on board 32 KB bytes of RAM, Eight Light Emitting Diodes, four Push Buttons, Four Seven Segment Displays, 16X2 Liquid Crystal Character Display(LCD), Analog to Digital Converter, LM35 Temperature sensor, SPI based ADC, Hex Keypad, Buzzer relay, steeper motor driver interface, Real time clock, RS-232 serial interface.

Component Description: Microcontroller

The P89V51RD2 device contains a non-volatile 64KB Flash program memory.

In-System Programming (ISP) allows the user to download new code while the microcontroller sits in the application. A default serial loader (boot loader) program in ROM allows serial In-System programming of the Flash memory via the UART without the need for a loader in the Flash code.

This device executes one machine cycle in 6 clock cycles, hence providing twice the speed of a conventional 80C51. An OTP configuration bit lets the user select conventional 12 clock timing if desired.

This device is a Single-Chip 8-Bit Micro controller manufactured in advanced CMOS process and is a derivative of the 80C51 micro controller family. The instruction set is 100% compatible with the 80C instruction set.

The device also has four 8-bit I/O ports, three 16-bit timer/event counters, a multisource, and four- priority-level, nested interrupt structure, an enhanced UART and on-chip oscillator and timing circuits.

The added features of the P89V51RD2 makes it a powerful micro controller for applications that require pulse width modulation, high-speed I/O and up/down counting capabilities such as motor control. Experimental Procedure for Keil4 IDE

(For all the experiments this procedure is same) The RVision IDE is, for most developers, the easiest way to create embedded system programs. This chapter describes commonly used RVision features and explains how to use them.

RVision is a Windows application that encapsulates the Keil microcontroller development tools as well as several third-party utilities. RVision provides everything you need to start creating embedded programs quickly. RVision includes an advanced editor, project manager, and make utility, which work together to ease your development efforts, decreases the learning curve, and helps you to get started with creating embedded applications quickly.

There are several tasks involved in creating a new embedded project:

 Creating a Project File  Using the Project Windows  Creating Source Files  Adding Source Files to the Project  Using Targets, Groups, and Files  Setting Target Options, Groups Options, and File Options  Configuring the Startup Code  Building the Project  Creating a HEX File

The below section provides a step-by-step tutorial that shows you how to create an embedded project using the RVision IDE.

Output

LCD/LED

Printer

Microcontroller

InInInpppuu uttt

SwitchS witchS witch PPPeriperiperiphhheraleraleral InInInttterfacerfacerfaceee SPISPISPI I2CI2CI2C ADCADCADC

MMMMeeeemmmmoooorrrryyyy DDDDataataataata PPPPrrrrooooggggrrrraaaammmm

Clock

EXPERIMENT – 1(a)

Design and development of a Reprogrammable Embedded System Computer using 8051 Microcontroller

Aim: Design and develop a reprogrammable embedded system board using 8051 microcontrollers and to show following aspects. 1. Programming 2. Execution 3. Debugging Hardware Requirement: Soldering Iron, Tweezer, Cutter, Multimeter, Components as per table1. Software Requirement:

  1. Flash Magic tool.

  2. Keil evaluation software

Description:

1.3 Embedded System:- Embedded systems are those systems that are similar to computer (they can be termed as computer on a chip) but are designed for some specific task, they may have lesser components (be in size or in count) associated to it, then PC. They may or may not contain all components of a computer system. For more definitions one may refer links below. Unlike PC, Embedded systems are designed to perform some specific task and generally are not designed for performing multiple tasks.

Block Diagram of an Embedded System:

Figure 1: Block diagram of Embedded System

Clock

Peripheral Interface SPI I2C ADC UART

Microcontroller

Input

Sensor

Switch

Output

Printer

LCD/LED

Memory Data Program

“Components of a Computer”

Basic component of an embedded system is its controller which could be a microprocessor unit (MPU) or a microcontroller unit (MCU). MPU needs more peripherals to accomplish a task and hence results in complex circuit and higher power consumption, whereas MCU units mostly have on chip peripherals that includes memory elements like ROM/RAM, basic function elements like Timers/ Counters/ Interrupts and special interfaces like UART/ SPI/ I2C/CAN etc. and thus resulting in lesser component count and lesser power consumption. For more information on difference between MPU and MCU one may visit below mentioned sites.

Re-programmable Embedded System (RES):- In its easiest definition, a re-programmable embedded system is one which can be re programmed a number of times easily while in system or in application and with minimum component requirement i. there is no need to pull out MCU every time one wants to program it and hence provide flexibility in programming and operations. It is developed using 8051 compatible microcontrollers manufactured by NXP/ Atmel. In addition to execution of intended program RES also provide debugging facility and chip programming for other users.

The Reprogrammable embedded system consists of:

 Sockets for placing microcontroller- 40 pin DC socket for external power supply (DC 5V)  1 LED for power on indication and 1 push button for reset 11 MHz Quartz Crystal Oscillator  8 LEDs for output pin state indication at port P 1 DIP switch (8 switch) for input pin activation  Connector and driver for serial communication RS Multiple-pin connectors for direct access to I/O ports Connector for SPI programming  1 Piezo buzzer for audio/frequency output Additional power supply connectors

Selection of component for a given application

Every application circuit is build around some components which should be selected as per the functionality of the application, availability of components, cost of entire system, procurement time for components and most importantly meeting of some critical parameters of intended application.

Selection of Processor: Selection should be based mainly on architecture, availability, cost, time to prototype and market, testability and debug-ability. As per the requirement a microcontroller will be suitable for this purpose. Intel/Atmel 8051 architecture is suitable for beginners due to its easy understandability, easy

Input Selection 8-DIP switches are provided on board here for interfacing with any of input port. Inputs from sensors/ADC/PC may also be connected through port connectors.

Output Selection: LED: 8-LEDs are connected at port0 with 1KOhm resistor network RN1. They may be used for initial configurations and testing as well as to view outputs. LCD: 16x2, LCD may be connected using I/O port connectors. They may be used for displaying messages/values. LCD supports ASCII display. Output at PC/DAC/Motors (through drivers) is also supported.

Power Supply There is a connector on the development board enabling connection to external power supply source (DC- 5V). Besides, voltage necessary for device operation can also be obtained from PC via USB cable at connector J7/J8.

Selection of tools

Some tools and editors are required to prepare assembly language program and its compiling i. hex file generation, and writing this hex file to flash memory. Free downloadable Keil μvision version 4, editor is used for writing assembly language program and its compiling. Free downloadable Flash Magic or USB programmer is used for flash programming. Hyper terminal available with windows is used for debugging purpose.

Schematic Diagram

Discussion and explanation: Refer schematic diagram figure 1.

  1. Microcontroller 89V51RD2 is biased with +5V power supply connected at pin 40, GND connected at pin
    1. A 0 ceramic capacitor is connected between pin 40 and GND to suppress supply spikes.
  2. Enable Access (EA), pin 31 and PSEN pin 29 are all connected with Vcc. PSEN bar is connected to high logic as only internal flash memory is in use.
  3. Cathode of all 8 LEDs are connected at different pins of port0 i. from pin 32 to 39 of controller, LED anode will be connected to Vcc through 1KOhm resistance network RN1. These LEDs will be used in program to view outputs or to check proper functioning by blinking them with different delays.
  4. A 16 pin DIP switch (8 on/off switches) can be connected through 10KOhm resistance network RN3 at any port for switch inputs. At on condition port will be at low level.
  5. A 11 MHz crystal oscillator is connected between pin 18 and 19 of controller, with two 22pf ceramic capacitors connected between pin 18, 19 and GND.
  6. As controller requires logic high voltage for short duration to get itself reset, a reset circuit is connected at RST pin i. pin 9 of controller. It consists of a push-to-on switch connected between Vcc and pin 9, a 10K resistor connected between pin 9 and GND and an electrolytic capacitor of 10MFD/25V, connected between Vcc and pin9 of controller.
  7. For serial UART working, pin 10 of controller i. receive pin at port3 (P3) and pin 11 of controller i. transmit pin at port3 (P3) are connected with serial UART IC, MAX232 pin 9

and 10 respectively. Pin 9 of MAX232 is R2OUT i. receive out pin, which outputs data received from PC through serial cable via pin 8 i. R2IN of MAX232. Pin 10 of MAX232 is T2IN i. transmit input, which inputs data from controller. This input data is then sent to PC through serial cable via pin7 i. T2OUT of MAX232. 8. IC MAX232 is biased with +5V supply at pin 16, GND at pin 15. Rest of its biasing is done as per recommended circuitry. Four number 10 MFD/63V electrolytic capacitors are connected as recommended. 9. DB9 connector is connected between MAX232 and PC. Refer table 1 for complete list of components.

Figure 1: Pin diagram of P89V51RD2/AT89S

*Note: Some instructions or names of SFRs may be changed in different processors of different manufacturers, e. ATMEL NXP for same architecture. Care must be taken here.

Figure 1: Assembled PCB for Reprogrammable Embedded System

EXPERIMENT – 1(b)

Tool Chain of Keil IDE (Embedded Development Tool Chain) with the example of LED Blinking Program

Aim: To understand the procedure of creating source code for reprogrammable embedded system board

using IDE such as Keil μVision.

Software Requirement: Editor like Keil μVision Ver 4 or less.

Description:

Understanding any processor or controller needs familiarity with its architecture and instruction set. Any

architecture can be best understood using its instruction set through different programs.

One may use assembly language or embedded C for writing programs. Programs written in assembly

language are completely processor dependent and need major changes when converting to other

processor. While programs written in C are generally independent of processor and needs minor changes

during conversion to other processors.

C is thus preferred for programming. But to know and understand a processor better, one must be familiar

with assembly language.

All source code written in this document will be written using assembly language for 8051 architecture.

Some development environment is needed to prepare any application. An editor is needed first to provide

a platform for writing programs i. source code.

A source code written in assembly/C language is needed to be converted to machine language (hex code)

before programming into processor. This conversion is done by compiler which converts assembly/C

language code to hex code.

IDE i. Integrated development Environment, serves both these purposes as well as provide debugging facility.

Assembly language file will be stored by extension .asm , C file by extension. c and hex file by extension

.hex.

Procedure:

Many free software are available for educational purpose e. Keil, SDCCDown load free tools for IDE

from

Was this document helpful?

IARE Eslab Manual - hvu kmjh 8hik gj oiluih h uigygk g ugu i i

Course: Social Philosophy (APHI401)

8 Documents
Students shared 8 documents in this course

University: Jai Hind College

Was this document helpful?
1
EMBEDDED SYSTEMS
LAB MANUAL
Course Code
:
AEC111
Regulations
:
IARE - R16
Class
:
VII Semester
Branch
:
ECE
Prepared By
Mrs. M.Lavanya
Assistant Professor, ECE
Department of Electronics & Communication Engineering
INSTITUTE OF AERONAUTICAL ENGINEERING
(Autonomous)
Dundigal 500 043, Hyderabad