Shop OBEX P1 Docs P2 Docs Learn Events
Programing BS2p — Parallax Forums

Programing BS2p

Lee SadeliLee Sadeli Posts: 29
edited 2004-08-08 13:25 in BASIC Stamp
Hi,
I am trying to write a BS2p software to read data from a synch serial input from an 8-bit register 74LS166A, but it can't really·work. Any one can help, plz.
The problem is at CLK INH that requires 2 high pulse during reading·the 1st and 2nd bit of the 8 bit data.
Many thanks

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-05 23:32
    I just had a [noparse][[/noparse]very quick] look at the data sheet, and from what I gather you should be able to do this:

    1. Tie the Clock Inhibit (CLK INH) line low, and the CLR line high -- you don't need to control these lines
    2. (with the BASIC Stamp) pull the SH/LD line low, then do a PUSLOUT on the clock line -- this will load the parallel inputs
    3. Use SHIFTIN to grab the data

    Sorry, I don't have a 74LS166A -- otherwise I'd write a snippet of code for you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Lee SadeliLee Sadeli Posts: 29
    edited 2004-08-06 09:50
    Wow, amazing !·faster reply than 911 responses.
    Seems like·the prob.·is more complicated,
    CLK INH=hi activate LOAD and·READ
    of FIRST, whereas to read·2 - 8 bit need CLK INH to be low and reading start at next leading edge of CLK.
    Maybe I may need two SHIFTIN, 1st to read 1st Bit at setting CLK INH hi, then 2nd SHIFTIN to read 2-8 bit by sending PULSOUT and setting CLK INH low
    Attached is the pulse diagram for 74LS166A.·Thanks again
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-06 13:18
    I don't think it's that complicated, but can't prove my theory until I have a part. I will stop by an electronics store today and see if they have the 74xx166. If yes, I will pick one up and write some code. It's too bad you don't have the 74LS165 instead, I've got lots of code for it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Lee SadeliLee Sadeli Posts: 29
    edited 2004-08-06 14:33
    Great ! Appreciate it very much. Hope it won't cause you too much trouble.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-06 15:03
    It's no trouble at all -- if the store has the part I will have code ready tonight or sometime tommorrow.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-07 15:32
    Well, you've probably already solved this by now ... but in the event you haven't, my suspicions were correct and the device is pretty easy to use (just a tad more complicated than the 74xx165, but just a tad).· Demo code is attached.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office


    Post Edited (Jon Williams) : 8/7/2004 11:29:30 PM GMT
  • Lee SadeliLee Sadeli Posts: 29
    edited 2004-08-08 07:47
    Many thanks, will try and let you know the outcome.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-08 13:25
    I'll let you know the outcome now ... it works! In fact, it took far longer to wire up the 74LS166 circuit an on NX-1000 board than it did to get the code going.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
Sign In or Register to comment.