In this lesson, we are going to drive more 7 segmen, in this way you can write eight character or number on multi 7 segmen. We used a multiplexing methode to transfer data for driver transistor consequtively.
Figure 2.3.5. Driving on Multi 7 Segmen
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 number ( 1-2-3-4-5-6-7-8 ) 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 asm : exp235.zip ,Download Complete Circuit File : Sevensegmen.PDF )
org 0h start: mov P0,#11111001b;write a number '1' clr P2.7 ;turn on 1st 7 segment call delay ;call delay time setb P2.7 ;turn off 1st 7 segment mov P0,#11011011b;write a number '2' clr P2.6 ;turn on 2nd 7 segment call delay ;call delay time setb P2.6 ;turn off 2nd 7 segment ; mov P0,#10110000b;write a number '3' clr P2.5 ;turn on 3rd 7 segment call delay ;call delay time setb P2.5 ;turn off 3rd 7 segment mov P0,#10011001b;write a number '4' clr P2.4 ;turn on 4th 7 segment call delay ;call delay time setb P2.4 ;turn off 4th 7 segment ; mov P0,#10010010b;write a number '5' clr P2.3 ;turn on 5th 7 segment call delay ;call delay time setb P2.3 ;turn off 5th 7 segment ; mov P0,#10000010b;write a number '6' clr P2.2 ;turn on 2nd 7 segment call delay ;call delay time setb P2.2 ;turn off 2nd 7 segment ; mov P0,#11111000b;write a number '7' clr P2.1 ;turn on 7th 7 segment call delay ;call delay time setb P2.1 ;turn off 7th 7 segment ; mov P0,#10000000b;write a number '8' clr P2.0 ;turn on 8th 7 segment call delay ;call delay time setb P2.0 ;turn off 8th 7 segment 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 end
Step 3rd
Safe your assembly program above, and name it with 7seg3.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 ( 7seg3.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 ).