You are on page 1of 12

Software Introduction

5.2 SOFTWARE REQUIRED


KEIL COMPILER:

Keil compiler is software used where the machine language code is written and
compiled. After compilation, the machine source code is converted into hex code which
is to be dumped into the microcontroller for further processing. Keil compiler also
supports C language code.

PROLOAD:

Proload is software which accepts only hex files. Once the machine code is
converted into hex code, that hex code has to be dumped into the microcontroller and this
is done by the Proload. Proload is a programmer which itself contains a microcontroller
in it other than the one which is to be programmed. This microcontroller has a program in
it written in such a way that it accepts the hex file from the keil compiler and dumps this
hex file into the microcontroller which is to be programmed. As the proload programmer
kit requires power supply to be operated, this power supply is given from the power
supply circuit designed above. It should be noted that this programmer kit contains a
power supply section in the board itself but in order to switch on that power supply, a
source is required. Thus this is accomplished from the power supply board with an output
of 12volts.

KEIL COMPILER
Thank you for allowing Keil Software to provide you with software development tools
for 8051 based microcontrollers. With the Keil tools, you can generate embedded applications
for virtually every 8051 derivative. The supported microcontrollers are listed in the Vision

Device Database. The Keil Software 8051 development tools are designed for the
professional software developer, but any level of programmer can use them to get the most out of
the 8051 microcontroller architecture.
We are constantly adding new devices and simulation support for on-chip peripherals so be sure
to check web-based Device Database if your plan to use a device that is currently not listed in
your local Vision installation.
The Keil Software 8051 development tools listed below are programs you use to compile your C
code, assemble your assembly source files, link and locate object modules and libraries, create
HEX files, and debug your target program.

Vision is an Integrated Development Environment that combines project management,


source code editing, and program debugging in one single, powerful environment.

The Cx51 ANSI Optimizing C Cross Compiler creates relocatable object modules from
your C source code.

The Ax51 Macro Assembler creates relocatable object modules from your 8051 assembly
source code.

The BL51 Linker/Locator combines relocatable object modules created by the C51
Compiler and the A51 Assembler into absolute object modules.

The LX51 Extended Linker/Locator supports extended device variants and provides
additional features. LX51 supports all variants of the Cx51 Compiler and the Ax51
Assembler.

The LIBx51 Library Manager combines object modules into libraries that may be used
by the linker.

The OHx51 Object-HEX Converter creates Intel HEX files from absolute object
modules.

The RTX51 Tiny Real-time Operating System that simplifies the design of complex,
time-critical software projects.

Test Programs with the Vision Debugger


This chapter describes the Debug Mode of Vision and shows you how to use the user interface
to test a sample program. Also discussed are simulation mode and the different options available
for program debugging.

You can use Vision Debugger to test the applications you develop using the Cx51 Compiler and
Ax51 Macro Assembler. The Vision Debugger offers two operating modes that are selected in
the Options for Target Debug dialog.

Use Simulator allows to configure the Vision Debugger as software-only product that
simulates most features of the 8051 microcontroller without actually having target
hardware. You can test and debug your embedded application before the hardware is
ready. Vision simulates a wide variety of peripherals including the serial port, external
I/O, and timers. The peripheral set is selected when you select a CPU from the device
database for your target.

Use Debugger Drivers that connect the Vision Debugger directly to emulators,
Embedded ICE (On-chip Debug System) for example with the Keil ULINK USB-JTAG
Adapter.

Application Program Execution


Vision lets execute your application program in several different ways:

With the Debug Menu and Debug Commands.

With the Run till Cursor line command in the local context menu. The local context
menu opens with a right mouse click on the code line in the Editor or Disassembly
window.

In the Output Window Command page you can use the Go, Ostep, Pstep, and Tstep
commands.

Opcodes
The following table lists the 8051 instructions by HEX code.

Hex
Code

Bytes

Hex
Code

Bytes

00

NOP

80

01

AJMP

02

LJMP

addr11
addr16

03

04

RR
INC

05
06

2
1

07
08

Mnemonic

Operands

Mnemonic

Operands

SJMP

offset

81

AJMP

addr11

82

ANL

C, bit

83

MOVC

A, @A+PC

84

DIV

AB

INC

direct

85

MOV

direct, direct

INC

@R0

86

MOV

direct, @R0

INC

@R1

87

MOV

direct, @R1

INC

R0

88

MOV

direct, R0

09

INC

R1

89

MOV

direct, R1

0A

INC

R2

8A

MOV

direct, R2

0B

INC

R3

8B

MOV

direct, R3

0C

INC

R4

8C

MOV

direct, R4

0D

INC

R5

8D

MOV

direct, R5

0E

INC

R6

8E

MOV

direct, R6

0F

INC

R7

8F

MOV

direct, R7

10

JBC

bit, offset

90

MOV

direct, R8

11

ACALL

addr11

91

ACALL

addr11

12

LCALL

addr16

92

MOV

bit, C

13

RRC

93

MOVC

A, @A+DPTR

14

DEC

94

SUBB

A, #immed

15

DEC

direct

95

SUBB

A, direct

16

DEC

@R0

96

SUBB

A, @R0

17

DEC

@R1

97

SUBB

A, @R1

18

DEC

R0

98

SUBB

A, R0

19

DEC

R1

99

SUBB

A, R1

1A

DEC

R2

9A

SUBB

A, R2

1B

DEC

R3

9B

SUBB

A, R3

1C

DEC

R4

9C

SUBB

A, R4

1D

DEC

R5

9D

SUBB

A, R5

1E

DEC

R6

9E

SUBB

A, R6

1F

DEC

R7

9F

SUBB

A, R7

20

JB

bit, offset

A0

ORL

C, /bit

21

AJMP

addr11

A1

AJMP

addr11

22

RET

A2

MOV

C, bit

23

RL

A3

INC

DPTR

24

ADD

A, #immed

A4

MUL

AB

25

ADD

A, direct

A5

26

ADD

A, @R0

A6

MOV

@R0, direct

27

ADD

A, @R1

A7

MOV

@R1, direct

28

ADD

A, R0

A8

MOV

R0, direct

29

ADD

A, R1

A9

MOV

R1, direct

2A

ADD

A, R2

AA

MOV

R2, direct

reserved

2B

ADD

A, R3

AB

MOV

R3, direct

2C

ADD

A, R4

AC

MOV

R4, direct

2D

ADD

A, R5

AD

MOV

R5, direct

2E

ADD

A, R6

AE

MOV

R6, direct

2F

ADD

A, R7

AF

MOV

R7, direct

30

JNB

bit, offset

B0

ANL

C, /bit

31

ACALL

addr11

B1

ACALL

addr11

32

RETI

B2

CPL

bit

33

RLC

B3

CPL

34

ADDC

A, #immed

B4

CJNE

A, #immed, offset

35

ADDC

A, direct

B5

CJNE

A, direct, offset

36

ADDC

A, @R0

B6

CJNE

37

ADDC

A, @R1

@R0, #immed,
offset

38

ADDC

A, R0

B7

CJNE

@R1, #immed,
offset

B8

CJNE

R0, #immed, offset

B9

CJNE

R1, #immed, offset

BA

CJNE

R2, #immed, offset

BB

CJNE

R3, #immed, offset

BC

CJNE

R4, #immed, offset

BD

CJNE

R5, #immed, offset

BE

CJNE

R6, #immed, offset

BF

CJNE

R7, #immed, offset

C0

PUSH

direct

C1

AJMP

addr11

C2

CLR

bit

C3

CLR

C4

SWAP

C5

XCH

A, direct

C6

XCH

A, @R0

C7

XCH

A, @R1

C8

XCH

A, R0

C9

XCH

A, R1

CA

XCH

A, R2

CB

XCH

A, R3

39

ADDC

A, R1

3A

ADDC

A, R2

3B

ADDC

A, R3

3C

ADDC

A, R4

3D

ADDC

A, R5

3E

ADDC

A, R6

3F

ADDC

A, R7

40

JC

offset

41

AJMP

addr11

42

ORL

direct, A

43

ORL

direct, #immed

44

ORL

A, #immed

45

ORL

A, direct

46

ORL

A, @R0

47

ORL

A, @R1

48

ORL

A, R0

49

ORL

A, R1

4A

ORL

A, R2

4B

ORL

A, R3

4C

ORL

A, R4

4D

ORL

A, R5

4E

ORL

A, R6

4F

ORL

A, R7

50

JNC

offset

51

ACALL

addr11

52

ANL

direct, A

53

ANL

direct, #immed

54

ANL

A, #immed

55

ANL

A, direct

56

ANL

A, @R0

57

ANL

A, @R1

CC

XCH

A, R4

CD

XCH

A, R5

CE

XCH

A, R6

CF

XCH

A, R7

D0

POP

direct

D1

ACALL

addr11

D2

SETB

bit

