Dc Motor Control Using 8085

60
DC MOTOR CONTROL USING MICPROPROCESSOR 8085

Transcript of Dc Motor Control Using 8085

Page 1: Dc Motor Control Using 8085

DC MOTOR CONTROL USING MICPROPROCESSOR 8085

Page 2: Dc Motor Control Using 8085

CONTENTS1. ACKNOWLEDGEMENT

2. CERTIFICATE

3. PROJECT OUTLINE

4. MICROPROCESSOR 8085

5. DC MOTOR

6. PROGRAMMABLE PERIPHERAL INTERFACE 8255

7. DIGITAL TO ANALOG CONVERTER DAC-0800

8. DPDT RELAY SWITCH

9. ULN2003 DARLINGTON ARRAY

10. CIRCUIT ANALYSIS AND PROGRAMMING

11. REFERENCES

ACKNOWLEDGEMENT

2

Page 3: Dc Motor Control Using 8085

I would like to extend my heartfelt regards and thanks to the entire department of electronics at Sri Venkateshwara College for giving us their invaluable support and encouragement during the course of our project. It was due to their support that the project was successful.

I would also like to extend a special note of thank you to Dr. Neeru Kumar for lending her support as well in the success of our project.

CERTIFICATE

3

Page 4: Dc Motor Control Using 8085

This is to certify, that the project entitled “DC motor control using processor 8085” is the bonafide work carried out by) student of BSc. Honours, Sri Venkateswara College, New Delhi, during the year 2011, in partial fulfillment of the requirements for the award of the Degree of Bachelor of Electronics Honours and that the project has not formed the basis for the award previously of any degree, diploma, associateship, fellowship or any award previously of any other similar title.

Place:

Date:

4

Page 5: Dc Motor Control Using 8085

PROJECT OUTLINEDirect current (DC) motors have been widely used in many industrial applications such as electric vehicles, steel rolling mills, electric cranes, and robotic manipulators due to precise, wide, simple, and continuous control characteristics.Interfacing and controlling of a simple DC motor is an interested subject to many hobbyists and engineers, many of them used DC motor to move mechanical part, automated task, or just for fun and learning. In this project, we have built an interfacing circuit to control the speed and direction of any DC drive.A permanent magnet DC motor responds to both voltage and current. The steady state voltage across a motor determines the motor’s running speed, and the current through its armature windings determines the torque. Apply a voltage and the motor will start running in one direction; reverse the polarity and the direction will be reversed. If you apply a load to the motor shaft, it will draw more current, if the power supply does not able to provide enough current, the voltage will drop and the speed of the motor will be reduced. However, if the power supply can maintain voltage while supplying the current, the motor will run at the same speed. In general, you can control the speed by applying the appropriate voltage, while torque is controlled by current.

SPEED CONTROL OF DC MOTOR

Consider what happens when a voltage applied to a motor’s windings is rapidly turned ON and OFF in such a way that the frequency of the pulses produced remains constant, but the width of the ON pulse is varied. This is known as Pulse Width Modulation (PWM). Current only flows through the motor during the ON portion of the PWM waveform. If the frequency of the PWM input is high enough, the mechanical inertia of the motor cannot react to the ripple wave; instead, the motor behaves as if the current were the DC average of the ripple wave. Therefore, by changing the width of pulse, we can control the motor speed.

5

Page 6: Dc Motor Control Using 8085

The PWM output can be easily obtained from the output of the DAC interfaced to microprocessor 8085 by changing its input b/w two levels for eg FFH and 00H continuously. By this way we can obtain the output waveform of any manner (pulsed, staircase, square, sinusoidal), simply by changing the delays b/w two inputs or by changing the input itself. The DAC which is being used in our project is DAC0800 which has maximum output of 5v if its input is FFH and 0v if input is 00H but the max output current of this 50 mA which is not sufficient enough to drive the motor. Therefore, we have used IC ULN2003 in our circuit which is nothing but Darlington arrays to provide the output of DAC sufficient current gain to drive the motor.

One important thing to note here is that the DAC output simply without pulses or any variations can drive the motor if given sufficient current gain but in that case we won’t have enough flexibility in controlling the speed of motor, i.e. the range of speed control is very large if we use pulsed output instead of fixed DC voltage from the output of DAC.

DIRECTION CONTROL OF DC MOTOR

We know that the direction in which motor is running reverses if the polarity of voltage applied to it reverses. This is accomplished very easily by using H-Bridge. An H bridge is an electronic circuit , which enables a voltage to be applied across a load in either direction. These circuits are often used in robotics and other applications to allow DC motors to run forwards and backwards.

In our project we have made the h-bridge using 2 DPDT relay switches and we are controlling these DPDT switches using output ports of IC 8255.

WORKING OF H-BRIDGE

In our circuit the motor is connected between the +5v supply and Darlington pair output and if the polarity of these two terminals is changed the motor reverses its direction, for doing so we connect the motor b/w the common terminals of two DPDT switches as shown.

6

Page 7: Dc Motor Control Using 8085

The +5v supply and the D.P output is connected to the 2 normally open points of the 1st relay switch and for 2nd

relay, it is connected in the same manner but with polarity reversed.

The triggering of the relays is done with the help of output ports of IC 8255 by suitable programming. In our project we have used IC-741 (op-amp) to provide sufficient voltage gain because the voltage output of 8255 ports is not sufficient enough to trigger the Relay’s we have used( 5V dc coil voltage).

If none of the relay is triggered, there won’t be any motion of the motor because the normally closed terminals of both the relay switches are open

and under no triggering condition the common terminals( B/W which our motor is connected) are connected to the normally closed switches.

So when the first relay is triggered motor rotates in the direction as shown

7

Page 8: Dc Motor Control Using 8085

And when the second relay is triggered the motor rotates in opposite direction as shown

So with control of speed and direction of the D.C motor we can easily form different movements of the D.C motor as illustrated in our programs. Such movements of the DC motor are of much importance in the field of robotics, industrial applications, electric cranes etc.

In our project we have implemented four different modes of operation (or four different movements) of DC motor. These are: - MODE 1: CLOCKWISE MOTION (3 SEC.) – NO MOTION (3 SEC.) – ANTI-CLOCKWISE MOTION (3 SEC)

