EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / i have made the following 

i have made the following 

|

Microcontroller › 8051 › how to display a 4-digit numeric data on 7-seg displays with variable data at receiver › i have made the following 

March 6, 2012 at 5:38 pm #7265
Mehtab Ali
Participant

i have made the following  code.this code receives the data byte serially in ascii and then displays it on seven segment display. check it there might be some errors as i was in a hurry.also if you want that the digits remain displayed if transistor is off then use a latch to store the data.

 

                             org 0

 

                              mov tmod,#20h

                              mov th1,#-6

                              mov scon,#50h

                              setb tr1

 

there:                        mov r3,#04h

now:                          jnb r1,now

                                 mov dptr,#900h

 

                                 mov a,sbuf

                             anl a,#07h

                            movc a,@a+dptr

                             mov p0,a

                                 acall disp

 

back:                         djnz now

                              sjmp there

 

disp:                        cjne r3,#04h,next

                             mov p2,#01h

                                 ljmp back

 

next:                         cjne r3,#03h,next1

                                 mov p2,#02h

                                ljmp back

 

next1:                      cjne r3,#02h,next2

                                 mov p2,#04h

                                ljmp back

 

next2:                       cjne r3,#01h,back

                             mov p2,#08h

                              ret

 

org 900h

[write the seven segment codes here one by one starting with 0-9]

 

RSS feed: Recent Posts Recent Posts

  • Portable charger for my mate's new leg October 16, 2026
  • solderless sma screw mounting RF causaliy problem October 15, 2026
  • Almost Very New in PCB / KICAD DESIGN October 15, 2026
  • Delco alternator (12SI) AC-tap - what is the mate to this connector called and where to find it? October 15, 2026
  • Semi-automatic battery handler October 15, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 Arrowfly LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of Arrowfly
Privacy Policy | Advertising

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise