Shop OBEX P1 Docs P2 Docs Learn Events
7 segment + max7221 + prop — Parallax Forums

7 segment + max7221 + prop

timatrontimatron Posts: 16
edited 2008-10-13 05:10 in Propeller 1
Has anyone written code or a working object for controlling seven segment displays via the max7221 or max7219. i'm about to write a library, but dont really feel like it if someone already has[noparse]:)[/noparse]

any piecemeal code for it would be great too[noparse]:)[/noparse]

thanks!

-tim

Comments

  • timatrontimatron Posts: 16
    edited 2008-10-10 16:15
    Bump. Anyone?
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-10-10 18:41
    Hello Timatron,

    71 views on your post and still no answers.

    This has a reason. I think nobody has programmed something for the max7221/7219.

    You should provide more information.
    Make a post with an attachment with the datasheet of these chips
    combined with your first try of programming it and a CONCRETE question.

    I think then the things will begin to flow

    best regards

    Stefan
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-10-10 22:24
    Clock, data, load, how hard could it be? With so many SPI objects available and even simple Spin code shouldn't take more than 15 minutes I'm wondering why you haven't tried it in the meantime. The worst that could happen is nothing at all or you could be surprised how easy it is and experience the joy of getting it running yourself.

    Once you have actually started and tried it you won't have any problem asking the right questions and getting some help. We too are waiting for some questions before we can answer, we don't want to take the fun of it away from you.

    *Peter*
  • timatrontimatron Posts: 16
    edited 2008-10-11 00:22
    Wow you guys are harsh. Just looking for a little code. Was wiring up the whole thing, now im done with that and about to start writing the library. Didn't realize a bump was so offensive[noparse]:)[/noparse]

    -tim
  • DavidMDavidM Posts: 630
    edited 2008-10-11 01:56
    Hi Timatron,

    I am planing to use the MAX7219 chip at a later date but I want to drive 64 ( or More ) individual leds, I have built a PCB, but I have not had a change to make up a board to start writing some code.

    I dont think it will be too hard, It is always good to ask first if someone has already written some code! I haven't but I have "collected" some info I have found over the past year for later use,

    I have found the following which may be some use to you. I have NOT used the spin code!!! , I cant even remember where I got it from.

    Also, if you just want to drive a few seven segment LED displays a couple of 74HC595 shift registers is a lot cheaper and very easy to use, I believe you can get more current out of this compared to the MAX7219.

    regards


    Dave M
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-10-11 02:41
    Tim,
    I don't think I'm being the slightest bit harsh, I myself just wouldn't blindly give you code and treat you as if you were a cripple. It would be no fun for me and no fun for you. But if you were to "give it a go" we could benefit (or be entertained) as you would too, then there would be no problem asking. It's a bit like asking if the water is cold when everyone else is already in, just jump in and get over it.

    *Peter*
  • timatrontimatron Posts: 16
    edited 2008-10-13 05:10
    Hi Guys,

    Thanks for all the responses. I'm pretty much a prop newbie, i've done a few mods to implement other's objects but thats about the extent of my knowledge.

    I'm trying to just get any communication between the max7221 and the prop, once i can produce a test that works, im sure i can figure out the rest. I've been trying a piece of DavidM's code just to run the test function on the max7221, which should turn on all of the LEDs to the maximum brightness. I've tried this and tried pushing the shutdown command after and before it (supposively the 7221 starts up in a sleep like mode and needs the shutdown command to turn on), and i cant get nothing out of my leds. I've checked that their working manually, all looks good.

    As well, i have 3 10K pulldown resistors on the pins of the max7221 that are connected to the prop just to remove any misinformation upon reboot. (found that hint in a basic - max7221 sample)

    If anyone has any suggestions on what to try next, or to help me understand wtf i'm doing, i would be ever so grateful.

    Cheers,
    Tim

    CON
    
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
     Scan =    $0B
     Brite =   $0A
     Decode =  $09
     ShutDn =  $0C
     TestMax = $0F
     LOAD =    25                                                                'Connected to max pin 12     
     DataIO =  24                                                                'Connected to max pin 1     
     Clock =   26                                                                'Connected to max pin 13
     
     #4,LSBFIRST,MSBFIRST                                                        'Used for SHIFTOUT routines
    
    OBJ                       
     BS2: "BS2_Functions"
    
    PUB Main
      dira[noparse][[/noparse]24..26]:=%111            
      BS2.start(31,30)
      WAITCNT(CLKFREQ/2+CNT)
      BS2.SHIFTOUT(24, 26, $0F, MSBFIRST, 8)                                       'push the test command to the max7221
      BS2.PULSOUT(25, 5)
    
    
Sign In or Register to comment.