MODE 2: CLOCKWISE MOTION (SLOW SPEED, 3SEC) – NO MOTION (3SEC) – CLOCKWISE MOTION (FASTEST SPEED, 3SEC)MODE 3: CLOCKWISE MOTION (SLOWEST SPEED)

MODE 4: CLOCKWISE MOTION (3SEC) – NO MOTION –CLOCKWISE MOTION (3SEC) – NO MOTION – ANTI CLOCKWISE MOTION (3SEC).

8

Page 9: Dc Motor Control Using 8085

MICROPROCESSOR 8085INTRODUCTIONThe Intel 8085 is an 8-bit microprocessor introduced by Intel in 1977. It was binary-compatible with the more-famous Intel 8080 but required less supporting hardware, thus allowing simpler and less expensivemicrocomputer systems to be built.

The "5" in the model number came from the fact that the 8085 requires only a +5-volt (V) power supply rather than the +5V, -5V and +12V supplies the 8080 needed.

DESCRIPTIONThe 8085 is a conventional von Neumann design based on the Intel 8080. Unlike the 8080 it does not multiplex state signals onto the data bus, but the 8-bit data bus was instead multiplexed with the lower part of the 16-bit address bus to limit the number of pins to 40. Pin #40 is used for the power supply (+5v) and pin #20 for ground. Pin #39 is used as the hold pin. Pins #15 to #8 are generally used for address buses. The processor was designed using nMOS circuitry and the

9

Page 10: Dc Motor Control Using 8085

later "H" versions were implemented in Intel's enhanced nMOS process called HMOS, originally developed for fast static RAM products. Only a 5 Volt supply is needed, like competing processors and unlike the 8080. The 8085 uses approximately 6,500 transistors.

The 8085 incorporates the functions of the 8224 (clock generator) and the 8228 (system controller), increasing the level of integration. A downside compared to similar contemporary designs (such as the Z80) was the fact that the buses required demultiplexing; however, address latches in the Intel 8155, 8355, and 8755 memory chips allowed a direct interface, so an 8085 along with these chips was almost a complete system.

The 8085 has extensions to support new interrupts, with three maskable interrupts (RST 7.5, RST 6.5 and RST 5.5), one non-maskable interrupt (TRAP), and one externally serviced interrupt (INTR). The RST n.5 interrupts refer to actual pins on the processor, a feature which permitted simple systems to avoid the cost of a separate interrupt controller.

Like the 8080, the 8085 can accommodate slower memories through externally generated wait states (pin 35, READY), and has provisions for Direct Memory Access (DMA) using HOLD and HLDA signals (pins 39 and 38). An improvement over the 8080 was that the 8085 can itself drive a piezoelectric crystal directly connected to it, and a built in clock generator generates the internal high amplitude two-phase clock signals at half the crystal frequency (a 6.14 MHz crystal would yield a 3.07 MHz clock, for instance).

PROGRAMMING MODELThe 8085 is a binary compatible follow up on the 8080, using the same basic instruction set as the 8008 (developed by Computer Terminal Corporation). Only a few minor instructions were new to the 8085 above the 8080 set.

REGISTERSThe processor has seven 8-bit registers named A, B, C, D, E, H, and L, where A is the 8-bit accumulator and the other six can be used as

10

Page 11: Dc Motor Control Using 8085

