Iii bsc ecs 8085 microprocessor and applications unit I introduction to 8085


OCW2 (Operational Command Word Two)



Download 0.51 Mb.
Page9/9
Date08.01.2017
Size0.51 Mb.
#7774
1   2   3   4   5   6   7   8   9

OCW2 (Operational Command Word Two)


A0

1




D7

D6

D5

D4

D3

D2

D1

D0

R

SL

EOI

0

0

L3

L2

L1










R

SL

EOI

Action

EOI

0

0

1

Non specific EOI (L3L2L1=000)

0

1

1

Specific EOI command (Interrupt to clear given by L3L2L1)

Auto rotation of priorities (L3L2L1=000)

1

0

1

Rotate priorities on non-specific EOI

1

0

0

Rotate priorities in auto EOI mode set

0

0

0

Rotate priorities in auto EOI mode clear

Specific rotation of priorities (Lowest priority ISR=L3L2L1)

1

1

1

Rotate priority on specific EOI command (resets current ISR bit)

1

1

0

Set priority (does not reset current ISR bit)

0

1

0

No operation



OCW3 (Operational Command Word Three)


A0

1




D7

D6

D5

D4

D3

D2

D1

D0

D7

ESMM

SMM

0

1

MODE

RIR

RIS







ESMM

SMM

Effect

0

X

No effect

1

0

Reset special mask

1

1

Set special mask



Interrupt sequence (single PIC)


  1. One or more of the IR lines goes high.

  2. Corresponding IRR bit is set.

  3. 8259 evaluates the request and sends INT to CPU.

  4. CPU sends INTA-bar.

  5. Highest priority ISR is set. IRR is reset.

  6. 8259 releases CALL instruction on data bus.

  7. CALL causes CPU to initiate two more INTA-bar's.

  8. 8259 releases the subroutine address, first lowbyte then highbyte.

  9. ISR bit is reset depending on mode. 8254 Programmable Interval Timer/Counter

UNIT V

APPLICATIONS

DELAY PROGRAM:



  • DELAY: LXI D, Count : Load count to give 0.5 sec delay

  • BACK: DCX D : Decrement counter

  • MOV A, D

  • ORA E : Check whether count is 0

  • JNZ BACK : If not zero, repeat

  • DCR C : Check if multiplier zero, otherwise repeat

  • JNZ DELAY

  • RET : Return to main program

HARDWARE FOR TRAFFIC LIGHT CONTROL

69.a-traffic light control

Fig. shows the interfacing diagram to control 12 electric bulbs. Port A is used to control lights on N-S road and Port B is used to control lights on W-E road. Actual pin connections are listed in Table 1 below.

69.btraffic light control

The electric bulbs are controlled by relays. The 8255 pins are used to control relay on-off action with the help of relay driver circuits. The driver circuit includes 12 transistors to drive 12 relays. Fig. also shows the interfacing of 8255 to the system.

INTERFACING DIAGRAM

69.ctraffic light control 

69.dtraffic light control

SOFTWARE FOR TRAFFIC LIGHT CONTROL

69.etraffic light control

69.ftraffic light control

 


Source Program 1:

  • MVI A, 80H : Initialize 8255, port A and port B

  • OUT 83H (CR) : in output mode

  • START: MVI A, 09H

  • OUT 80H (PA) : Send data on PA to glow R1 and R2

  • MVI A, 24H

  • OUT 81H (PB) : Send data on PB to glow G3 and G4

  • MVI C, 28H : Load multiplier count (40ıο) for delay

  • CALL DELAY : Call delay subroutine

  • MVI A, 12H

  • OUT (81H) PA : Send data on Port A to glow Y1 and Y2

  • OUT (81H) PB : Send data on port B to glow Y3 and Y4

  • MVI C, 0AH : Load multiplier count (10ıο) for delay

  • CALL: DELAY : Call delay subroutine

  • MVI A, 24H

  • OUT (80H) PA : Send data on port A to glow G1 and G2

  • MVI A, 09H

  • OUT (81H) PB : Send data on port B to glow R3 and R4

  • MVI C, 28H : Load multiplier count (40ıο) for delay

  • CALL DELAY : Call delay subroutine

  • MVI A, 12H

  • OUT PA : Send data on port A to glow Y1 and Y2

  • OUT PB : Send data on port B to glow Y3 and Y4

  • MVI C, 0AH : Load multiplier count (10ıο) for delay

  • CALL DELAY : Call delay subroutine

  • JMP START

