Seven segment controller question - Is there a better way?


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425

    Default Seven segment controller question - Is there a better way?

    I am making a custom LED scoreboard. It's all volunteer work so the budget is paper thin. I know there's more than one way to do things but I'd like to know if this is it or if there's a better way.

    The scoreboard has five digits and each digit will have seven segments. The numbers will be about 19" tall by 10" wide. What I was planning to do is have a host PIC to control everything. Because there are a number of things it will do other than the scoreboard, I decided to use MCP23S08's to control how the number is displayed and ULN2003's to drive the LED's. It works out pretty well seeing as how the MCP23S08's have 8 outputs and the ULN2003 has 7 outputs.

    I was going to label the segments A-G so I would have 1A, 1B....1G then 2A, 2B, etc. Then I was going to use GOSUB's for the numbers. So if I want to display 14, I would put(I'm simulating with outputs instead of using the SPI since I haven't started it yet)
    Code:
    X=14
    
    DIGIT_1=X/10
    DIGIT_2=X//10
    
    GOSUB DISPLAY_DIGIT_1
    GOSUB DISPLAY_DIGIT_2
    
    DISPLAY_DIGIT_1:
    SELECT CASE DIGIT_1
    CASE 1
    1A=1
    1B=1
    CASE 2
    1F=1
    1A=1
    1G=1
    1D=1
    1C=1
    CASE 3
    ETC.....
    
    END SELECT
    Does someone have a better idea?

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Seven segment controller question - Is there a better way?

    There are many designs on the net for this - many use a shift register, daisy chained to the next one,(74hC595s) rather than use your port expander, you would still use the uln to provide the current. many 7 segs have a decimal point so that makes a nice 8 to fit byte format.

    Your digits would be sent as a bytes shifted out in bits to the register so your digit "1" would be %00000011, digit 2 would be %01101101, A is the least sig bit in this example. So any segment with a 1 will be on 0 =off. 8th bit for decimal point if used , but does not need to be connected as you only have 7 output on uln, but you must shift out the 8 bits regardless.


    Have a look here http://www.picbasic.co.uk/forum/showthread.php?t=981 and post 3 - there is a pdf schematic.

    to set up your 5 digits use a look up (or is it down) table with just 0-9. so for a 1 you would have %00000011 = $03 for 2 %01101101 =$6d and so on.


    you have 5 digits , look up value for first and shift it out, same for the second and so on.
    Last edited by aerostar; - 21st August 2013 at 21:53. Reason: typo

  3. #3
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Seven segment controller question - Is there a better way?

    Thanks for the reply. I don't understand why the shift register is more advantageous (or that much different) than using a port expander. Lets forget about cost for a second seeing as how the shift register is cheaper but we're talking about a one off device, not volume production.

    The schematic you provided a link to shows pretty much the same thing I was thinking (which is perfectly fine by the way - I have no problems with it). He is using one shift register per digit, which is the same as the design I was thinking about. However, now that I think about it I can use a 23S17 and reduce my chip count from 5 to 3.

    Does the shift register reduce the amount coding that you have to do? In other words, pretend you're a salesman, what's the selling point with using the shift register as opposed to a port expander?

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Seven segment controller question - Is there a better way?

    You said "the budget is paper thin." so usually 74HC etc stuff is cheaper than port expanders.

    When I scanned your expander and the new one, I see that there seems to be a lot of settings to be sorted, so I looked for an easier route, hardware and programming.

    The shift registers are easy to use, and the program is relatively straight forward.

    You store the binary patten of each digit in on board pic eprom starting at location 0, so you have 10 values (led patterns) there 0-9.

    you have your x=14 or whatever , THEORETICALLY 00014

    If you store that 5 into an array eg numbers(0) = 4 numbers(1) =1 and so on

    remember to send the least significant digit out first as that will be the far right hand on the display

    you then do a loop something like

    FOR COUNTER = 0 TO 4 ' 5 DIGITS
    pattern = numbers(counter)
    read patten , temp ' get the led patten into temp
    then shift out temp to the shift register
    next

    you now have all the segments for the 5 digits done

    with some extra programming you could make the leading "0"s be unlit.
    Last edited by aerostar; - 22nd August 2013 at 10:19. Reason: hit wrong key

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Seven segment controller question - Is there a better way?

    Presumably he has done his own thing - pity he did not have the courtesy tell us whether he went with shift registers or port expanders and why.

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Seven segment controller question - Is there a better way?

    Chris4187, Personally I would use a MIC5842 for the shift register/driver as it has 8 bits and latch for each large led display.
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. Replies: 3
    Last Post: - 28th November 2011, 00:21
  2. Multiplexing 7-Segment
    By ross246 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th June 2011, 22:31
  3. Replies: 2
    Last Post: - 14th July 2008, 22:11
  4. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44
  5. 7-Segment Driver
    By NavMicroSystems in forum Off Topic
    Replies: 0
    Last Post: - 13th April 2005, 14:50

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts