You are on page 1of 41

DEPARTMENT OF ECE

NORTH WEST INSTITUTE OF ENGG. & TECH. Final report


On MICROCONTROLLERS: ARCHITECTURE, PROGRAMMING AND INTERFACING

SUBMITTED AS A PART OF SIX WEEKS INSTITUTIONAL TRAINING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGG.

SUBMITTED TO: HOD SIR ER. VIKAS ARORA

SUBMITTED BY: HARWINDER SINGH ECE (5th SEM) 90510414068

HARWINDER SINGH

90510414068

DEPARTMENT OF ECE

ACKNOWLEDGEMENT
I, HARWINDER SINGH Student of NORTH WEST INSTITUTE OF ENGINEERING & TECNOLOGY majoring in ELECTRONICS & COMMUNICATIONS ENGINEERING (5th semester) express my heartfelt thanks to our Training & Placement Officers for providing us their valuable guidance & sharp vision to undertake this six months industrial training. Training in an institute like CDAC which is fuelled by the individuals with so much zest & energy, teaming up to form a formidable force, was in itself a true learning experience which is going to help us immensely in our career. There is no substitute to Teamwork, this is one of the many lessons I learnt during our training in CDAC. I would like to thank and express my gratitude towards the personalities who have helped me to undertake and complete this project. First and foremost I express my gratitude towards institute faculty. The technical expert and development engineers for their support during my training. They provided me valuable guidance and technical skill in completing this course and without which this training would not have been possible. I would also like to acknowledge my teachers who have given me the basic concepts of Course. Thank you to all for encouraging me every step of the way. I am deeply indebted to my HOD ER.VIKAS ARORA and to coordinator whose help, stimulating suggestions and encouragements were always with me.

HARWINDER SINGH

90510414068

DEPARTMENT OF ECE

CERTIFICATE
This is to certify that the work presented in the report

MICROCONTROLLERS:ARCHITECTURE,PROGRAMMING AND INTERFACING is a complete record of the work done during the period from 6th June, 2011 to 15th July 2011 at CENTRE FOR DEVELOPMENT OF ADVANCED COMPUTING(CDAC), Mohali by Harwinder Singh, with university roll no:90510414068. The project work is authentic record of my work and is carried under the supervision and guidance of institute teachers. The matter presented in the report has not been submitted elsewhere, wholly or in part, for the award of any other degree or diploma.

HARWINDER SINGH 90510414068

HARWINDER SINGH

90510414068

DEPARTMENT OF ECE

TABLE OF CONTENTS
TITLE: 1 ARCHITECTURE 1.1 Introduction
1.2 Microcontroller

PAGE NO:

6-7 8
8

1.3 Microcontroller V/S microprocessor 1.4 Features of 8051 microcontroller 1.5 Block diagram of microcontroller 1.6 Pin configuration of 8051 1.7 Pin description of 8051 1.8 Diagram of microcontroller 1.9 Special function registers 1.10 Memory 1.10A internal memory 1.10B External memory 2 PROGRAMMING 2.1 Addressing modes 2.2 Types of addressing modes

9 10 11 12-13 14 15-16 16 16-18 19

20 20-22

HARWINDER SINGH

90510414068

DEPARTMENT OF ECE

2.3 Figures Showing Stepwise Execution Of The Program

22-30

3 INTERFACING
3.1 keyboard interfacing 3.2 seven segment display 3.3 LCD interfacing 31-34 35-37 37-40

LIST OF FIGURES: Block Diagram of Microcontroller Pin Configuration Of 8051 Internal RAM Structure On Chip Memory Working On file With Simulator Lead Per Key Keyboard X-Y Matrix keyboard Coaded Keyboard Keyboard Configuration For Getkey And Inkey Common Cathode Configuration Of SSD Interfacing Of seven Segment Display Diagrams Of Interfacing Of LCD 10 11 14 19 22-30 31 32 33 34 36 37 38

HARWINDER SINGH

90510414068

DEPARTMENT OF ECE

