Shop OBEX P1 Docs P2 Docs Learn Events
LED Display driver??? (Newbie) — Parallax Forums

LED Display driver??? (Newbie)

Brian MillerBrian Miller Posts: 25
edited 2004-09-11 06:17 in BASIC Stamp
Ok, I'm using (trying too)·a http://www.micrel.com/_PDF/mm5450.pdf·LED display driver.
·
I have everything wired right according to the diagram in the datasheet.
·
pin1 = Vss (-5 right?)
pin20 = Vdd (+5 right?)
pin1-8 = a, b, c, d, e, f, g, dp (LED display on my NX-1000 24/40)
pin23-26 =·1, 2, 3, 4·(Common cathode)
pin19 = 10k Variable (with cap)
pin 21 = Main IO pin 14 (clock)
pin 22 = Main IO pin 15 (data)
·
Now according to the data sheet, you should be able to send 36 bits to this think with the first bit = 1. After it receives the last bit of 36 it should latch right. Please note that the 5450 does not have a "Data Enable", it is a 35 bit instead on pin 23.
·
Here is the code, that should turn all of them on right??
·
·
' {$STAMP BS2p}
' {$PBASIC 2.5}

Dpin····· CON·· 15
Clock···· CON·· 14

Main:
··· #IF _P40· #THEN· MAINIO #ENDIF
··· SHIFTOUT Dpin, Clock, FSBFIRST, [noparse][[/noparse]255, 255, 255, 255]


·

Comments

  • CPUMANCPUMAN Posts: 55
    edited 2004-09-08 03:54
    Well the one issue I see with your code is it is only outputting 32 bits.

    This would send 36 bits high, but it would technically be sending 40 bits.

    SHIFTOUT Dpin, Clock, FSBFIRST, [noparse][[/noparse]15, 255, 255, 255, 255]

    Chris
  • Brian MillerBrian Miller Posts: 25
    edited 2004-09-08 03:57
    I updated that thank you!

    But it still doesn't appear to be working. I'll keep messing with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Newbie, using the NX-1000 24/40 Board with a BS2p40
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-08 14:18
    That's a bit of a goofy part, but not a problem for the BASIC Stamp.· What you have to do is modify your SHIFTOUT to deal with its requirements:

    LOW Enable 
    SHIFTOUT Dpin, Clock, LSBFIRST, [noparse][[/noparse]1\1, dsp0, dsp1, dsp2, dsp3, dsp4\3, 1\1] 
    HIGH Enable
    

    The first "1\1" sends the start bit.· The next four bytes, dsp0 - dsp3, send outputs 1 - 32 (output 1 is disp0.BIT0, output 8 is dsp1.BIT0, etc.).· The final nib, dsp4, sends outputs 33 - 35.· The final "1\1" is the latch bit.· Note that SHIFTOUT defaults to sending eight bits for any variable/value specified.· By using the \bits modifier, we can tweak SHIFTOUT to deal with awkward parts like this.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Brian MillerBrian Miller Posts: 25
    edited 2004-09-08 21:43
    Awesome, that makes perfect sense!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Newbie, using the NX-1000 24/40 Board with a BS2p40
  • Brian MillerBrian Miller Posts: 25
    edited 2004-09-10 21:57
    Jon,

    What is the LOW Enable/High Enable for? Is that for the Data Enable pin? or should I be setting the data pin High and Low?

    I tried that out and I still have nothing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Newbie, using the NX-1000 24/40 Board with a BS2p40
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-11 00:48
    According to the spec sheet, you must pull the device enable line low before sending the bits, then return it high when done. Since I don't have one of these dudes I can't do anything but suggest code that conforms to their specs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Brian MillerBrian Miller Posts: 25
    edited 2004-09-11 06:17
    Thanks for your help Jon, you have really help out in this post and others of mine.

    I'll keep playing with it and let you know if I find anything. I think I might try some other display drivers. I would use the Max7219 but I'm really looking for a learning experience with a device that is not served up on a platter for me [noparse]:)[/noparse] So far I have learned alot from this.

    Thanks again!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Newbie, using the NX-1000 24/40 Board with a BS2p40
Sign In or Register to comment.