Tutorial Microcontroller 8051
 
 
 
 
 
   

BACK NEXT

2.3.2. Writing multi number to single 7 Segmen consecutively

Step 1st
Build the circuit as shown in figure 2.3.2. As you seen on figure 2.3.2. P2.0 is connected to driver transistor, and each pin of 7 segmen is connected to P0.0 trough P0.6. Remember, that all we want to do with this lesson is write multi number ( 1-2-3-1-2-3 and so on ) to 7 segmen as consecutively.

Step 2nd
In this step, you must tipe the assembly program to make your 7 segmen shown a number on 7 segmen, we assume that you have already known the editor, we used MIDE-51 to edit the program. ( Download File : exp232.zip )

       org 0h
start: mov P2,#11111001b; send high logic to a and b segmen clr P0.0 ; send current to 7 segment
call delay ; call delay time
mov P2,#10111011b; send high logic to a,b,d,e,g seg. clr P2.0 ; send current to 7 segment
call delay ; call delay time mov P2,#01110000b; send high logic to a,b,c,d,g seg. clr P2.0 ; send current to 7 segment call delay ;call delay time
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 7seg2.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 ( 7seg2.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 ).

2.3.3. Writing multi number to single 7 Segmen consecutively

As what you have been worked out in lesson 2.3.2, in this lesson you should write some number ( 0,1,2,3,4,5,6,7,8,9 ) to 7 Segmen. Of course it's very simple one, you are just copy and paste for couple time, and editing for the data.

2.3.4. Writing multi character to single 7 Segmen consecutively

As what you have been worked out in lesson 2.3.3, in this lesson you should write some character ( A,b,C,d,E,F,G,H,I,J ) to 7 Segmen. Of course it's very simple one, you are just copy and paste for couple time, and editing.

Best Link

 

 

BACK NEXT

 

Lesson 1:
T o o l
1.1. Programmer
1.2.
Edsim 51
1.3. MIDE-51
1.4. ATMEL ISP

Lesson 2:
Input Output
2.1.LED
2.2.Swicht
2.3.7 Segmen
2.4.LCD Character
2.5.ADC
2.6.DAC
2.7.Motor Stepper
2.8.Keypad

Lesson 3:

Timer Counter

3.1.Basic
3.2.Mode 0
3.3.Mode 1
3.4.Mode 2
3.5.Mode 3

Lesson 4:

Serial Comm.

4.1.Basic
4.2.LED
4.3.Rotate LED
4.2 ADC
4.3.LCD

Lesson 5:
Interuption

5.1.Basic
5.2.Timer
5.2.External