13
AN APPLICATION OF 8085 REGISTER INTERFACING WITH LED

An application of 8085 register interfacing with LED

Embed Size (px)

Citation preview

Page 1: An application  of 8085 register interfacing with LED

AN APPLICATION OF 8085 REGISTER INTERFACING

WITH LED

Page 2: An application  of 8085 register interfacing with LED

Presented By:-

Taha Malampattiwala 140050107052

CSE 1 [Batch 4]

Page 3: An application  of 8085 register interfacing with LED

BASIC I/O CONCEPTS

• Peripherals such as LEDs and keypads are essential components of microcontroller-based systems

• Input devices• Provide digital information to an MPU

• Examples: switch, keyboard, scanner, and digital camera

• Output devices • Receive digital information from an MPU

• Examples: LED, seven-segment display, LCD, and printer

• Devices are interfaced to an MPU using I/O ports

Page 4: An application  of 8085 register interfacing with LED

I/O INTERFACING

Page 5: An application  of 8085 register interfacing with LED

INTERFACING AND ADDRESSING

• I/O ports

• Buffers and latches on the MCU chip

• Assigned binary addresses by decoding the address bus

• Generally bidirectional

• Internal data direction registers

• To read binary data from an input peripheral

• MPU places the address of an input port on the address bus

• Enables the input port by asserting the RD signal

• Reads data using the data bus

• To write binary data to an output peripheral

• MPU places the address of an output port on the address bus

• Places data on data bus

• Asserts the WR signal to enable the output port

Page 6: An application  of 8085 register interfacing with LED

INTERFACING OUTPUT PERIPHERALS

• Commonly used output peripherals in embedded systems

• LEDs

• Seven-Segment Displays

• LCDs

• Two ways of connecting LEDs to I/O ports

• Common Cathode

• LED cathodes are grounded

• Logic 1 from the I/O port turns on the LEDs

• Current is supplied by the I/O port called current sourcing

• Common Anode

• LED anodes are connected to the power supply

• Logic 0 from the I/O port turns on the LEDs

• Current is received by the chip called current sinking

Page 7: An application  of 8085 register interfacing with LED
Page 8: An application  of 8085 register interfacing with LED

SEVEN-SEGMENT DISPLAY

• Seven-segment Displays

• Used to display BCD digits

• 0 thru 9

• A group of 7 LEDs physically mounted in the shape of the number eight

• Plus a decimal point

• Each LED is called a segment

• ‘a’ through ‘g’

• Two types

• Common anode

• Common cathode

Page 9: An application  of 8085 register interfacing with LED

SEVEN-SEGMENT DISPLAY

• Common Anode

• All anodes are connected together to a power supply

• Cathodes are connected to data lines

• Logic 0 turns on a segment

• Example: To display the digit 1

• All segments except b and c should be off

• 11111001 = F9H

9 330_09

Common Anode

Page 10: An application  of 8085 register interfacing with LED

SEVEN-SEGMENT DISPLAY

• Common Cathode

• All cathodes are connected together to ground

• Anodes are connected to data lines

• Logic 1 turns on a segment

• Example: To display digit 1

• All segments except b and c should be off

• 00000110 = 06H

330_09

Page 11: An application  of 8085 register interfacing with LED

INTERFACE AN 8-DIGIT 7 SEGMENT LED DISPLAY TO THE 8085 MICROPROCESSOR SYSTEM AND WRITE AN 8085 ASSEMBLY LANGUAGE ROUTINE TO DISPLAY MESSAGE ON THE DISPLAY.

Page 12: An application  of 8085 register interfacing with LED

1. MVI A, 80H : Load control word in AL

2. OUT CR : Load control word in CR

3. MVI B, 08H : load count

4. MVI C, 7FH : load select pattern

5. LXI H, 6000B : starting address of message

6. DISP 1: MOV A, C : select digit

7. OUT PB

8. MOV A, M : get data

9. OUT PA : display data

10. CALL DELAY : wait for some time

11. DISP 1: MOV A, C

12. RRC

13. MOV C, A : adjust selection pattern

14. INX H

15. DCR B : Decrement count

16. JNZ DISP 1 : repeat 8 times

17. RET

18. Delay: LXI D, Count : Delay Subroutine

19. Back: DCX D

20. MOV A, D

21. ORA E

22. JNZ Back

23. RET

Page 13: An application  of 8085 register interfacing with LED