Shop OBEX P1 Docs P2 Docs Learn Events
How can I shift out a 40bit word serially? — Parallax Forums

How can I shift out a 40bit word serially?

PanchoFrankPanchoFrank Posts: 5
edited 2007-05-11 15:24 in BASIC Stamp
Hello Group,
I'd like to use a BS2 to generate·two 40bit words needed to serially program a National Semiconductor PLL chip.
I know how to send 7 or 8 bit words using the serout command, but·don;t yet understand how to store and then shift out this long serial stream.
Help is appreciated.
PanchoFrank

Comments

  • NewzedNewzed Posts: 2,503
    edited 2007-05-11 00:05
    Stamps can not handle 40-bit words - only 16-bit words.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-05-11 00:17
    How many bits per second?· Maybe you can do this by spoon-feeding --·by selected HIGHs/LOWs timed with PAUSEs.· This would be very easy to do with an SX (using SX/B, you can time micro-second pulses using PAUSEUS.)

    HIGH 0
    PAUSE 1
    LOW 0
    PAUSE 1
    HIGH 0
    PAUSE 1
    HIGH 0
    PAUSE 1
    ...
    
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-05-11 01:01
    This will use SHIFTOUT, not SEROUT. It is probably a microwire or SPI interface.

    One SHIFTOUT can send several chunks of data framed by chip select...

    LOW cs
       SHIFTOUT nsdata,nsclk,MSBFIRST,[noparse][[/noparse]chunk1\10, chunk2\16, chunk3\10, chunk4\4]
    HIGH cs
    



    That adds up to 40 bits. The chunks can be either variables or constants. There may be a natural way to divide it up according to the control, address , data and don't-care bits that the device requires. What device is it?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • PanchoFrankPanchoFrank Posts: 5
    edited 2007-05-11 02:36
    Thanks Tracy and the group. I'm trying to program a National LMX2325 PLL chip used in a commercial frequency synthesizer product. The National chip has a three pin Microwire interface using CLOCK, DATA and LE (Load Enable) signals. I only need to run the synthesizer on one frequency and have determined the sequence of ones and zeros, but I'm not sure how to shift them out as one long word.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-05-11 06:19
    I took a quick look at it, and it seems to me that it wants two 19 bit packets. One consists of 3 don't care bits, a prescaler bit, 14 divider bits and finally control bit=1. The second consists of two divide ratios and control bit =0.
    LOW LE
    SHIFTOUT nsdata,nsclk, MSBFIRST, [noparse][[/noparse]%000\3, prescaler\1, refDivRatio\14, %1\1]
    HIGH LE
    LOW LE
    SHIFTOUT nsdata,nsclk, MSBFIRST, [noparse][[/noparse]progDivRatio\11, swallowDivRatio\7, %0\1]
    HIGH LE

    These things can be tricky, and it takes several tries and reading between the lines.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • PanchoFrankPanchoFrank Posts: 5
    edited 2007-05-11 15:24
    Thanks Tracy. Between your info and PJ Allen's spoon feed approach, there's enough here to get me started.
    PanchoFrank
Sign In or Register to comment.