Professional Documents
Culture Documents
Lab 6 - SSD
Lab 6 - SSD
Lab 6 - SSD
EQUIPMENT:
HARDWARE:
• 89c51 microcontroller
• Resistances
SOFTWARE:
• Keil u-vision
• Smart-pro 5000u
DISCUSSION:
ADDRESSING MODES:
1) IMMEDIATE ADDRESSING:
In this addressing mode the source operand is a constant. in immediate addressing mode, as the
name implies, when the instruction is assembled, the operand comes immediately after the
opcode. Notice that the data in this instruction must be preceded by pound sign. For example:
MOV A,#25h
2) REGISTER ADDRESSING MODE:
Register addressing mode involves registers to hold the operands or data to be manipulated. For
example:
MOV A,R0
MOV R2,A
MOV R0,40h
MOV R4,7Fh
MOV A,@R0 ; move contents of RAM location whose address is held by R0 into A
LOOKUP TABLE:
Lookup Table is just like a memory. We design a lookup table of our desired values which can
be accessed by data pointer. It’s just like an array which can save bytes. It is a very useful
method in many implementations of many applications i.e. you can save many quantization
points to represent a sin wave and you can send them one by one to any port and interfacing a
digital to analog converter with that port will change these levels to their analog equivalent levels
producing a sin wave.
1. Common cathode
2. Common anode
1. The Common Cathode (CC) – In the common cathode display, all the cathode connections
of the LED segments are joined together to logic “0” or ground. The individual segments are
illuminated by application of a “HIGH”, or logic “1” signal via a current limiting resistor to
forward bias the individual Anode terminals (a-g).
2. The Common Anode (CA) – In the common anode display, all the anode connections of the
LED segments are joined together to logic “1”. The individual segments are illuminated by
applying a ground, logic “0” or “LOW” signal via a suitable current limiting resistor to the
Cathode of the particular segment (a-g).
But common anode display are most suitable for interfacing with 8051 since 8051 port pins can
sink current better than sourcing it.
DIGIT H G F E D C B A
0 1 1 0 0 0 0 0 0
1 1 1 1 1 1 0 0 1
2 1 0 1 0 0 1 0 0
You can connect the segment pins as follows:
A P1.0
B P1.1
C P1.2
D P1.3
E P1.4
F P1.5
G P1.6
H P1.7
main: db 10100100b
loop1: db 10011001b
inc r1 db 10000000b
jmp main
delay:
mov r6,#200
dl1:
mov r7,#249
djnz r7,$
djnz r6,dl1
ret
org 000h table: db 11000000b
next: db 10110000b
delay:
mov r6,#200
dl1:
mov r7,#249
djnz r7,$
djnz r6,dl1
ret
PROCEDURE:
• Use port 2 to implement a single digit counter and connect it from LSB to MSB in a
sequence starting from segment a to segment h
• The segment h means dot should be permanently off
• The sequences used should be according to connections made.
EXERCISES:
Write codes for following exercises
Before writing the code first you have to verify either the SSD you are using is common
anode or common cathode
• Write the codes for each exercise in software and generate the hex file for each code
3. Write a program to display numeric from 0-9 by using direct addressing mode method.