1. ARCHITECTURE
1.1 INTRODUCTION
Circumstances that we find ourselves in today in the field of microcontrollers had their beginnings in the development of technology of integrated circuits. This development has made it possible to store thousands of transistors into one chip. That was a prerequisite for production of microprocessors, and the first computers were made by adding external peripherals such as memory, input-output lines, timers and other. Further increasing of the volume of the package resulted in creation of integrated circuits. These integrated circuits contained both processor and peripherals. That is how the first chip containing a microcomputer, or what would later be known as a microcontroller came about. An embedded computer is a computer that is a component of a larger system; it helps implement the system functionality. Embedded computers exist in automobiles, airplanes, home appliances, military vehicles & equipments, medical devices, robotic, mobile communication system etc. Sophisticated embedded computers have been used in products and systems for over twenty years. Embedded computing includes several aspects: methodology, architectures, and applications which is practiced in conducting research. Methodology is important because the prime goal is to be able to reliably, predictably develop new systems. Embedded computers is used to make a wide variety of systems, therefore methodology of designing an embedded system that enable assessment of a system requirements, develop an architecture, and implement the embedded system is very important. Architecture is used here in a broad sense: both software and hardware. Early decisions can make or break a design. It is important to get the structure of the software and hardware right at the architectural stage in order to avoid expensive problems later in the design process. This

HARWINDER SINGH

90510414068

DEPARTMENT OF ECE

generally means jointly considering the effects of architectural decisions on both the hardware and software sides of the implementation. Applications are the motivation for embedded computing. It is important to take application characteristics into account during the design of an embedded system, and also important to understand at least one application area well in order to do the best research in embedded computing.

In summary Embedded Computing research cluster involve in enhancing knowledge and creating technologies in hardware & software design techniques through a combination of related fundamental and applied research projects. So in nutshell, an embedded systerm is the relating of hardware part wiyh the software or programming portion .Embedded systems are designed to perform dedicated tasks.It basically has main components like microcontroller or a microprocessor. A microcontroller is a programmable logic and integrated circuit which can be used to do a number of tasks. It is possible to just control about anything with the program written by the user. Whereas a microcontroller differs from a microprocessor, which is a general purpose chip , used to create a multifunction computer or a device and requires multiple c hips to handle various tasks. A microcontroller is meant to be mire self contained and independant, and functions as a tiny dedicated computer.

Objective:
The objective is to explore the details of embedded computing aspects which are the Methodology, Architecture and Application. This will enable cutting edge technology development in hardware and software through embedded system applications development.

HARWINDER SINGH

90510414068

DEPARTMENT OF ECE

1.2WHAT IS A MICROCONTROLLER?
As the name suggests, microcontroller means small computers. Microcontrollers are used for embedded system i.e. system on a chip. They are like single chip computers that are often embedded into other systems to function as controlling unit. So a microcontroller can be called as an on chip computer. In an embedded system, the microprocessor or a microcontroller is assigned the duty of completing only one job at a time. So unlike a PC, it cannot do multi-tasking because it consists of a RAM memory and an operating system that loads the application software into the RAM, so that CPU can execute it. In an embedded system, only one applications software is burned onto the ROM. Examples of embedded system using microcontrollers are cell phones, camera, printers, video games etc.

1.3 MICROCONTROLLER V/S MICROPROCESSOR:


The microprocessor is the central processing unit of a general purpose digital computer. They can address megabites on it and can operate on 8, 16, or 32 bit data. It consist of an ALU, accumulator, working registers, program counter, stack pointer, clock and interrupt circuit. The microprocessor alone is not a complete digital computer. In order to make it a complete computer, one should add memory devices like RAM, ROM, EPROM, EPROM, PROM, decoders, I/O devices and display counter to it. It can have a small as well as the large configuration as per the requirement dependiong upon the size of the application of the user. For a small application the minimum size of memory and I/O must be interfaced to the cpu.this increases the hardware. In turn the pcb size and cost of system also increases. In order to avoid these drawbacks,MICROCONTROLLERS were developed. The

microcontroller is an on chip true computer. It is optimized for specific applications. It vconsists of all the features of a microprocessor as well as the features required to build a complete computer.

HARWINDER SINGH

90510414068

DEPARTMENT OF ECE

The key features of microcontrollers include: High Integration of Functionality Microcontrollers sometimes are called single-chip computers because they have onchip memory and I/O circuitry and other circuitries that enable them to function as small standalone computers without other supporting circuitry. Field Programmability, Flexibility Microcontrollers often use EEPROM or EPROM as their storage device to allow field programmability so they are flexible to use. Once the program is tested to be correct then large quantities of microcontrollers can be programmed to be used in embedded systems. Easy to Use

Assembly language is often used in microcontrollers and since they usually follow RISC architecture, the instruction set is small. The development package of microcontrollers often includes an assembler, a simulator, a programmer to "burn" the chip and a demonstration board. Some packages include a high level language compiler such as a C compiler and more sophisticated libraries.

1.4 FEATURES OF 8051 MICROCONTROLLER


8 bit CPU optimized for control applications. Extensive Boolean processing capabilities. 4KB of on chip memory. 128 bytes of on chip data memory. Four 8bits Input Output ports. 64KB program external ROM and 64KB external RAM ability. Two 16 bit Timer/Counter. Four register banks. On chip oscillator and clock circuit.

HARWINDER SINGH

90510414068

DEPARTMENT OF ECE

Most microcontrollers will also combine other devices such as:


A Timer module to allow the microcontroller to perform tasks for certain time periods. A serial I/O port to allow data to flow between the microcontroller and other devices such as a PC or another microcontroller. An ADC to allow the microcontroller to accept analogue input data for processing.

1.5 BLOCK DIAGRAM OF A MICROCONTROLLER

HARWINDER SINGH

10

90510414068

DEPARTMENT OF ECE

FIGURE 1: Block Diagram Of A Microcontroller

1.6 PIN CONFIGURATION OF 8051

FIGURE 2: Pin Configuration Of 8051

HARWINDER SINGH

11

90510414068

DEPARTMENT OF ECE

1.7 PIN DESCRIPTION OF 8051

8051 is a 40 pin IC. It has 4 ports, port 0, port1, port2, port3 which can be assessed as I/O ports. Its pin description is given as:

Vcc: It is the supply voltage. GND: Ground Port 0: Port v0 is an 8 bit bidirectional I/O port. When 1s are written to port 0 pins, the
pins can be used as high impedance inputs. Port 0 also receives the code bytes during flash programming program verification.

Port 1: Port 1 is an 8 bit bidirectional I/O port with internal pull ups. When 1s are
written to port 1 pins are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 1 pins that are externally being pulled low will source pull ups because of internal pull ups.

Port 2: Port 2 is an 8 bit bidirectional I/O port with internal pull ups. When 1s are
written to port 2 pins are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 2 pins that are externally being pulled low will source pull ups because of internal pull ups.

Port 3: Port 2 is an 8 bit bidirectional I/O port with internal pull ups. Port 3 also serves
various other functions which are as follows:

P3.0: RXD (serial input port) P3.1: TXD (serial output port)

HARWINDER SINGH

12

90510414068