D3

SETB

D4

DA

D5

DJNZ

direct, offset

D6

XCHD

A, @R0

58

ANL

A, R0

D7

XCHD

A, @R1

59

ANL

A, R1

D8

DJNZ

R0, offset

5A

ANL

A, R2

D9

DJNZ

R1, offset

5B

ANL

A, R3

DA

DJNZ

R2, offset

5C

ANL

A, R4

DB

DJNZ

R3, offset

5D

ANL

A, R5

DC

DJNZ

R4, offset

5E

ANL

A, R6

DD

DJNZ

R5, offset

5F

ANL

A, R7

DE

DJNZ

R6, offset

60

JZ

offset

DF

DJNZ

R7, offset

61

AJMP

addr11

E0

MOVX

A, @DPTR

62

XRL

direct, A

E1

AJMP

addr11

63

XRL

direct, #immed

E2

MOVX

A, @R0

64

XRL

A, #immed

E3

MOVX

A, @R1

65

XRL

A, direct

E4

CLR

66

XRL

A, @R0

E5

MOV

A, direct

67

XRL

A, @R1

E6

MOV

A, @R0

68

XRL

A, R0

E7

MOV

A, @R1

69

XRL

A, R1

E8

MOV

A, R0

6A

XRL

A, R2

E9

MOV

A, R1

6B

XRL

A, R3

EA

MOV

A, R2

6C

XRL

A, R4

EB

MOV

A, R3

6D

XRL

A, R5

EC

MOV

A, R4

6E

XRL

A, R6

ED

MOV

A, R5

6F

XRL

A, R7

EE

MOV

A, R6

70

JNZ

offset

EF

MOV

A, R7

71

ACALL

addr11

F0

MOVX

@DPTR, A

72

ORL

C, bit

F1

ACALL

addr11

73

JMP

@A+DPTR

F2

MOVX

@R0, A

74

MOV

A, #immed

F3

MOVX

@R1, A

75

MOV

direct, #immed

F4

CPL

76

MOV

@R0, #immed

F5

MOV

direct, A

77

MOV

@R1, #immed

F6

MOV

@R0, A

78

MOV

R0, #immed

F7

MOV

@R1, A

79

MOV

R1, #immed

F8

MOV

R0, A

7A

MOV

R2, #immed

F9

MOV

R1, A

7B

MOV

R3, #immed

FA

MOV

R2, A

7C

MOV

R4, #immed

FB

MOV

R3, A

7D

MOV

R5, #immed

FC

MOV

R4, A

7E

MOV

R6, #immed

FD

MOV

R5, A

7F

MOV

R7, #immed

FE

MOV

R6, A

FF

MOV

R7, A

All mnemonics Copyright 1980 Intel Corporation.


Copyright (c) Keil Software, Inc. and Keil Elektronik GmbH. All rights reserved.

Instructions
The following pages describe the 8051 instruction set. Instructions are listed in alphabetical
order and each is divided into several sections:
Description Describes the instruction's effect and describes any arguments.
See Also

Names related instructions.

Bytes

Lists the number of bytes required to encode the instruction.

Cycles

Lists the number of instruction cycles required to execute the instruction. Note
that there are 12 oscillator cycles to one instruction cycle on a standard 8051.

Encoding

Lists the byte encoding for the instruction.

Operation

Lists, step-by-step, the operations performed by the instruction.

Example

Shows proper use of the instruction.

Many instructions have required arguments that are described in the following table:

Argumen
t

Description

addr11

An 11-bit address destination. This argument is used by ACALL and AJMP instructions.
The target of the CALL or JMP must lie within the same 2K page as the first byte of the
following instruction.

addr16

A 16-bit address destination. This argument is used by LCALL and LJMP instructions.

bit

A direct addressed bit in internal data RAM or SFR memory.

direct

An internal data RAM location (0-127) or SFR (128-255).

immediate

A constant included in the instruction encoding.

offset