Delay Subroutine:

  • DELAY: LXI D, Count : Load count to give 0.5 sec delay

  • BACK: DCX D : Decrement counter

  • MOV A, D

  • ORA E : Check whether count is 0

  • JNZ BACK : If not zero, repeat

  • DCR C : Check if multiplier zero, otherwise repeat

  • JNZ DELAY

  • RET : Return to main program

69.gtraffic light control

Stepper Motor Control

Statement: Interface a Stepper Motor to the 8085 microprocessor system and write an 8085 assembly language program to control the Stepper Motor.

HARDWARE FOR STEPPER MOTOR CONTROL

A stepper motor is a digital motor. It can be driven by digital signal. Fig. shows the typical 2 phase motor rated 12V /0.67 A/ph interfaced with the 8085 microprocessor system using 8255. Motor shown in the circuit has two phases, with center-tap winding. The center taps of these windings are connected to the 12V supply. Due to this, motor can be excited by grounding four terminals of the two windings. Motor can be rotated in steps by giving proper excitation sequence to these windings. The lower nibble of port A of the 8255 is used to generate excitation signals in the proper sequence. These excitation signals are buffered using driver transistors. The transistors are selected such that they can source rated current for the windings. Motor is rotated by 1.80 per excitation.

Fig. shows the interfacing diagram to control 12 electric bulbs. Port A is used to control lights on N-S road and Port B is used to control lights on W-E road. Actual pin connections are listed in Table 1 below.

70a-stepper motor control

SOFTWARE FOR STEPPER MOTOR CONTROL

As port A is used as an output port, control word for 8255 is 80H.

Stepper Motor Control Program:

6000H Excite code DB 03H, 06H, 09H, OCH : This is the code sequence for clockwise rotation

Subroutine to rotate a stepper motor clockwise by 360° - Set the counts:

  • MVI C, 32H : Set repetition count to 50ıο

  • START: MVI B, 04H : Counts excitation sequence

  • LXI H, 6000H : Initialize pointer

  • BACK1: MOV A, M : Get the Excite code

  • OUT PORTA : Send Excite code

  • CALL DELAY : Wait

  • INX H : Increment pointer

  • DCR B : Repeat 4 times

  • JNZ BACK l

Delay Subroutine:

  • Delay: LXI D, Count

  • Back: DCX D

  • MOV A, D

  • ORA E

  • JNZ Back

  • RET

INTERFACING OF DAC0-800 WITH 8085

The DAC0800 can be interfaced to 8085 system bus by using an 8-bit latch and the latch can be enabled by using one of the chip select signal generated for I/O devices. A simple schematic for interfacing DAC0800 with 8085 is,






















  • In this schematic the DAC0800 is interfaced using an 8-bit latch 74LS273 to the system bus.




  • The 3-to-8 decoder 74LS 138 is used to generate chip select signals for I/O devices.




  • The address lines A4, A5 and A6 are used as input to decoder.




  • The address line A7 and the control signal IO/M (low) are used as enable for decoder.




  • The decoder will generate eight chip select signals and in this the signal IOCS-7 is used as enable for latch of DAC.




  • The I/O address of the DAC is shown in table.

ioaddr-0800-pic5(82)

interfacing-0800-pic4(81)

  • In order to convert a digital data to analog value, the processor has to load the data to latch.




  • The latch will hold the previous data until next data is loaded.




  • The DAC will take definite time to convert the data. The software should take care of loading successive data only after the conversion time.




  • The DAC 0800 produces a current output, which is converted to voltage output using Ito V converter.

ioadd2r-0800-pic6(83)


INTERFACING OF DAC0-800 WITH 8085

The DAC0800 can be interfaced to 8085 system bus by using an 8-bit latch and the latch can be enabled by using one of the chip select signal generated for I/O devices. A simple schematic for interfacing DAC0800 with 8085 is,


  • In this schematic the DAC0800 is interfaced using an 8-bit latch 74LS273 to the system bus.




  • The 3-to-8 decoder 74LS 138 is used to generate chip select signals for I/O devices.




  • The address lines A4, A5 and A6 are used as input to decoder.




  • The address line A7 and the control signal IO/M (low) are used as enable for decoder.




  • The decoder will generate eight chip select signals and in this the signal IOCS-7 is used as enable for latch of DAC.




  • The I/O address of the DAC is shown in table.

ioaddr-0800-pic5(82)

