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 Recent Posts

  • More fun with ws2812 this time XC8 and CLC July 14, 2025
  • Wierd makita battery July 14, 2025
  • I Wanna build a robot July 13, 2025
  • using a RTC in SF basic July 13, 2025
  • Is AI making embedded software developers more productive? July 13, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media 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 WTWH Media
Privacy Policy | Advertising | About Us

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