A signed (two's complement) 8-bit offset (-128 to 127) relative to the first byte of the
following instruction.

@Ri

An internal data RAM location (0-255) addressed indirectly through R0 or R1.

Rn

Register R0-R7.

Copyright (c) Keil Software, Inc. and Keil Elektronik GmbH. All rights reserved.

Simulation
The Vision3 Debugger incorporates a C script language you can use to create Signal Functions.
Signal functions let you simulate analog and digital input to the microcontroller. Signal
functions run in the background while Vision3 simulates your target program.
The Vision3 simulator simulates the timing and logical behavior of serial communication
protocols like UART, IC, SPI, and CAN. But Vision3 does not simulate the I/O port toggling
of the physical communication pins on the I/O port.
To provide fast simulation speed and optimum access to communication peripherals, the logic
behavior of communication peripherals is reflected in virtual registers that are listed with the
DIR VTREG command. This has the benefit that you can easily write debug functions that
stimulate complex peripherals.
Keil simulator contains several Signal function temples that you may use to simulate:

Digital Input

Push Button

Interrupt Signal

Impulse Patterns

Analog Input

Square Wave Signal

saw tooth signal

Sine Wave

Noise Signal

Signal Combination

UART Communication

CAN Communication

IC Communication

SPI Communication etc.

Vision, the popular IDE from Keil Software, combines Project Management, Source
Code Editing, Program Debugging, and Flash Programming in a single, powerful environment. +
Project Management, Device Setup, and Tool Configuration. + Target Debugging or CPU &
Peripheral Simulation. For experienced users, Vision3 adds new features such as Source
Outlining, Function Navigation, Editor Templates, Incremental Search, 2 Configuration Wizard,
Logic Analyzer, CAN and I C Simulation, Flash Programming, and JTAG Debugging.
This Quick Start guide gives you the information necessary to use Vision3 for your own
projects. It provides an overview of the most commonly used Vision3 features including: Editor
facilities for Creating, Modifying, and Correcting Programs.

Using On-Chip Peripherals


There are a number of techniques you must know to create programs that utilize the various
on-chip peripherals and features of the 8051 family. Many of these are described in this chapter.
You may use the code examples provided here to quickly get started working with the 8051.
There is no single standard set of on-chip peripherals for the 8051 family. Instead, 8051 chip
vendors use a wide variety of on-chip peripherals to distinguish their parts from each other. The
code examples in this chapter demonstrate how to use the peripherals of a particular chip or
family. Be aware that there are more configuration options than are presented in this text.

Startup Code

Special Function Registers

Register Banks

Interrupt Service Routines

Interrupt Enable Registers

Parallel Port I/O

Timers/Counters

Serial Interface

Watchdog Timer

D/A Converter

A/D Converter

Power Reduction Modes

Debugging
This chapter describes the Debug Mode of Vision3 and shows you how to use the user
interface to test a sample program. Also discussed are simulation mode and the different options
available for program debugging.
You can use Vision3 Debugger to test the applications you develop. The Vision3 Debugger
offers two operating modes that are selected in the Options for Target Debug dialog.

Use Simulator configures the Vision3 Debugger as software-only product that


simulates most features of a microcontroller without actually having target hardware. You
can test and debug your embedded application before the hardware is ready. Vision3
simulates a wide variety of peripherals including the serial port, external I/O, and timers.
The peripheral set is selected when you select a CPU from the device database for your
target.

Use Advanced GDI drivers, like the ULINK Debugger to interface to your target
hardware. For Vision3 various drivers are available that interface to:

JTAG/OCDS Adpater: which connects to on-chip debugging systems like the


ARM Embedded ICE.

Monitor: that may be integrated with user hardware or is available on many


evaluation boards.

Emulator: which connects to the CPU pins of the target hardware.

In-System Debugger: which is part of the user application program and provides
basic test functions.

Test Hardware: such as the Infineon SmartCard ROM Monitor RM66P or the
Philips SmartMX DBox.

Note

The Status Bar shows the current active debugging tool. In simulation mode, timing
statistic is provided.

ASSEMBLY INSTRUCTIONS:

Check the components supplied in the Kit against the Component list and identify
all the components.
It is generally best to solder the lowest height components first. Solder the
components in the following order:
Jumpers, resistors, diodes, IC base, transistors and other components.
Take care of terminals polarity while soldering diodes, LEDs and electrolytic
capacitors.
Identify the terminals of transistors and solder them in correct direction.
Connect the LCD with the help of 16-pin male-female work-strip connector.
Use flux cored lead to avoid dry solder ability.
Inspect the solder points against dry solder / excess solder

Now insert the preprogrammed microcontroller in the IC base firmly.


Adjust the 10K preset (near LCD) to correct contrast display level of LCD
Replace R18 with a jumper wire if the buzzer could not be driven.
Ensure the terminals of LM35 temperature sensors and solder in correct direction.
Ensure that the ac voltage to the kit is 12V. For this, use 230/12V step down
transformer with 500mA or more current rating.
Use heat sink for voltage regulator, if required.

You might also like