independent byte-registers or as three 16-bit register pairs, BC, DE, and HL, depending on the particular instruction. Some instructions use HL as a (limited) 16-bit accumulator. As in the 8080, the contents of the memory address pointed to by HL could be accessed as pseudo register M. It also has a 16-bit stack pointer to memory (replacing the 8008's internal stack), and a 16-bit program counter. HL pair is called the primary data pointers.

PINOUT DESCRIPTION

11

Page 12: Dc Motor Control Using 8085

COMMANDS/INSTRUCTIONSAs in many other 8-bit processors, all instructions are encoded in a single byte (including register-numbers, but excluding immediate data), for simplicity. Some of them are followed by one or two bytes of data, which could be an immediate operand, a memory address, or a port number. Like larger processors, it has CALL and RET instructions for multi-level procedure calls and returns (which can be conditionally executed, like jumps) and instructions to save and restore any 16-bit register-pair on the machine stack. There are also eight one-byte call instructions (RST) for subroutines located at the fixed addresses 00h, 08h, 10h,...,38h. These were intended to be supplied by external hardware in order to invoke a corresponding

12

Page 13: Dc Motor Control Using 8085

interrupt-service routine, but are also often employed as fast system calls. The most sophisticated command was XTHL, which is used for exchanging the register pair HL with the value stored at the address indicated by the stack pointer.

8 BIT OPERATIONSMost 8-bit operations work on the 8-bit accumulator (the A register). For two operand 8-bit operations, the other operand can be either an immediate value, another 8-bit register, or a memory cell addressed by the 16-bit register pair HL. Direct copying is supported between any two 8-bit registers and between any 8-bit register and a HL-addressed memory cell. Due to the regular encoding of the MOV-instruction (using a quarter of available opcode space) there are redundant codes to copy a register into itself (MOV B,B, for instance), which are of little use, except for delays. However, what would have been a copy from the HL-addressed cell into itself (i.e., MOV M,M) instead encodes the HLT instruction, halting execution until an external reset or interrupt occurred.

16 BIT OPERATIONSAlthough the 8085 is an 8-bit processor, it also has some 16-bit operations. Any of the three 16-bit register pairs (BC, DE, HL) or SP could be loaded with an immediate 16-bit value (using LXI), incremented or decremented (using INX and DCX), or added to HL (using DAD). LHLD loaded HL from directly-addressed memory and SHLD stored HL likewise. The XCHG operation exchanges the values of HL and DE. Adding HL to itself performs a 16-bit arithmetical left shift with one instruction. The only 16 bit instruction that affects any flag was DAD (adding HL to BC, DE, HL or SP), which updates the carry flag to facilitate 24-bit or larger additions and left shifts (for a floating point mantissa for instance). Adding the stack pointer to HL is useful for indexing variables in (recursive) stack frames. A stack frame can be allocated using DAD SP and SPHL, and a branch to a computed pointer can be done with PCHL. These abilities make it feasible to compile languages such as PL/M, Pascal, or C with 16-bit variables and produce 8085 machine code.

13

Page 14: Dc Motor Control Using 8085

Subtraction and bitwise logical operations on 16 bits is done in 8-bit steps. Operations that have to be implemented by program code (subroutine libraries) included comparisons of signed integers as well as multiply and divide.

INPUT/OUTPUT SCHEMEThe 8085 supported up to 256 input/output (I/O) ports, accessed via dedicated I/O instructions—taking port addresses as operands. This I/O mapping scheme was regarded as an advantage, as it freed up the processor's limited address space. Many CPU architectures instead use a common address space without the need for dedicated I/O instructions, although a drawback in such designs may be that special hardware must be used to insert wait states as peripherals are often slower than memory. However, in some simple 8080 computers, I/O was indeed addressed as if they were memory cells, "memory mapped", leaving the I/O commands unused. I/O addressing could also sometimes employ the fact that the processor would output the same 8-bit port address to both the lower and the higher address byte (i.e. IN 05h would put the address 0505h on the 16-bit address bus). Similar I/O-port schemes are used in the 8080-compatible Zilog Z80 as well as the closely related x86 families of microprocessors.

APPLICATIONSFor the extensive use of 8085 in various applications, the microprocessor is provided with an instruction set which consists of various instructions such as MOV, ADD, SUB, JMP etc. These instructions are written in the form of a program which is used to perform various operations such as branching, addition, subtraction, bitwise logical and bit shift operations. More complex operations and other arithmetic operations must be implemented in software. For example, multiplication is implemented using a multiplication algorithm.

DC MOTOR

14

Page 15: Dc Motor Control Using 8085

The brushed DC electric motor generates torque directly from DC power supplied to the motor by using internal commutation, stationary permanent magnets, and rotating electrical magnets. Like all electric motors or generators, torque is produced by the principle of Lorentz force, which states that any current-carrying conductor placed within an external magnetic field experiences a torque or force known as Lorentz force. Advantages of a brushed DC motor include low initial cost, high reliability, and simple control of motor speed. Disadvantages are high maintenance and low life-span for high intensity uses. Maintenance involves regularly replacing the brushes and springs which carry the electric current, as well as cleaning or replacing the commutator. These components are necessary for transferring electrical power from outside the motor to the spinning wire windings of the rotor inside the motor.The following graphics illustrate a simple, two-pole, brushed, DC motor.

DC Motor Rotation

A simple DC electric motor. When the coil is powered, a magnetic field is generated around the armature. The left side of the armature is pushed away from the left magnet and drawn toward the right, causing rotation.

The armature continues to rotate.

When the armature becomes horizontally aligned, the commutator reverses the direction of current through the coil, reversing the magnetic field. The process then repeats.

When a current passes through the coil wound around a soft iron core, the side of the positive pole is acted upon by an upwards force, while the other side is acted upon by a downward force. According to Fleming's left hand rule, the forces cause a turning effect on the coil, making it rotate. To make the motor rotate in a constant

15

Page 16: Dc Motor Control Using 8085

direction, "direct current" commutators make the current reverse in direction every half a cycle (in a two-pole motor) thus causing the motor to continue to rotate in the same direction.

DC MOTOR SPEED CONTROLGenerally, the rotational speed of a DC motor is proportional to the voltage applied to it, and the torque is proportional to the current. Speed control can be achieved by variable battery tappings, variable supply voltage, resistors or electronic controls. The direction of a wound field DC motor can be changed by reversing either the field or armature connections but not both. This is commonly done with a special set of contactors (direction contactors).

The effective voltage can be varied by inserting a series resistor or by an electronically controlled switching device made of thyristors, transistors, or, formerly, mercury arc rectifiers.

In a circuit known as a chopper, the average voltage applied to the motor is varied by switching the supply voltage very rapidly. As the "on" to "off" ratio is varied to alter the average applied voltage, the speed of the motor varies. The percentage "on" time multiplied by the supply voltage gives the average voltage applied to the motor. Therefore, with a 100 V supply and a 25% "on" time, the average voltage at the motor will be 25 V. During the "off" time, the armature's inductance causes the current to continue through a diode called a "flyback diode", in parallel with the motor. At this point in the cycle, the supply current will be zero, and therefore the average motor current will always be higher than the supply current unless the percentage "on" time is 100%. At 100% "on" time, the supply and motor current are equal. The rapid switching wastes less energy than series resistors. This method is also called pulse-width modulation (PWM) and is often controlled by a microprocessor.

PROGRAMMABLE PERIPHERAL INTERFACE PPI 8255

The Intel 8255 (or i8255) Programmable Peripheral Interface chip is a peripheral chip originally developed for the Intel 8085 microprocessor, and as such is a member of a large array of

16

Page 17: Dc Motor Control Using 8085

such chips, known as the MCS-85 Family. This chip was later also used with the Intel 8086 and its descendants. It was later made (cloned) by many other manufacturers. It is made in DIP 40 and PLCC 44 pins encapsulated versions.

This chip is used to give the CPU access to programmable parallel I/O, and is similar to other such chips like the Motorola 6520 PIA (Peripheral Interface Adapter) the MOS Technology 6522 (Versatile Interface Adapter) and the MOS Technology CIA (Complex Interface Adapter) all developed for the 6502 family. Other such chips are the 2655 Programmable Peripheral Interface from the Signetics 2650 family of microprocessors, the 6820 PIO (Peripheral Input/Output) from the Motorola 6800 family, the Western Design Center WDC 65C21, an enhanced 6520, and many others.

FUNCTIONAL BLOCK DIAGRAM

The 8255 has 24 input/output pins in all. These are divided into three 8-bit ports. Port A and port B can be used as 8-bit input/output ports. Port C can be used as an 8-bit input/output port or as two 4-bit input/output ports or to produce handshake signals for ports A and B.

The three ports are further grouped as follows:

17

Page 18: Dc Motor Control Using 8085

1. Group A consisting of port A and upper part of port C.2. Group B consisting of port B and lower part of port C.

Eight data lines (D0 - D7) are available (with an 8-bit data buffer) to read/write data into the ports or control register under the status of the " RD" (pin 5) and  WR" (pin 36), which are active low signals for read and write operations respectively. The address lines A1 and A0 allow to successively access any one of the ports or the control register as listed below:

A1 A0 Function

0 0 port A

0 1 port B

1 0 port C

1 1 control register

The control signal "' CS" (pin 6) is used to enable the 8255 chip. It is an active low signal, i.e., when  CS = '0' , the 8255 is enabled. The RESET input (pin 35) is connected to a system (like 8085, 8086, etc. ) reset line so that when the system is reset, all the ports are initialised as input lines. This is done to prevent 8255 and/or any peripheral connected to it, from being destroyed due to mismatch of ports. This is explained as follows. Suppose an input device is connected to 8255 at port A. If from the previous operation, port A is initialised as an output port and if 8255 is not reset before using the current configuration, then there is a possibility of damage of either the input device connected or 8255 or both since both 8255 and the device connected will be sending out data.

The control register or the control logic or the command word register is an 8-bit register used to select the modes of operation and input/output designation of the ports.

18

Page 19: Dc Motor Control Using 8085

OPERATION MODES OF 8255There are two main operational modes of 8255:

1. Input/output mode2. Bit set/reset mode

1. Input/output modeThere are three types of the input/output mode that are as follows:Mode 0In this mode, the ports can be used for simple input/output operations without handshaking. If both port A and B are initialized in mode 0, the two halves of port C can be either used together as an additional 8-bit port, or they can be used as individual 4-bit ports. Since the two halves of port C are independent, they may be used such that one-half is initialized as an input port while the other half is initialized as an output port. The input/output features in mode 0 are as follows:

1. O/p are latched.2. I/p are buffered not latched.3. Port do not have handshake or interrupt capability.

Mode 1When we wish to use port A or port B for handshake (strobed) input or output operation, we initialise that port in mode 1 (port A and port B can be initilalised to operate in different modes, i.e., for e.g., port A can operate in mode 0 and port B in mode 1). Some of the pins of port C function as handshake lines.

For port B in this mode (irrespective of whether is acting as an input port or output port), PC0, PC1 and PC2 pins function as handshake lines.

If port A is initialised as mode 1 input port, then, PC3, PC4 and PC5 function as handshake signals. Pins PC6 and PC7 are available for use as input/output lines.

19

Page 20: Dc Motor Control Using 8085

The mode 1 which supports handshaking has following features:

1. Two ports i.e. port A and B can be use as 8-bit i/o port.2. Each port uses three lines of port c as handshake signal and

remaining two signals can be function as i/o port.3. Interrupt logic is supported.4. Input and Output data are latched.

Mode 2Only group A can be initialised in this mode. Port A can be used for bidirectional handshake data transfer. This means that data can be input or output on the same eight lines (PA0 - PA7). Pins PC3 - PC7 are used as handshake lines for port A. The remaining pins of port C (PC0 - PC2) can be used as input/output lines if group B is initialised in mode 0. In this mode, the 8255 may be used to extend the system bus to a slave microprocessor or to transfer data bytes to and from a floppy disk controller.

2. Bit set/reset (BSR) modeIn this mode only port B can be used (as an output port). Each line of port C (PC0 - PC7) can be set/reset by suitably loading the command word register.no effect occurs in input-output mode. The individual bits of port c can be set or reset by sending the signal OUT instruction to the control register.

CONTROL WORDInput/output mode format

The figure shows the control word format in the input/output mode. This mode is selected by making D7 = '1' .

D0, D1, D3, D4 are for lower port C, port B, upper port C and port A respectively. When D0 or D1 or D3 or D4 are"SET", the corresponding ports act as input ports. For e.g., if D0 = D4 = '1', then lower port C and port A act as input ports. If these bits are "RESET", then the corresponding ports act as output ports.

20

Page 21: Dc Motor Control Using 8085

For e.g., if D1 = D3 = '0', then port B and upper port C act as output ports.

D2 is used for mode selection for group B (Port B and Lower Port C). When D2 = '0', mode 0 is selected and when D2 = '1', mode 1 is selected.

D5, D6 are used for mode selection for group A (Upper Port C and Port A). The format is as follows:

D6 D5 mode

0 0 0

0 1 1

1 x 2

Example: If port B and upper port C have to be initialised as input ports and lower port C and port A as ouput ports (all in mode 0), what is the control word?

1. Since it is an input/ouput mode, D7 = '1'.2. Mode selection bits, D2, D5, D6 are all '0' for mode 0 operation.3. Port B should operate as input port, hence, D1 = '1'.4. Upper port C should also be an input port, hence, D3 = '1'.5. Port A has to operate output port, hence, D4 = '0'.6. Lower port C should also operate as output port, hence, D0 = '0'.

Applying the corresponding values to the format in input/output mode, we get the control word as "8A (hex)"BSR mode format

The figure shows the control word format in BSR mode. This mode is selected by making D7='0'.

21

Page 22: Dc Motor Control Using 8085

D0 is used for bit set/reset. When D0= '1', the port C bit selected (selection of a port C bit is shown in the next point) is SET, when D0 = '0', the port C bit is RESET.

D1, D2, D3 are used to select a particular port C bit whose value may be altered using D0 bit as mentioned above. The selection of the port C bits are done as follows:

D3 D2 D1 Bit/pin of port C selected

0 0 0 PC0

0 0 1 PC1

0 1 0 PC2

0 1 1 PC3

1 0 0 PC4

1 0 1 PC5

1 1 0 PC6

1 1 1 PC7

D4, D5, D6 are not used.

Example: If the 5th bit (PC5) of port C has to be "SET", then what is the control word?

1. Since it is BSR mode, D7 = '0'.2. Since D4, D5, D6 are not used, assume them to be '0'.

22

Page 23: Dc Motor Control Using 8085

3. PC5 has to be selected, hence, D3 = '1', D2 = '0', D1 = '1'.4. PC5 has to be set, hence, D0 = '1'.

Applying the above values to the format for BSR mode, we get the control word as "0B (hex)".

The following is an illustrative diagram of the control word format.

DIGITAL TO ANALOG CONVERTER DAC 0800FEATURES

23

Page 24: Dc Motor Control Using 8085

Fast settling output current: 100 ns Full scale error: ±1 LSB Nonlinearity over temperature: ±0.1% Full scale current drift: ±10 ppm/°C High output compliance: -10V to +18V Complementary current outputs Interface directly with TTL, CMOS, PMOS and others 2 quadrant wide range multiplying capability Wide power supply range : ±4.5V to ±18V Low power consumption: 33 mW at ±5V Low cost

DESCRIPTION

24

Page 25: Dc Motor Control Using 8085

The DAC0800 series are monolithic 8-bit high-speed current-output digital-to-analog converters (DAC) featuring typical settling times of 100 ns. When used as a multiplying DAC, monotonic performance over a 40 to 1 reference current range is possible. The DAC0800 series also features high compliance complementary current outputs to allow differential output voltages of 20 Vp-p with simple resistor loads. The reference-to-full-scale current matching of better than ±1 LSB eliminates the need for full-scale trims in most applications, while the nonlinearities of better than ±0.1% over temperature minimizes system error accumulations.

The noise immune inputs will accept a variety of logic levels. The performance and characteristics of the device are essentially unchanged over the ±4.5V to ±18V power supply range and power consumption at only 33 mW with ±5V supplies is independent of logic input levels.

OUTPUT EQUATION:

DPDT RELAY SWITCH

25

Page 26: Dc Motor Control Using 8085

A relay is an electrically active voltage operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal.

A simple electromagnetic relay consists of a coil of wire surrounding a soft iron core, an iron yoke which provides a low reluctance path for magnetic flux, a movable iron armature, and one or more sets of contacts (there are two in the relay pictured). The armature is hinged to the yoke and mechanically linked to one or more sets of moving 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 it generates a magnetic field that attracts the armature, and the consequent movement of the movable contact(s) either makes or breaks (depending upon construction) a connection with a fixed contact. If the set of contacts was closed when the relay was de-energized, then

26

Page 27: Dc Motor Control Using 8085

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, but gravity is also used commonly in industrial motor starters. Most relays are manufactured to operate quickly. In a low-voltage application this reduces noise; in a high voltage or current application it reduces arcing.

Since relays are switches, the terminology applied to switches is also applied to relays. A relay will switch one or more poles, each of whose contacts can be thrown by energizing the coil in one of three ways:

Normally-open (NO) contacts connect the circuit when the relay is activated; the circuit is disconnected when the relay is inactive. It is also called a Form A contact or "make" contact. NO contacts can also be distinguished as "early-make" or NOEM, which means that the contacts will close before the button or switch is fully engaged.

Normally-closed (NC) contacts disconnect the circuit when the relay is activated; the circuit is connected when the relay is inactive. It is also called a Form B contact or "break" contact. NC contacts can also be distinguished as "late-break" or NCLB, which means that the contacts will stay closed until the button or switch is fully disengaged.

Change-over (CO), or double-throw (DT), contacts control two circuits: one normally-open contact and one normally-closed contact with a common terminal. It is also called a Form C contact or "transfer" contact ("break before make"). If this type of contact utilizes a "make before break" functionality, then it is called a Form D contact.

The following designations are commonly encountered:

SPST – Single Pole Single Throw. These have two terminals which can be connected or disconnected. Including two for the coil, such a relay has four terminals in total. It is ambiguous whether the pole is normally open or normally closed. The

27

Page 28: Dc Motor Control Using 8085

terminology "SPNO" and "SPNC" is sometimes used to resolve the ambiguity.

SPDT – Single Pole Double Throw. A common terminal connects to either of two others. Including two for the coil, such a relay has five terminals in total.

DPST – Double Pole Single Throw. These have two pairs of terminals. Equivalent to two SPST switches or relays actuated by a single coil. Including two for the coil, such a relay has six terminals in total. The poles may be Form A or Form B (or one of each).

DPDT – Double Pole Double Throw. These have two rows of change-over terminals. Equivalent to two SPDT switches or relays actuated by a single coil. Such a relay has eight terminals, including the coil.

The "S" or "D" may be replaced with a number, indicating multiple switches connected to a single actuator. For example 4PDT indicates a four pole double throw relay (with 14 terminals).

EN 50005 are among applicable standards for relay terminal numbering; a typical EN 50005-compliant SPDT relay's terminals would be numbered 11, 12, 14, A1 and A2 for the C, NC, NO, and coil connections, respectively.

BLOCK DIAGRAM

28

Page 29: Dc Motor Control Using 8085

ULN2003 DARLINGTON ARRAY IC

ABSOLUTE MAXIMUM RATINGSSymbol Parameter Value Unit

Vo Output Voltage 50 V

Vin Input Voltage (for ULN2002A/D - 2003A/D - 2004A/D) 30 V

Ic Continuous Collector Current 500 mA

Ib Continuous Base Current 25 mA

Tamb Operating Ambient Temperature Range – 20 to 85 °C

Tstg Storage Temperature Range – 55 to 150 °C

Tj Junction Temperature 150 °C

The ULN2003 is a high voltage, high current darlington array containing seven open collector darlington pairs with common emitters. Each channel rated at 500mA and can withstand peak currents of 600mA. Suppression diodes are included for inductive load driving and the inputs are pinned opposite the outputs to simplify board layout. It is a versatile device useful for driving a wide range of

29

Page 30: Dc Motor Control Using 8085

loads including solenoids, relays DC motors, LED displays filament lamps, thermal print heads and high power buffers.

The ULN2003 is supplied in 16 pin plastic DIP packages with a copper lead frame to reduce thermal resistance.

ULN2003 PINOUT

CIRCUIT ANALYSIS AND PROGRAMMING

The heart of our project is the microprocessor 8085, which is used to control the digital to analog converter and the peripheral interfaces 8255.

30

Page 31: Dc Motor Control Using 8085

The programming takes care of which device to trigger and when. The use of appropriate delays makes it possible for us to see the motion control in real time.

The DAC is also another important part which is used to produce the pulses necessary for pulse width modulation and hence speed variation in the operation of the dc motor. The DC motor used is a 6V (minimum 150mA current) motor and hence since the maximum output capability of the DAC is 5V and current sourcing is 50mA, therefore we have used a darlington array IC which is the ULN2003. This IC provides a large current gain due to the presence of darlington pairs and also a high voltage gain. The

31

Page 32: Dc Motor Control Using 8085

output of the DAC is used to drive the motor. The output of the DAC is varied and hence the speed variations are produced.

The motion control is achieved by what is known as an H-bridge, which is made using relays. An H bridge is an electronic circuit, which enables a voltage to be applied across a load in either direction. H bridges are available as integrated circuits, or can be built from discrete components

The term H bridge is derived from the typical graphical representation of such a circuit. An H bridge is built with four switches (solid-state or mechanical). When the switches S1 and S4 (according to the first figure) are closed (and S2 and S3 are open) a positive voltage will be applied across the motor. By opening S1 and S4 switches and closing S2 and S3 switches, this voltage is reversed, allowing reverse operation of the motor. Using the nomenclature above, the switches S1 and S2 should never be closed at the same time, as this would cause a short circuit on the input voltage source. The same applies to the switches S3 and S4. This condition is known as shoot-through.

PROGRAMMING

FLOWCHARTS

32SET UP MEMORY POINTER FOR

SELECTING DIFFERENT MODES OF OPERATIONTRANSFER THE CONTENTS OF

MEMORY TO ACCUMULATOR

IS MODE 1 SELECTED?

IS MODE 2 SELECTED?

IS MODE 4 SELECTED?

IS MODE 3 SELECTED?

NONO JUMP TO MODE 1 (ADDRESS 2020)

START

STOP

JUMP TO MODE 2 (ADDRESS 2020)

JUMP TO MODE 3 (ADDRESS 2020)

JUMP TO MODE 4 (ADDRESS 2020)

YESYESYESYESMAIN PROGRAM

Page 33: Dc Motor Control Using 8085

33

NO

LOAD ACCUMULATOR WITH DATA 99H

STARTFFH: MAXIMUM SPEED00H: NO MOTION60H: MINIMUM SPEED

OUT THE CONTENTS OF ACCUMULATOR AT THE INPUT PORT OF

THE DAC (PORT ADDRESS OAH )

LOAD THE ACCUMULATOR WITH CONTROL WORD (80H)

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 II

FOR INTIALISING ALL THE PORTS AS OUTPUT PORTS OF 8255 II

OUT FFH AT PORT A TO TURN RELAY 2 ON

DELAY (3SEC.)

OUT 00H AT PORT A TO TURN RELAY 2 OFF

DELAY (3SEC.)

LOAD THE ACCUMULATOR WITH CONTROL WORD (80H)

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 I

FOR INTIALISING ALL PORTS AS OUTPUT PORTS OF 8255 I

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 I

OUT FFH AT PORT A TO TURN RELAY 1 ON

DELAY (3SEC.)

OUT 00H AT PORT A TO TURN RELAY 1 OFF

DELAY (3SEC.)

MODE 1

NO

Page 34: Dc Motor Control Using 8085

34

LOAD ACCUMULATOR WITH DATA 99H

STARTFFH: MAXIMUM SPEED00H: NO MOTION60H: MINIMUM SPEED

OUT THE CONTENTS OF ACCUMULATOR AT THE INPUT PORT OF

THE DAC (PORT ADDRESS OAH )

LOAD THE ACCUMULATOR WITH CONTROL WORD (80H)

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 II

FOR INTIALISING ALL THE PORTS AS OUTPUT PORTS OF 8255 II

OUT FFH AT PORT A TO TURN RELAY 2 ON

DELAY (3SEC.)

OUT 00H AT PORT A TO TURN RELAY 2 OFF

DELAY (3SEC.)

LOAD THE ACCUMULATOR WITH CONTROL WORD (80H)

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 I

FOR INTIALISING ALL PORTS AS OUTPUT PORTS OF 8255 I

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 I

OUT FFH AT PORT A TO TURN RELAY 1 ON

DELAY (3SEC.)

OUT 00H AT PORT A TO TURN RELAY 1 OFF

DELAY (3SEC.)

MODE 1

Page 35: Dc Motor Control Using 8085

35

LOAD ACCUMULATOR WITH DATA 99H

STARTFFH: MAXIMUM SPEED00H: NO MOTION60H: MINIMUM SPEED

OUT THE CONTENTS OF ACCUMULATOR AT THE INPUT PORT OF

THE DAC (PORT ADDRESS OAH )

LOAD THE ACCUMULATOR WITH CONTROL WORD (80H)

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 II

FOR INTIALISING ALL THE PORTS AS OUTPUT PORTS OF 8255 II

OUT FFH AT PORT A TO TURN RELAY 2 ON

DELAY (3SEC.)

OUT 00H AT PORT A TO TURN RELAY 2 OFF

DELAY (3SEC.)

LOAD THE ACCUMULATOR WITH CONTROL WORD (80H)

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 I

FOR INTIALISING ALL PORTS AS OUTPUT PORTS OF 8255 I

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 I

OUT FFH AT PORT A TO TURN RELAY 1 ON

DELAY (3SEC.)

OUT 00H AT PORT A TO TURN RELAY 1 OFF

DELAY (3SEC.)

MODE 1

Page 36: Dc Motor Control Using 8085

36

LOAD ACCUMULATOR WITH DATA 70H

START

FFH: MAXIMUM SPEED00H: NO MOTION60H: MINIMUM SPEED

OUT THE CONTENTS OF ACCUMULATOR AT THE INPUT PORT OF

THE DAC (PORT ADDRESS OAH)

LOAD THE ACCUMULATOR WITH CONTROL WORD (80H)

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 II

FOR INTIALISING ALL THE PORTS AS OUTPUT PORTS OF 8255 II

OUT FFH AT PORT A TO TURN RELAY 2 ON

DELAY (3SEC.)

OUT 00H AT PORT A TO TURN RELAY 2 OFF

DELAY (3SEC.)

OUT FFH AT PORT A TO TURN RELAY 2 ON

DELAY (3SEC.)

OUT 00H AT PORT A TO TURN RELAY 2 OFF

DELAY (3SEC.)

LOAD THE ACCUMULATOR WITH CONTROL WORD (80H)

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 I

FOR INTIALISING ALL PORTS AS OUTPUT PORTS OF 8255 I

OUT THE CONTROL WORD IN THE CONTROL REG. OF 8255 I

OUT FFH AT PORT A TO TURN RELAY 1 ON

DELAY (3SEC.)

MODE 4

Page 37: Dc Motor Control Using 8085

37

DELAY (3SEC.)

OUT 00H AT PORT A TO TURN RELAY 1 OFF

DELAY (3SEC.)

SUBROUTINEDELAY (3SEC.)

DELAY (3SEC.)

PRELOADED DELAY IN MICROPROCESSOR OF .5 SEC

IS REG. B 0?RET

Page 38: Dc Motor Control Using 8085

Entering 01, 02, 03 or 04 at address 2200H can select the different modes of operation of motor.

PROGRAM

38

JUMP TO THE STARTING OF THE PROGRAM

DELAY

LOAD REG. B WITH DATA 06H

DECREMENT THE CONTENTS OF REG. B

Page 39: Dc Motor Control Using 8085

ADDRESS MNEMONICS OPCODE COMMENTS2000

2003

2004

2005

2009

200B

200E

2010

2014

2016

2019

LXI H, 2200

MOV A,M

CPI 01

JZ 2020

CPI 02

JZ 2060

CPI 03

JZ 2090

CPI 04

JZ 20B0

RST 5

21 0022

7E

FE01

CA2020

FE 02

CA6020

FE 03

CA9020

FE04

CAB020

EF

SET UP MEMORY POINTER FOR SELECTING MODE

TRANSFER THE CONTENTS OF MEMORY TO ACCUMULATOR

COMPARE THE CONTENTS OF ACCUMULATOR WITH DATA 01H

JUMP TO THE SPECIFIED ADDRESS IF MODE 1 IS SELECTED

COMPARE THE CONTENTS OF ACCUMULATOR WITH DATA 02H

JUMP TO THE SPECIFIED ADDRESS IF MODE 2 IS SELECTED

COMPARE THE CONTENTS OF ACCUMULATOR WITH DATA 03H

JUMP TO THE SPECIFIED ADDRESS IF MODE 3 IS SELECTED

COMPARE THE CONTENTS OF ACCUMULATOR WITH DATA 04H

JUMP TO THE SPECIFIED ADDRESS IF MODE 4 IS SELECTED

39

Page 40: Dc Motor Control Using 8085

MODE 1MODE 1: CLOCKWISE MOTION (3 SEC.) – NO MOTION (3 SEC.) – ANTI-CLOCKWISE MOTION (3 SEC)

ADDRESS MNEMONIC OPCODE COMMENTS2020

2022

2024

2026

2028

202A

202C

202F

2031

2033

MVI A,99

OUT A0

MVI A,80

OUT 0B

MVI A,FF

OUT 08

CALL DELAY

MVI A,00

OUT 08

CALL DELAY

3E99

D3AO

3E80

D30B

3E FF

D308

CD0030

3E00

D308

CD 00

LOAD THE ACCUMLATOR WITH 99H VALUE

OUT THE CONTENTS OF ACCUMULATOR AT THE INPUT PORT OF DAC( THIS IS FOR CONTROLLING THE SPEED OF MOTOR, FFH : MAXIMUM SPEED & 00 H : NO MOTION)

CONTROL WORD FOR INTIALIZING THE PORT S OF 8255-II

OUT THE CONTROL WORD AT CONTROL REG. OF 8255-II

LOAD THE ACCUMULATOR WITH DATA FF

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 ON

CALL THE SUBROUTINE DELAY

LOAD THE ACC. WITH DATA 00

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 OFF

CALL THE SUBROUTINE DELAY

40

Page 41: Dc Motor Control Using 8085

2036

2038

203A

203C

203E

2041

2043

2045

2048

MVI A,80

OUT 03

MVI A,FF

OUT 00

CALL DELAY

MVI A,00

OUT 00

CALL DELAY

JMP START

30

3E 80

D3 03

3E FF

D300

CD0030

3E00

D300

CD0030

C32020

CONTROL WORD FOR INTIALISING PORTS OF 8255

OUT THE CONTROL WORD AT CONTROL REG. OF 8255-I

LOAD THE ACC. WITH DATA FF

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 1 ON

CALL THE SUBROUTINE DELAY

LOAD THE ACC. WITH DATA 00

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 1 OFF

CALL THE SUBROUTINE DELAY

UNCONDITIONALLY JUMP TO THE STARTING OF PROGRAM

MODE 2MODE 2: CLOCKWISE MOTION (SLOW SPEED, 3SEC) – NO MOTION (3SEC) – CLOCKWISE MOTION (FASTEST SPEED, 3SEC)

ADDRESS MNEMONIC OPCODE COMMENTS

41

Page 42: Dc Motor Control Using 8085

2060

2062

2064

2066

2068

206A

206C

206F

2071

2073

2076

2078

MVI A, 66

OUT A0

MVI A,80

OUT 0B

MVI A,FF

OUT 08

CALL DELAY

MVI A,00

OUT 08

CALL DELAY

MVI A,FF

OUT A0

3E66

D3A0

3E80

D308

3EFFD308

CD 0030

3E00

D308

CD 0030

3EFF

D3A0

LOAD THE ACCUMLATOR WITH 66H VALUE

OUT THE CONTENTS OF ACCUMULATOR AT INPUT PORT OF DAC ( THE OUTPUT OF DAC IN THIS CASE IS SUCH THAT LEADS TO SOWEST SPEED OF THE MOTOR)

CONTROL WORD FOR INTIALIZING THE PORT S OF 8255-II

OUT THE CONTROL WORD AT CONTROL REG. OF 8255-II

LOAD THE ACCUMULATOR WITH DATA FFOUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 ON

CAL THE SUBROUTINE DELAY

LOAD THE ACC. WITH DATA 00

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 OFF

CALL THE SUBROUTINE DELAY

LOAD THE ACC. WITH DATA FF

OUT THE CONTENTS OF ACCUMULATOR AT INPUT PORT OF DAC ( THE OUTPUT OF DAC IN THIS CASE IS SUCH THAT LEADS TO FASTEST SPEED OF

42

Page 43: Dc Motor Control Using 8085

207A

207C

207E

2081

2083

2085

2088

MVI A,FF

OUT 08

CALL DELAY

MVI A,00

OUT 08

CALL DELAY

JMP START

3E FF

D3 08

CD0030

3E 00

D308

CD 0030

C36020

THE MOTOR)

LOAD THE ACC. WITH DATA FF

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 ON

CALL THE SUBROUTINE DELAY

LOAD THE ACC. WITH DATA 00

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 OFF

CALL THE SUBROUTINE DELAY

UNCONDITIONALLY JUMP TO THE STARTING OF THE PROGRAM

MODE 3MODE 3: CLOCKWISE MOTION (SLOWEST SPEED)

ADDRESS MNEMONIC OPCODE COMMENTS2090 MVI A,80 3E

80CONTROL WORD FOR INTIALIZING THE PORT S OF

43

Page 44: Dc Motor Control Using 8085

2092

2094

2096

2098

209A

209C

209E

209F

20A2

20A4

20A6

20A7

20A8

OUT 0B

MVI A,FF

OUT 08

MVI A, 60

OUT A0

MVI B,88

DCB B

JNZ 2096

MVI A,00

OUT AO

MVI B,FF

DCR B

JNZ 20A0

D30B

3E FF

D308

3E60

D3 A0

0688

05

C2 96 20

3E00

D3A0

06FF

05

C2 A020

8255-II

OUT THE CONTROL WORD AT CONTROL REG. OF 8255-II

LOAD THE ACCUMULATOR WITH DATA FF

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 ON

LOAD THE ACCUMLATOR WITH 60VALUE

OUT THE CONTENTS OF ACCUMULATOR AT INPUT PORT OF DAC

DELAY 1

LOAD THE ACCUMULATOR WITH 00 VALUE

OUT THE CONTENTS OF ACCUMULATOR AT INPUT PORT OF DAC

DELAY 2

44

Page 45: Dc Motor Control Using 8085

20AB JMP 2098 C39820

JUMP UNCONDITIONALLY TO THE SPECIFIES ADDRESS

MODE 4MODE 4: CLOCKWISE MOTION (3SEC) – NO MOTION – CLOCKWISE MOTION (3SEC) – NO MOTION – ANTI CLOCKWISE MOTION (3SEC).

ADDRESS MNEMONIC OPCODE COMMENTS20B0

20B2

20B4

20B6

20B8

20BA

20BC

20BF

20C1

MVI A, 66

OUT A0

MVI A,80

OUT 0B

MVI A,FF

OUT 08

CALL DELAY

MVI A,00

OUT 08

3E70

D3A0

3E80

D308

3EFF

D3

08

CD 0030

3E00

D308

LOAD THE ACCUMLATOR WITH 70H VALUE

OUT THE CONTENTS OF ACCUMULATOR AT INPUT PORT OF DAC ( THE OUTPUT OF DAC IN THIS CASE IS SUCH THAT LEADS TO SOWEST SPEED OF THE MOTOR)

CONTROL WORD FOR INTIALIZING THE PORT S OF 8255-II

OUT THE CONTROL WORD AT CONTROL REG. OF 8255-II

LOAD THE ACCUMULATOR WITH DATA FF

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 ON

CAL THE SUBROUTINE DELAY

LOAD THE ACC. WITH DATA 00

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 OFF

45

Page 46: Dc Motor Control Using 8085

20C3

20C6

20C8

20CA

20CD

20CF

20D1

20D4

20D6

20D8

20DA

20DC

20DF

CALL DELAY

MVI A,FF

OUT 08

CALL DELAY

MVI A,00

OUT 08

CALL DELAY

MVI A,80

OUT 03

MVI A,FF

OUT 00

CALL DELAY

MVI A,00

CD 0030

3E FF

D308

CD0030

3E00

D308

CD 0030

3E 80

D3 03

3E FF

D300

CD0030

3E00

CALL THE SUBROUTINE DELAY

LOAD THE ACC. WITH DATA FF

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 ON

CAL THE SUBROUTINE DELAY

LOAD THE ACC. WITH DATA 00

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 2 OFF

CALL THE SUBROUTINE DELAY

CONTROL WORD FOR INTIALISING PORTS OF 8255-I

OUT THE CONTROL WORD AT CONTROL REG. OF 8255-I

LOAD THE ACC. WITH DATA FF

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 1 ON

CALL THE SUBROUTINE DELAY

LOAD THE ACC. WITH DATA 00

46

Page 47: Dc Motor Control Using 8085

20E1

20E3

20E6

OUT 00

CALL DELAY

JMP START

D300

CD0030

C320B0

OUT THE CONTENTS OF ACC. AT PORT A TO TURN RELAY 1 OFF

CALL THE SUBROUTINE DELAY

UNCONDITIONALLY JUMP TO THE STARTING OF PROGRAM

The first block is the main program which decides as to which mode to run. Depending on the data entered at 2200H, that particular mode is run and delay program is used as subroutine to use delays as when necessary.

SUBROUTINE: DELAY (3SEC)

ADDRESS MNEMONIC OPCODE COMMENTS3000

3002

3005

3006

3009

MVIB, 06

CALL DELAY

DCR B

JNZ 2092

RET

0606

CDBC03

05

C29220

C9

SET THE COUNTER REGISTER

CALL THE DELAY PROGRAM

DECREASE THE COUNTER

JUMP TO ADDRESS 3002, IF ZERO FLAG IS NOT SET

RETURN

REFERENCES1. www.google.com2. www.wikipedia.com3. www.nationalseminconductor.com4. www.getgyan.com/show/8/DC_Motors_Using_H_Bridge

47

Page 48: Dc Motor Control Using 8085

5. www.instructables.com/id/How-to-make-an-H-bridge/step4/About-our-circuit/

48