logo elektroda
logo elektroda
X
logo elektroda

How to run multiple tasks simultaneously for 4 LED digits on 8051 microcontroller?

39 13
ADVERTISEMENT
  • #1 21660462
    Dharmik Brahmbhatt
    Anonymous  
  • ADVERTISEMENT
  • #2 21660463
    Robert Berger
    Anonymous  
  • #3 21660464
    Steve Lawson
    Anonymous  
  • #4 21660465
    Dharmik Brahmbhatt
    Anonymous  
  • ADVERTISEMENT
  • #5 21660466
    Steve Lawson
    Anonymous  
  • #6 21660467
    Steve Lawson
    Anonymous  
  • #7 21660468
    Dharmik Brahmbhatt
    Anonymous  
  • #8 21660469
    Pieter Kruger
    Anonymous  
  • ADVERTISEMENT
  • #9 21660470
    Steve Lawson
    Anonymous  
  • ADVERTISEMENT
  • #10 21660471
    Pieter Kruger
    Anonymous  
  • #11 21660472
    Dharmik Brahmbhatt
    Anonymous  
  • #12 21660473
    Steve Lawson
    Anonymous  
  • #13 21660474
    Steve Lawson
    Anonymous  
  • #14 21660475
    Steve Lawson
    Anonymous  

Topic summary

The discussion addresses the challenge of running multiple tasks simultaneously on an 8051 microcontroller to control four LED digits, each composed of 13 LEDs, for a digital clock project. The main issue is managing the multiplexing and timing constraints, as the 8051 has a single program counter and limited resources, making true parallel multitasking impossible. Suggested solutions include using time-slicing or quasi-multitasking with an RTOS like FreeRTOS, though this may be overkill. A more practical approach involves multiplexing the display by rapidly cycling through each digit using timer interrupts, updating one digit at a time with a delay around 2 ms to avoid flicker, leveraging human persistence of vision. Grouping LEDs into segments (similar to 7-segment displays) and driving each digit selectively with transistors to handle current requirements is recommended. Decoupling the display refresh rate from task execution by storing digit data in memory and refreshing the display independently is also advised. Additional suggestions include using external hardware like 4-16 decoders or implementing a BCD to 7-segment conversion in firmware to reduce pin usage. The use of an RTC module (RTC12887) for timekeeping is mentioned, and the importance of using an appropriate CPU clock frequency to avoid timing issues is highlighted.
Summary generated by the language model.
ADVERTISEMENT