| Pelatihan
Mikrokontroller
Microcontroller Kits
Programmer
and Target 89s51
Simple
Mikrokontroller 89s51 Trainer

Standart
Mikrokontroller 89s51 Trainer

Super Mikrokontroller
Trainer 89s51
|
|
BACK NEXT
2.3.7. Writing multi character
on 8 x 7 segment
In this lesson, we are going to drive more 7 segmen,
in this way you can write eight character on 8 x 7 segmen. We used a
multiplexing methode to transfer data for driver transistor consequtively.
Another mothode to take the data tobe transfer to 8 x 7 segment is by
used look up table, as shown in listing program below.
Step 1st
Build the circuit as shown in figure 2.3.5. As you seen on figure 2.3.5.
P2.0 trough P2.7 is connected to driver transistor, and all eight 7 segment
is connected to P0.0 trough P0.6 parallelly. Remember, that all we want
to do with this lesson is write multi character ( A-b-C-d-E-F-g-h ) to
1st, 2nd, 3rd, 4th, 5th, 6th, 7th and 8th 7 segmen each.
Step 2nd
In this step, you must tipe the assembly program to make your 7 segmen
shown some number on 7 segmen, we assume that you have already known
the editor, we used MIDE-51 to edit the program. (
Download File : exp237.zip ,
Download Complete Circuit File : Sevensegmen.PDF
)
org 0h
start: mov dptr, #word ;get dptr address mov R6,#8 ;save number of character mov R1,#01111111b;drive for 8th 7 segment Again: clr A ;clear A, A= 0
movc A,@A+dptr ;take data from look up table inc dptr ;inc address mov P0,A ;write character to P0 mov A,R1 ;transfer data R1 -> A mov P2,A ;send data A to P2 rr A ;rotate right data A mov R1,A ;saving data A -> R1 call delay ;call delay time mov P0,#11111111b; djnz R6,Again ;decrement number character sjmp start ;jump forever ;============================================= ;subroutine delay created to rise delay time ;============================================= delay: mov R1,#255 del1: mov R2,#255 del2: djnz R2,del2 djnz R1,del1 ret ; word: DB 00111111b, 01000111b, 00001000b, 00000011b DB 01000110b, 01000000b, 01001000b, 00111111b end
Step 3rd
Safe your assembly program above, and name it with 7seg5.asm (for example)
Compile the program that you have been save by using MIDE-51, see the
software instruction.
Step 4th
Download your hex file ( 7seg5.hex ) into the microcontroller
by using Microcontroller ATMEL ISP software, see the instruction.After
download this hex file you'll see the action of the 7 segmen( of course
if your cable connection and your program are corrected ).
Comments,
questions and discussion about this topic
BACK
NEXT
|
|
|
|