Shiftout


Closed Thread
Results 1 to 7 of 7

Thread: Shiftout

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Location
    Exeter, England
    Posts
    25

    Default Shiftout

    I have two Allegro UCN5841 serial input latched drivers cascaded and I am trying to load them with two 8 bit bytes of data. The cammand line I am using is:

    Shiftout datapin,clockpin,4,[byte0,byte1]

    The problem is that byte0 gets to the first 5841 and that's all.
    To load two bytes I have to send them seperately with two seperate shiftout commands.
    Anyone any idea what I'm doing wrong?
    Keep your motor running

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Have you tried using shiftout mode 0 so the clock pin idles low?

    Are you using the serial out pin on the 1st IC to serial in on the 2nd IC and sharing the clock pin?

    How are you controlling both strobe & enable pins on both ICs?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jan 2004
    Location
    Exeter, England
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Hi Bruce

    Changing Mode seems to have no effect. In fact tech at Allegro suggested that the clock idling high would be better.

    Yes, serial out to serial in and common clock.

    Both enable pins are kept low. The strobes start low and are made high 1mS after the two data bytes have been shifted in, held for 1mS and then made low again.
    Keep your motor running

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


    Did you find this post helpful? Yes | No

    Default

    Moby, Hello, I use the UCN5841A's all the time and use the statement as such:
    SHIFTOUT OUTDAT,IOCLOCK, MSBFIRST,[INDATA(3)\8,INDATA(2)\8,INDATA(1)\8,INDATA(0)\8]
    PULSOUT STROBE,PULSE 'STROBE UCN5842A FOR ~10uS.
    This sequence shifts out 4 bytes.

    HTH
    Dave Purola,

  5. #5
    Join Date
    Jan 2004
    Location
    Exeter, England
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Hi Dave

    Thanks for that. I will give it a go.
    So you think that the byte length need to be defined?
    Keep your motor running

  6. #6
    Join Date
    Jan 2004
    Location
    Exeter, England
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Dave

    Just to let you know that worked fine. Thanks.
    Keep your motor running

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


    Did you find this post helpful? Yes | No

    Default

    Moby, I have always used the bit count variable and never the default. I have used all bit counts between 8 and 16 for diferent hardware configurations. Glad I could help. Good luck.....

    Dave Purola,

Similar Threads

  1. 7 Segment Displays and MAX7219
    By Bill Legge in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 31st October 2010, 18:30
  2. Using MAX 7221 LED driver
    By Nick in forum mel PIC BASIC
    Replies: 15
    Last Post: - 21st October 2010, 19:31
  3. Smart Star (how to use shift registers)
    By mackrackit in forum Code Examples
    Replies: 3
    Last Post: - 30th November 2008, 20:06
  4. PC Keyboard question
    By HatchetHand in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 18th September 2007, 06:03
  5. Shorter Subroutines for MAX7219
    By exelanoz in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th March 2007, 11:35

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