interfacing-0800-pic4(81)

  • In order to convert a digital data to analog value, the processor has to load the data to latch.




  • The latch will hold the previous data until next data is loaded.




  • The DAC will take definite time to convert the data. The software should take care of loading successive data only after the conversion time.




  • The DAC 0800 produces a current output, which is converted to voltage output using Ito V converter.

ioadd2r-0800-pic6(83)

THE INTERNAL BLOCK DIAGRAM OF ADC0809/ADC0808 :
The various functional blocks of ADC are 8-channel multiplexer, comparator, 256R resistor ladder, switch tree, successive approximation register, output buffer, address latch and decoder.


  • The 8-channel multiplexer can accept eight analog inputs in the range of 0 to 5V and allow one by one for conversion depending on the 3-bit address input. The channel selection logic is,


adc0809-channel-pic5(87)

adc0809-bd-pic4(86)

  • The successive approximation register (SAR) performs eight iterations to determine the digital code for input value. The SAR is reset on the positive edge of START pulse and start the conversion process on the falling edge of START pulse.


A conversion process will be interrupted on receipt of new START pulse.
The End-Of-Conversion (EOC) will go low between 0 and 8 clock pulses after the positive edge of START pulse.
The ADC can be used in continuous conversion mode by tying the EOC output to START input. In this mode an external START pulse should be applied whenever power is switched ON.


  • The 256'R resistor network and the switch tree is shown in fig.

adc0809-ladderl-pic6(88)

  • The 256R ladder network has been provided instead of conventional R/2R ladder because of its inherent monotonic, which guarantees no missing digital codes.




  • Also the 256R resistor network does not cause load variations on the reference voltage.




  • The comparator in ADC0809/ADC0808 is a chopper- stabilized comparator. It converts the DC input signal into an AC signal, and amplifies the AC sign using high gain AC amplifier. Then it converts AC signal to DC signal. This technique limits the drift component of the amplifier, because the drift is a DC component and it is not amplified/passed by the AC amp1ifier. This makes the ADC extremely insensitive to temperature, long term drift and input offset errors.




  • In ADC conversion process the input analog value is quantized and each quantized analog value      will have a unique binary equivalent.




  • The quantization step in ADC0809/ADC0808 is given by,

adc0809-eqn-pic7(89)

adc0809-ex1-pic8(90)

adc0809-ex2-pic9(91)

The various functional blocks of ADC are 8-channel multiplexer, comparator, 256R resistor ladder, switch tree, successive approximation register, output buffer, address latch and decoder.


  • The 8-channel multiplexer can accept eight analog inputs in the range of 0 to 5V and allow one by one for conversion depending on the 3-bit address input. The channel selection logic is,


adc0809-channel-pic5(87)

adc0809-bd-pic4(86)

  • The successive approximation register (SAR) performs eight iterations to determine the digital code for input value. The SAR is reset on the positive edge of START pulse and start the conversion process on the falling edge of START pulse.


A conversion process will be interrupted on receipt of new START pulse.
The End-Of-Conversion (EOC) will go low between 0 and 8 clock pulses after the positive edge of START pulse.
The ADC can be used in continuous conversion mode by tying the EOC output to START input. In this mode an external START pulse should be applied whenever power is switched ON.


  • The 256'R resistor network and the switch tree is shown in fig.

adc0809-ladderl-pic6(88)

  • The 256R ladder network has been provided instead of conventional R/2R ladder because of its inherent monotonic, which guarantees no missing digital codes.




  • Also the 256R resistor network does not cause load variations on the reference voltage.




  • The comparator in ADC0809/ADC0808 is a chopper- stabilized comparator. It converts the DC input signal into an AC signal, and amplifies the AC sign using high gain AC amplifier. Then it converts AC signal to DC signal. This technique limits the drift component of the amplifier, because the drift is a DC component and it is not amplified/passed by the AC amp1ifier. This makes the ADC extremely insensitive to temperature, long term drift and input offset errors.




  • In ADC conversion process the input analog value is quantized and each quantized analog value      will have a unique binary equivalent.




  • The quantization step in ADC0809/ADC0808 is given by,

adc0809-eqn-pic7(89)

adc0809-ex1-pic8(90)

adc0809-ex2-pic9(91)

Download 0.51 Mb.

Share with your friends:
1   2   3   4   5   6   7   8   9




The database is protected by copyright ©ininet.org 2024
send message

    Main page