DEPARTMENT OF ECE P3.2: INT0 (external interrupt) P3.3: INT1 ((external interrupt) P3.4: T0 (Timer/Counter 0 external input) P3.5: T1 (Timer/Counter1external input) P3.6: WR (external data memory write strobe) P3.7: RD (external data memory read strobe) Port 3 also receives some control signals for flash programming and program verifications.

RST (reset input): a high on this input pin for two machine cycles, while the oscillator is
running resets the device. ALE/PROG: Address latch enable which is used to access the address locations from external memory. PSEN: Program store enable which is used for storing programming code into the external memory.

EA/VPP: External accesses enable. EA must be strapped to ground in order to enable


the device to fetch code from external memory locations starting from 0000H to 0FFFH. EA should be strapped to VCC for fetching from internal program memory.

XTAL1: input to inverting oscillator amplifier and input to internal clock operating
circuit.

XTAL2: output from the inverting oscillator amplifier .a crystal may be connected
between XTAL1 and XTAL2 pins.

ARCHITECTURE OF 8051:
It consists of the following: 1. Eight bit registers A (accumulator) and Register B. 2. Arithmetic and Logic operations. 3. 16 bit Program counter (PC). 4. 8 bit Program Status Word (PSW). 5. 8 bit Stack Pointer (SP). HARWINDER SINGH 13 90510414068

DEPARTMENT OF ECE

6. 128 byte Internal RAM and $KB Internal ROM. 7. Four 8 bit ports: Port 0, Port1, Port 2, Port 3. 8. Two 16 bit Timer/Counter, serial port and interrupt control. 9. Control Registers. 10. On chip Oscillators.

1.8 Diagram of 8051:

HARWINDER SINGH

14

90510414068

DEPARTMENT OF ECE

FIGURE 3: Block Diagram Of 8051

1.9 SPECIAL FUNCTION REGISTERS: ACCUMULATOR (ACC): ACC is an 8 bit register. It is most versatile and holds source
operand and receives the result of arithmetic operations including addition, subtraction,

HARWINDER SINGH

15

90510414068

DEPARTMENT OF ECE

multiplication, division and Boolean bit manipulations. It is also used for data transfer between 8051 and external memory. Several functions like rotate, swap etc apply specifically on accumulator.

B REGISTER: The B register is used with A register for multiplication and division
operations. For other operations, it is used as a scratch pad register.

ARITHMETIC AND LOGIC UNIT: The ALU can perform arithmetic and logic
operations on eight bit data. It can perform operations like addition, subtraction, multiplication, division and logical operations like AND, OR, EX-OR, complement, rotate etc.

PROGRAM STATUS WORD (PSW) AND FLAGS: Many instructions affect the status
flags. In order to address these flags conveniently they are grouped as Program Status Word.

Figure 1.4: Program Status Word Register So it contains several status bits that reflect the current status of CPU. PSW resides in SFR space. It contains the carry bit, the auxiliary carry (for BCD operations), the two register bank select bits, the overflow flag, a Parity bit, and two user definable status flags. The carry bit, other than serving the function of carry bit, it also serves as the accumulator for a number of Boolean operations. The bits RS0 and RS1 are used to select one of the four register banks. The parity bit reflects the number of 1s in the accumulator: P=1 if the accumulator contains an odd number of 1s, and P=0 if the accumulator contains an even number of 1s. Thus the number of 1s in the accumulator plus P is even number. The two bits in the PSW are uncommitted and may be used as general purpose status flags.

PROGRAM COUNTER: It is a 16 bit register. It is used hold the address of a instruction in


the memory. It keeps the track of the execution of the program. The program instruction bytes arte fetched from locations in the memory that are addressed by the program counter. Whenever HARWINDER SINGH 16 90510414068

DEPARTMENT OF ECE

the power supply is switched ON, the PC resets to 0000H. In case of instructions like jump, call, interrupt the contents of PC may change. PC is just a register. It does not have any internal address.

DATA POINTER: is a 16 bit register. It is used hold the address of a data in the memory. The
DPTR can be assessed separately as lower eight bits (DPL) and higher eight bits (DPH) . It can be used as a 16 bit data register or two independent 8 bit registers. The DPTR does not have a single internal address instead DPL and DPH are assigned a separate address.

STACK AND STACK POINTER: The stack pointer registers Is 8 bits wide. It is
incremented before the data is stored during PUSH and CALL executions. While the stack may reside anywhere in the ON CHIP RAM, the stack pointer is initialized to 07H after a reset. This causes the stack to begin at the location 08H.

1.10 MEMORY: 1.10: INTERNAL MEMORY:


8051 has 128 byte internal RAM. This internal RAM is organized in three distinct areas: 1. Four register banks of 8 bytes each 2. Bit addressable area of 16 bytes 3. General purpose RAM area (scratch pad area) The internal memory RAM is shown below in figure1.5.

HARWINDER SINGH

17

90510414068

DEPARTMENT OF ECE

Figure 4: INTERNAL RAM STRUCTURE

HARWINDER SINGH

18

90510414068

DEPARTMENT OF ECE

I.

Four Register Banks Of 8 Bytes Each: There are four register banks which are
numbered from 0 to 3. Each bank is made up of eight registers R0 to R7. In total 32 bytes or 32 working g registers from address 00H to1FH organized as four register banks. For selecting a register bank two bits RS0 and RS1 are provided in PSW. If any of the register banks is not selected, then the programmer can use the area from 00H to 1FH as simple scratch pad RAM or general purpose RAM.

II.

Bit Addressable Area Of 16 Bytes: The microcontroller has reserved 16 bytes of


internal RAM whose address ranges from 20H to 2FH. These 16 bytes provide us with 128 bytes forming addressable bits. The microcontroller has given address to those bits ranging from 00H to 7FH. Hence these addresses are called BIT ADDRESSABLE LOCATIONS.

III.

General Purpose Ram Area: This RAM is also called as SCRATCH PAD RAM. It
lies above the bit addressable area and has address 30H to 7FH. This RAM area can be used as data RAM. The memory in this area is byte addressable. The programmer may declare stack in this area provided sufficient numbers of bytes are available.

USES OF INTERNAL RAM:


It is not essential to utilize the entire area of internal Ram of microcontroller as scratch pad. The microcontroller has instructions that allow the internal memory locations to be used as data pointers. The registers R0 and R1 in the four register banks can be used as pointers to point the internal RAM as well as external RAM.

INTERNAL ROM:
The microcontroller has separate memory for the program and data. Both these memories have same address ranges. The internal ROM is used to store the internal program code. It occupies the address space ranging from 0000H to 0FFFH. For the addresses higher than 0FFFH, the 8051 will automatically fetch the code bytes from an external memory.

HARWINDER SINGH

19

90510414068

DEPARTMENT OF ECE

1.10B: EXTERNAL MEMORY:


External memory is used in cases when the internal RAM and ROM memory available on the chip are not sufficient. Two separate external memory spaces are available by the 16bit PC and the DPTR and by different control pins for enabling external ROM and RAM chips. If the 128 bytes of internal RAM is insufficient, then external RAM is assessed by the DPTR. In the 8051 family, external RAM of up to 64KB can be added to any chip

FIGURE5:ON CHIP MEMORY

HARWINDER SINGH

20

90510414068

DEPARTMENT OF ECE

2 PROGRAMMING: 2.1ADRESSING MODES


A computer spends more time moving data from one location to another than it spends on any other operation. So more instructions are provided for moving data than any other operation. When the microcontroller executes an instruction, it performs specific function on the data. Data is stored at the source address and moved (actually copied) at the destination address. The ways by which these addressing modes are specified are known as addressing modes. In 8051, the destination address is written first, followed by the source address.

2.2TYPES OF ADRESSING MODES:


Copying data from source to destination may be divided into three main types: 1. MOV destination , source 2. PUSH source or POP destination 3. XCH destination ,source

Now there are four types of addressing modes, which are as follows; 1. Immediate addressing mode 2. Register addressing mode 3. Direct addressing mode 4. Indirect addressing mode

1. IMMEDIATE ADDRESSING MODE: This method is the simplest method to get the
data. In this addressing mode, the source operand is a constant rather than a variable. As the data is a part of instruction, it is immediately available. The # sign indicates that the data is immediate operand. EXAMPLE:

HARWINDER SINGH

21

90510414068

DEPARTMENT OF ECE

MOV A, #30H MOV P1, #0FFH MOV DPTR, #111H

2. REGISTER ADDRESSIN MODE: Certain register names can be used as a part of


opcode mnemonic as source or destinations of data. Each register bank consists of registers R0 to R7. Registers A, DPTR, R0 to R7 may be named as a part of opcode mnemonic. To access these registers, there are special instructions. In REGISTER ADDRESSING MODE, the instructions refer to a specific register such as Accumulator or DPTR. EXAMPLE: MOX Rn, A MOV DPL, R6 MOV A, R4

3. DIRECT ADDRESSING MODE: Although the entire 128 bytes of RAM can be
accessed using direct addressing mode, it is often used to access the RAM location 30-7FH. EXAMPLE: MOV R0, 40H MOV 56H, A MOV A, 4

4. INDIRECT ADDRESSING MODE: In Indirect Addressing Mode, the instruction


specifies a register which contains address of an operand i.e the register holds the actual address

HARWINDER SINGH

22

90510414068

DEPARTMENT OF ECE

which holds the actual address that will be used in data move operation. The address may be 8 bit or 16 bit address. In this addressing mode, only R0 and R1 registers are used. The @ sign indicates the register acts as a pointer to the memory location. EXAMPLE: MOV R0, #05H MOV @R0, #30H 2.3Now the stepwise execution is shown in figures as below:

FIGURE6 : OPENING A NEW FILE

HARWINDER SINGH

23

90510414068

DEPARTMENT OF ECE

FIGURE7: WRITING PROGRAM ON FILE

HARWINDER SINGH

24

90510414068

DEPARTMENT OF ECE

FIGURE8: ASSEMBLING THE PROGRAM WRITTEN

HARWINDER SINGH

25

90510414068

DEPARTMENT OF ECE

FIGURE9: ERROR CHECK AND WARNINGS

HARWINDER SINGH

26

90510414068

DEPARTMENT OF ECE

FIGURE10: CHOOSING THE REGISTERS

HARWINDER SINGH

27

90510414068

DEPARTMENT OF ECE

FIGURE11: SHOWING THAT THE INITIAL VALUE IN TMOD IS 00000000

HARWINDER SINGH

28

90510414068

DEPARTMENT OF ECE

FIGURE12: STARTING THE SIMULATOR TO PERFORM THE DESIRED FUNCTION

HARWINDER SINGH

29

90510414068

DEPARTMENT OF ECE

FIGURE13: MOVING VALUE 11 TO TMOD REGISTER

HARWINDER SINGH

30

90510414068

DEPARTMENT OF ECE

FIGURE14: MAKING THE BIT 0 OF PORT 3 0 AND MOVING 1 TO R6

HARWINDER SINGH

31

90510414068

DEPARTMENT OF ECE

3 INTERFACING:
Interfacing means connecting the hardware devices like keyboard, seven segment display and relays etc to see if how they work on connection with the microcontroller. Some interfacings are as follows: 1. Keyboard interfacing 2. Seven segment display 3. LCD interfacing 3.1KEYBOARDS INTERFACING: It is a human oriented input peripheral. It is used to input data or program into the microcomputer. It consists of push button type switches. When a key is pressed, the microcontroller identifies key depression and then performs the appropriate operation. HUMAN FACTORS: The keyboard application program must guard against the following possibilities: More than one key pressed Key pressed and held Rapid key pressed All these conditions can be addressed by hardware as well as software which is more cost effective also. Hypothetical keyboard writing configurations are shown as below:

HARWINDER SINGH

32

90510414068

DEPARTMENT OF ECE

FIGURE 15: LEAD-PER-KEY KEYBOARD

FIGURE 16:X-Y MATRIX KEYBOARD

HARWINDER SINGH

33

90510414068

DEPARTMENT OF ECE

FIGURE 17: CODED KEYBOARD

HARWINDER SINGH

34

90510414068

DEPARTMENT OF ECE

FIGURE18: KEYBOARD CONFIGURATION FOR GETKEY AND INKEY

HARWINDER SINGH

35

90510414068

DEPARTMENT OF ECE

3.2SEVEN SEGMENT NUMERIC DISPLAY:


It contains LED segments arranged as an 8 with one common lead and seven individual leads for each segment. Below is the figure shown of a seven segment LED display:

Seven segment display is of two types; Common cathode Common anode COMMON CATHODE: The cathodes of all LEDs are given as a common pin. In this case, the anode is connected to the port pins. This method requires port pins to source large current. But 8051 cannot source current beyond 2mA. COMMON ANODE: The anodes of all the LEDs are given as common pin. In this case the cathode is connected to the port pins. Hence port pins have to sink current of 20mA Hence we use common anode SSD and connect 8051 in this configuration.

HARWINDER SINGH

36

90510414068

DEPARTMENT OF ECE

FIGURE 19:COMMON CATHODE SEGMENT CIRCUIT Program For Seven Segment Display: org 00h Mov a, #00H Back: mov P0, a Inc a Acall delay Cjne a, #09h, back Sjmp back Delay: mov r0, #eff H Mov r1, #066H Mov r2, #0ffH Here: djnz r1, here Here 2: djnz r2, here2 Djnz r0, here1 Ret End

HARWINDER SINGH

37

90510414068

DEPARTMENT OF ECE

FIGURE 20:SEVEN SEGMENT DISPLAY CIRCUIT USED FOR SEVEN SEGMENT PROGRAM

3.3LCD INTERFACING: LCD displays are widely used because of low current consumption as compared to SSD. Also LCD can be used to display any character as it uses 5*7 dot matrix to display.

HARWINDER SINGH

38

90510414068

DEPARTMENT OF ECE

FIGURE21: Intelligent LCD

FIGURE22: INTELLIGENT LCD FOR LCDISP PROGRAM

HARWINDER SINGH

39

90510414068

DEPARTMENT OF ECE Program To Display CDAC on LCD Org 00H Mov a,#34H Acall commwrt Acall datawrt Acall delay Mov a, #C Acall commwrt Acall datawrt Acall delay Mov a, #D Acall commwrt Acall datawrt Acall delay Mov a, #A Acall commwrt Acall datawrt Acall delay Mov a, #c Commwrt: mov P1, a Clr P2.0 Clr P2.1 Clr P2.2 Setb P2.1

HARWINDER SINGH

40

90510414068

DEPARTMENT OF ECE

Clr p2.2 Ret Datawrt: mov P1,a Clr P2.0 Clr P2.1 Setb P2.1 Clr p2.2 Ret Delay: mov a,82H

HARWINDER SINGH

41

90510414068

You might also like