Sie sind auf Seite 1von 11

Experiment No.

2
Introduction to the softwares used in microcontroller & microprocessor lab.

Objectives :
The objective of this experiment is to get introduction of softwares used in microcontroller lab to implement it to different systems. In this experiment you will do the following. 1. Emu8086 2. Proteus

Emu8086 :

emu8086 is the emulator of 8086 (Intel and AMD compatible) microprocessor with integrated 8086 assembler and tutorials for beginners. The emulator runs programs like the real microprocessor in step-by-step mode. It shows registers, memory, stack, variables and flags. All memory values can be investigated and edited by a double click. The instructions can be executed in a regular forward direction and also in reverse direction. emu8086 can create a tiny operating system and write its binary code to a bootable floppy disk. This software package includes several virtual external devices: robot, stepper motor, led display, and traffic lights intersection. Virtually anyone with any programming experience can design animated virtual devices in assembly language or in any other programming language. All devices are open for modifications and cloning (source code is available). All communications between the microprocessor

and devices is coming through this file: c:\emu8086.io, to emulate in/out instructions it's just required to change corresponding bytes in this binary file

Proteus

PROTEUS VSM allows professional engineers to run interactive simulations of real designs, and to reap the rewards of this approach to circuit simulation. And then, a range of simulator models for popular micro-controllers and a set of animated models for related peripheral devices such as LED and LCD displays, keypads, an RS232 terminal and more. It is possible to simulate complete micro-controller systems and thus to develop the software for them without access to a physical prototype. In a worldwhere time to market is becoming more and more important this is a real advantage. Structurally, Proteus 6 Professional separated into two main components, which are ISIS 6 Professional and ARES 6 Professional. ISIS 6 Professional mainly involved on circuit designing and simulation

DATE: SIGNATURE:

Experiment No.3:
Introduction to the instruction set in emu8086.

Objective :
The objective is to get the introduction to the instructions AAA, CMP, ADC, CLC, ADD, SUB. 1. AAA It works according to the following Algorithm: if low nibble of AL > 9 or AF = 1 then: AL = AL + 6 AH = AH + 1 AF = 1 CF = 1 else AF = 0 CF = 0 in both cases: clear the high nibble of AL.

2. CMP Compare. Algorithm: operand1 - operand2 result is not stored anywhere, flags are set (OF, SF, ZF, AF, PF, CF) according to result.

3. ADC operand1 = operand1 + operand2 + CF

4. CLC Clear Carry flag. Algorithm: CF = 0 5. ADD Add. Algorithm: operand1 = operand1 + operand2

6. SUB Subtract. Algorithm: operand1 = operand1 - operand2

DATE SIGNATURE

Experiment No.4: Introduction to the instruction set in emu8086. Objective : The objective is to get the introduction to the instructions AAD, DEC, AND, RET, JUMP, MUL,DIV 1. AAD: Algorithm: AL = (AH * 10) + AL AH = 0

2.

DEC: Decrement. Algorithm: operand = operand 1

3. AND: Logical AND between all bits of two operands. Result is stored in operand1. These rules apply: 1 AND 1 = 1 1 AND 0 = 0 0 AND 1 = 0 0 AND 0 = 0

4.

RET: Return from near procedure. Algorithm: Pop from stack: IP if immediate operand is present: SP = SP + operand

5. JUMP:

Unconditional Jump. Transfers control to another part of the program.4-byte address may be entered in this form: 1234h: 5678h, first value is a segment second value is an offset. Algorithm: always jump

6.

MUL: Algorithm: when operand is a byte: AX = AL * operand. when operand is a word: (DX AX) = AX * operand.

7. DIV:

Algorithm: when operand is a byte: AL = AX / operand AH = remainder (modulus) when operand is a word: AX = (DX AX) / operand DX = remainder (modulus)

DATE: SIGNATURE:

Experiment No.5: Introduction to the instruction set in emu8086. Objective : The objective is to get the introduction to the instructions JLE, LOOP, LOOPZ, NOT, PUSH, STC 1. JLE:

Short Jump if first operand is Less or Equal to second operand (as set by CMP instruction). Signed. Algorithm: if SF <> OF or ZF = 1 then jump

2.

LOOP: Decrease CX, jump to label if CX not zero. Algorithm: CX = CX - 1 if CX <> 0 then jump else no jump, continue

3.

LOOPZ: Algorithm: CX = CX - 1 if (CX <> 0) and (ZF = 1) then jump else no jump, continue

4. NOT: Algorithm: if bit is 1 turn it to 0. if bit is 0 turn it to 1.

5.

PUSH: Algorithm: SP = SP - 2 SS:[SP] (top of the stack) = operand

6. STC: Set Carry flag. Algorithm: CF = 1 DATE: SIGNATURE:

EXPERIMENT N0.6 Introduction to microcontroller software keil (2 EDITION) Introduction Keil MicroVision is an integrated development environment used to createsoftware to be run on embedded systems (like a microcontroller). It allows for suchsoftware to be written either in assembly or C programming languages and for thatsoftware to be simulated on a computer before being loaded onto the microcontroller. Vision2 is an IDE (Integrated Development Environment) that helps write,compile, and debug embedded programs. It encapsulates the following components: A project manager. A make facility. A Tool configuration. An Editor. A powerful debugger.

STEPS FOLLOWED IN CREATING AN APPLICATION IN uVision2: To create a new project in uVision2: 7. Select Project - New Project. 8. Select a directory and enter the name of the project file. 3. Select Project Select Device and select a device from Device Database. 4. Create source files to add to the project 5. Select Project - Targets, Groups, and Files. Add/Files, select Source Group1, and add the source files to the project. 6. Select Project - Options and set the tool options. Note that when the target device is selected from the Device Database all-special options are set automatically. Default memory model settings are optimal for most applications. 7. Select Project - Rebuild all target files or Build target To create a new project, simply start Micro Vision and select Project=>New Project from the pulldown menus. In the file dialog that appears, choose a name and base directory for the project. It is recommended that a new directory be created for each project, as several files will be generated. Once the project has been named, the dialog shown in the figure below will appear, prompting the user to select a target device. In this lab, the chip being used is

the AT89S52, which is listed under the heading Atmel.

Next, Micro Vision must be instructed to generate a HEX file upon programcompilation. A HEX file is a standard file format for storing executable code that is tobe loaded onto the microcontroller.In the Project Workspace pane at the left, rightclick on Target 1 and selectOptions for Target 1 .Under the Output tab of the resulting options dialog,ensure that both the Create Executable and Create HEX File options are checked.Then click OKas shown in the two figures below.

DATE: SIGNATURE:

Das könnte Ihnen auch gefallen