7 Segment Displays and MAX7219


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Location
    Gerogetown, Texas
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Bill

    I have used these displays for a couple of years and also have made my own displays using the MAX7219. I can tell you they are sensitive at start up you need to ensure you have enough capacitance. For my home brew project I had to add a 100uf cap on the 5 volt lines. Got a lot of strange results without it' I have also included the setup I use with two chips daisey chained.

    Code:
    '###############################################################################    
     ' ====================== MAX7219 SETUP ==========================
    
    MAX_SET_UP:
    for a = 0 to 3
        For index = 0 to 7		' Retrieve 8 items from table. 
          LookUp index,[SCAN,7,BRITE,10,DECODE,%11111111,ON_OFF,1],max_dat
          ShiftOut DATA_n,CLK_n,1,[max_dat]
          IF odd = 0  Then noLoad	' If odd is 1, 
          PulsOut LOAD_n,1		' pulse LOAD line.
        NoLoad:				' Else, don't pulse. 
        Next index					' Get next item from table. 
    next a
    		
    return
    '' ===================== DISPLAY SUBROUTINE ========================
    
    Max1:
    
      ShiftOut DATA_n,CLK_n,1,[0,0] '
      ShiftOut DATA_n,CLK_n,1,[seg,dat]	' Send the digit. 
      PulsOut LOAD_n,1				' Load the display. 
      						' Repeat for all 4 digits. 
    return						' Done? Return. 
    
    Max2:
        ShiftOut DATA_n,CLK_n,1,[seg,dat]	' Send the digit. 
        ShiftOut DATA_n,CLK_n,1,[0,0]
        PulsOut LOAD_n,1	
    
    return

    Good luck

    Dave

  2. #2
    Join Date
    Nov 2007
    Location
    South-West of Australia. A small town called Denmark. 'Where the forest meets the sea.'
    Posts
    136


    Did you find this post helpful? Yes | No

    Default Cascading MAX7219

    Dave,

    Thanks for the tip, I'll try big caps.

    Prices are excellent at Futurlec but the support/documentation is sometimes lacking - still a bargain.

    I like your MAX set-up (mine is lots of lines of obvious code!) but cant quite follow it:

    1. The set-up generally is of the form [Register,Value]
    2. Where Register goes from 0 to F
    3. And value is byte sized

    4. What is your variable 'a' ?
    5. What size is the variable 'Max_dat' ?
    6. I can't see how you are writing 'Register' and 'Data' to the MAX?

    Regards Bill Legge

  3. #3
    Join Date
    Apr 2005
    Location
    Virginia
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Bill,

    I don't know that I can offer much more help, but it looks like Jerson and Dave have some excellent leads. When you mentioned seven segment displays from Futurelec, it rang a bell. I had a project last year where I needed 3", dual color seven segment displays and I got in touch with the manufacturer in China. They have even more options than what Futurelec offers and you can buy from them directly if you wish - be warned they don't accept credit cards (at least last year), so you have to do a bank transfer, which somehow cost us ~$40 bucks and shipping was about ~$25, but for the quantities you're talking about, it might be worth it. Regardless, they try to be helpful so if you have questions on their units or need a datasheet you can e-mail them and they usually get back to you by the next day. Their website is: http://www.nb-flying.com/.

  4. #4
    Join Date
    Mar 2008
    Location
    Gerogetown, Texas
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Bill

    Code:
    1. The set-up generally is of the form [Register,Value]
    2. Where Register goes from 0 to F
    3. And value is byte sized
    
    4. What is your variable 'a' ?
    5. What size is the variable 'Max_dat' ?
    6. I can't see how you are writing 'Register' and 'Data' to the MAX?
    "a" is just a byte used to count, in this case it runs through the setup four times, With two displays I wanted to make sure it was setup correctly. I most likely could have done it with two cycles. ( a little overkill)

    Max_Dat is a word

    The lookup table has the register followed by the value. The load only happens on an even number so first I shift the "register" then the "value" and load pulse.

    Works fine

    Here are the variables
    Code:
    DATA_n	var portC.2	' Bits are shifted out this pin # to 7219.
    CLK_n 	var portC.0	' Data valid on rising edge of this clock pin.
    LOAD_n	var portC.1	' Tells 7219 to transfer data to LEDs.
    DECODE 	CON	9	' Control register; a 1 turns on BCD decoding. 
    BRITE 	CON	10	' "       "   " intensity register.
    SCAN  	CON	11	' "       "   " highest # (0-7) of LED digit.
    ON_OFF	CON	12	' "       "   " on/off status of display (0=off).
    TEST  	CON	15	' Test mode (all digits/segment on, 100% bright)
    
    max_dat	VAR	WORD	' Word to be sent to MAX7219.
    Good luck

Similar Threads

  1. MAX7219 Helping Hand Please
    By isaac in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 14th February 2014, 15:07

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