Shop OBEX P1 Docs P2 Docs Learn Events
Using Allegro UCN 5833 32-bit driver w/BS2 — Parallax Forums

Using Allegro UCN 5833 32-bit driver w/BS2

ArchiverArchiver Posts: 46,084
edited 2003-02-05 18:32 in General Discussion
Does anyone have a code snippet to drive this relay driver IC from
ALLEGRO? I'll be happy to pay/share/swap for some help!

Sincerely,
Wayne w/ VoX Automation,LLC

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-02-05 17:20
    >Does anyone have a code snippet to drive this relay driver IC from
    >ALLEGRO? I'll be happy to pay/share/swap for some help!
    >
    >Sincerely,
    >Wayne w/ VoX Automation,LLC


    Hi Wayne,
    It's a piece of cake. Shift out the data and then pulse the strobe line.
    initialize:
    ' all lamps ON briefly
       shiftout Sdata,Sclk,msbfirst,[ $ffff\16] ' send all 1's to UCN5833
       high strobe ' activate
       low strobe
       pause 1024 ' leave them ON for ~1 second
    ' now all lamps OFF, except "zero"
       shiftout Sdata,Sclk,msbfirst,[ 1\16] ' send $0000000000000001 to UCN5833
       high strobe ' activate pattern
       low strobe
    
       X=101000011110101 ' light pattern, 1=ON
    showdat:
       shiftout Sdata,Sclk,msbfirst,[ X\16] ' send light pattern to UCN5833
       high strobe ' activate it
       low strobe
    

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-05 18:32
    > X=101000011110101 ' light pattern, 1=ON
    > showdat:
    > shiftout Sdata,Sclk,msbfirst,[noparse][[/noparse]X\16] ' send light pattern to UCN5833
    > high strobe ' activate it
    > low strobe

    Wayne,
    The above uses only 16 of the outputs.. If you need all 32 outputs...
    X0=10000011110101 ' light pattern, 1=ON
       X1=00110011001100 ' X1 is most significant word
    showdat:
       shiftout Sdata,Sclk,msbfirst,[ X1\16,X0\16]
       high strobe ' activate it, all 32 outputs at once
       low strobe
    

    You can get 64 outputs (or more!), by stringing the "data out" pin
    from one '5833 to the "data in" pin of another, and by connecting
    together all the clock and strobe lines, then.
    X0=10101010101010 '
       X1=10000011110101 ' light patterns, 1=ON
       X2=00110011001100 '
       X3=11111100000000 ' X3 is most significant word
    showdat:
       shiftout Sdata,Sclk,msbfirst,[ X3\16,X2\16,X1\16,X0\16]
       high strobe ' activate it, all 64 outputs at once
       low strobe
    

    -- best regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...
Sign In or Register to comment.