This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

2x7 segment multiplexing



can somebody please provide me with an example code for multiplexing 2 seven segment displays which will count from 0 - 99 and then rollover to zero again.

I tried many times  but failed.

please help.

  • Hi,

    Maybe not exactly on your specific request, but searching the internet:

    1) https://sites.google.com/site/embeddedclub4u/training/embedded-system-training-in-45-days-6-week/7-segment-display-interfacing-and-programming
    2) http://www.eeherald.com/section/design-guide/esmod4bsample.html
    3) http://users.ece.utexas.edu/~valvano/arm/  and look for this package on that page: 7Segment_811.zip
    Please pay attention to the ref.#3 - could be used for many other purposes...
    Petrei
  • I really appreciate your efforts Petrei but it was of no use to me at all.

    anyways, thanks for the immediate reply.. :)

  • Hello Vikas

    What was of no use? I think Petrei's effort was to use the links as a startup so that you can build your own 7-Segment Code.

    You need to give a little more effort and description when it does not work.

    Regards

    Amit

  • Hi Vikas,

    It is very easy - declare three variables uint8_t count, tens, units;

    and in a timer interrupt you can write like this pseudo code:

    count +=1;

    if (count==99) count =0;

    tens = count/10;

    units = count mod 10; 

    display_tens;

    display_units;

    Petrei

  • Amit Ashara said:
    You need to give a little more effort and description when it does not work.

    I much admire/like Petrei - yet fully support Amit here!

    Factory must "bit husband" their time/efforts - otherwise it is diluted - impacting negatively their critical efforts...  So Bravo to Amit - for gently, "stating the truth - and providing clear direction" to the poster in that process!

    Record reveals that along w/scant effort/description poster with-holds the MCU - even if it is, "this vendor's!"