Shop OBEX P1 Docs P2 Docs Learn Events
TTL — Parallax Forums

TTL

ArchiverArchiver Posts: 46,084
edited 2001-06-29 13:42 in General Discussion
Does anyone know if the basic stamp can talk to a TTL device and if socould you give me a snippet code example and a tip on how the example isconnected (use of resistors etc.)?
·
·
Thanks,
Wayne Fulcher
wayne@ddinet.com
·

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-06-28 21:12
    > Does anyone know if the basic stamp can talk to a TTL device and if so could
    you
    > give me a snippet code example and a tip on how the example is connected (use
    of
    > resistors etc.)?

    TTL refers to the voltage levels used to represent logic 0 and 1 (0 and 5
    VDC). The Stamps use these same voltage levels, so you can connect the 2
    directly together.


    Mark Hillier, VE6HVW
    President, HVW Technologies Inc.
    Canadian Distributors of Parallax Products and other Neat Stuff
    Tel: (403)-730-8603 Fax: (403)-730-8903
    See our NEW BASIC Stamp Prototyping tools !
    http://www.hvwtech.com/stampstack.htm
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-28 21:31
    Thanks but what command do I use to read the data.
    The device has a Data Out Pin and a Clock In Pin.
    Could you please give me an example of how to read data from the device?


    Thanks,
    Wayne Fulcher
    wayne@d...

    Original Message
    From: Mark Hillier [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=sgqlUg5_xONxzAjszj5B4xnrOieY5D-Eyy4dKxi2m6E6CJdtO2Onfd3WWHrcS4N3U-ASp43wR6UQ]Mark@H...[/url
    Sent: Thursday, June 28, 2001 4:12 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] TTL


    > Does anyone know if the basic stamp can talk to a TTL device and if so
    could you
    > give me a snippet code example and a tip on how the example is connected
    (use of
    > resistors etc.)?

    TTL refers to the voltage levels used to represent logic 0 and 1 (0 and 5
    VDC). The Stamps use these same voltage levels, so you can connect the 2
    directly together.


    Mark Hillier, VE6HVW
    President, HVW Technologies Inc.
    Canadian Distributors of Parallax Products and other Neat Stuff
    Tel: (403)-730-8603 Fax: (403)-730-8903
    See our NEW BASIC Stamp Prototyping tools !
    http://www.hvwtech.com/stampstack.htm

    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed with. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-28 21:52
    Wayne -

    What sort of device are you using? Is it an IC with
    identifying information? Do you have a data sheet? Or
    is it a device like a transducer, which gives an
    analog signal that must be converted to serial digital
    data by an ADC for the Stamp to deal with. I was ready
    to send some code samples, but realized that I may be
    answering the wrong question, so we should define the
    device to be read first.

    Bob Pence


    --- Wayne Fulcher <wayne@d...> wrote:
    > Thanks but what command do I use to read the data.
    > The device has a Data Out Pin and a Clock In Pin.
    > Could you please give me an example of how to read
    > data from the device?
    >
    >
    > Thanks,
    > Wayne Fulcher
    > wayne@d...
    >
    >
    Original Message
    > From: Mark Hillier [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=KphvSmboWs5RUDKIN4XtF6v_TGf8dNRHQ6IYzr6Uy4OSu0RaQQj0Ov_noEyhNFkgA920R1O2aUw]Mark@H...[/url
    > Sent: Thursday, June 28, 2001 4:12 PM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] TTL
    >
    >
    > > Does anyone know if the basic stamp can talk to a
    > TTL device and if so
    > could you
    > > give me a snippet code example and a tip on how
    > the example is connected
    > (use of
    > > resistors etc.)?
    >
    > TTL refers to the voltage levels used to represent
    > logic 0 and 1 (0 and 5
    > VDC). The Stamps use these same voltage levels, so
    > you can connect the 2
    > directly together.
    >
    >
    > Mark Hillier, VE6HVW
    > President, HVW Technologies Inc.
    > Canadian Distributors of Parallax Products and other
    > Neat Stuff
    > Tel: (403)-730-8603 Fax: (403)-730-8903
    > See our NEW BASIC Stamp Prototyping tools !
    > http://www.hvwtech.com/stampstack.htm
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed
    > with. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed
    > with. Text in the Subject and Body of the message
    > will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get personalized email addresses from Yahoo! Mail
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-28 21:56
    Wayne,
    The SHIFTOUT example on page 316 show how to write data to a 74HC595. This
    is a typical example of how you would communicate with a device having a
    Data In pin and a Clock pin. In your application, you would use the SHIFTIN
    command.
    Lots of older TTL devices like the 74LS164 and 74LS165 that have been used
    by Stamp users for years.
    Good Luck!
    Mike

    At 04:31 PM 6/28/2001 -0400, you wrote:
    >Thanks but what command do I use to read the data.
    >The device has a Data Out Pin and a Clock In Pin.
    >Could you please give me an example of how to read data from the device?
    >
    >
    >Thanks,
    >Wayne Fulcher
    >wayne@d...
    >
    >
    Original Message
    >From: Mark Hillier [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=J7JYoQSk84eOPH8JXyj67ZBg1UNjndRwxxlLDlrg7nbWIbPz2RPjmnWDOIvFrdhL_3rxqUjBQSqA]Mark@H...[/url
    >Sent: Thursday, June 28, 2001 4:12 PM
    >To: basicstamps@yahoogroups.com
    >Subject: Re: [noparse][[/noparse]basicstamps] TTL
    >
    >
    > > Does anyone know if the basic stamp can talk to a TTL device and if so
    >could you
    > > give me a snippet code example and a tip on how the example is connected
    >(use of
    > > resistors etc.)?
    >
    >TTL refers to the voltage levels used to represent logic 0 and 1 (0 and 5
    >VDC). The Stamps use these same voltage levels, so you can connect the 2
    >directly together.
    >
    >
    >Mark Hillier, VE6HVW
    >President, HVW Technologies Inc.
    >Canadian Distributors of Parallax Products and other Neat Stuff
    >Tel: (403)-730-8603 Fax: (403)-730-8903
    >See our NEW BASIC Stamp Prototyping tools !
    >http://www.hvwtech.com/stampstack.htm
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed with. Text in the Subject
    >and Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed with. Text in the Subject
    >and Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

    _________________________________
    Mike Walsh
    walsh@i...
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-28 21:58
    One caveat, TTL refers to 0 _TO_ 5 volts, not always 0
    or 5. To the Stamp, signals below about 1.4 vdc are
    logical 0 and above are logical 1. But if I interface
    directly to my 250-psi range transducer, which
    produces TTL voltage, I can only read whether I am
    above or below about 53 psig. Natch, I hook the signal
    up to a 3-pin serial ADC, and I have lots more
    information.

    --- Mark Hillier <Mark@H...> wrote:
    >
    >
    > > Does anyone know if the basic stamp can talk to a
    > TTL device and if so could you
    > > give me a snippet code example and a tip on how
    > the example is connected (use of
    > > resistors etc.)?
    >
    > TTL refers to the voltage levels used to represent
    > logic 0 and 1 (0 and 5
    > VDC). The Stamps use these same voltage levels, so
    > you can connect the 2
    > directly together.
    >
    >
    > Mark Hillier, VE6HVW
    > President, HVW Technologies Inc.
    > Canadian Distributors of Parallax Products and other
    > Neat Stuff
    > Tel: (403)-730-8603 Fax: (403)-730-8903
    > See our NEW BASIC Stamp Prototyping tools !
    > http://www.hvwtech.com/stampstack.htm
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed
    > with. Text in the Subject and Body of the message
    > will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get personalized email addresses from Yahoo! Mail
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-28 22:02
    Basically the device is a card that is connected to a dartboard.
    The dartboard has a switch matrix of (19 pins) 11 X 8 = 88 possibilities.
    The card has two - 20 pin chips on it, which reads the switch matrix and has
    a 6 pin (RJ45) port to interface with.
    The pin outs are as follows:
    1 - Ground
    2 - Ground
    3 - +5v
    4 - Data (Out from dartboard)
    5 - Clock (In to Dartboard)
    6 - Ground

    I don't have the board with me this second or I would try to tell you what
    type of chips those are. (If it mattered).

    Thanks,
    Wayne Fulcher
    wayne@d...

    Original Message
    From: Pence Bob [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=rsAWzifqZt6NNh7G67iUBJk4H5zcReqlcv1VkXlcdnKvWaoeWiED3u-0pRKEZfUGwgQfck1AuULTgZArNPbWsw]bobpence_2000@y...[/url
    Sent: Thursday, June 28, 2001 4:53 PM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] TTL

    Wayne -

    What sort of device are you using? Is it an IC with
    identifying information? Do you have a data sheet? Or
    is it a device like a transducer, which gives an
    analog signal that must be converted to serial digital
    data by an ADC for the Stamp to deal with. I was ready
    to send some code samples, but realized that I may be
    answering the wrong question, so we should define the
    device to be read first.

    Bob Pence


    --- Wayne Fulcher <wayne@d...> wrote:
    > Thanks but what command do I use to read the data.
    > The device has a Data Out Pin and a Clock In Pin.
    > Could you please give me an example of how to read
    > data from the device?
    >
    >
    > Thanks,
    > Wayne Fulcher
    > wayne@d...
    >
    >
    Original Message
    > From: Mark Hillier [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Ry_Re9oM3gAIgcV2s35GjQahzhMDZeUyBnffKPjS8FOK4NyEeRFqdVVfPOER5IAmvWLyaMKGQwY]Mark@H...[/url
    > Sent: Thursday, June 28, 2001 4:12 PM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] TTL
    >
    >
    > > Does anyone know if the basic stamp can talk to a
    > TTL device and if so
    > could you
    > > give me a snippet code example and a tip on how
    > the example is connected
    > (use of
    > > resistors etc.)?
    >
    > TTL refers to the voltage levels used to represent
    > logic 0 and 1 (0 and 5
    > VDC). The Stamps use these same voltage levels, so
    > you can connect the 2
    > directly together.
    >
    >
    > Mark Hillier, VE6HVW
    > President, HVW Technologies Inc.
    > Canadian Distributors of Parallax Products and other
    > Neat Stuff
    > Tel: (403)-730-8603 Fax: (403)-730-8903
    > See our NEW BASIC Stamp Prototyping tools !
    > http://www.hvwtech.com/stampstack.htm
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed
    > with. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed
    > with. Text in the Subject and Body of the message
    > will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get personalized email addresses from Yahoo! Mail
    http://personal.mail.yahoo.com/

    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed with. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-28 22:35
    Pence,

    Very helpful explanation for us (digiligently studying at the
    same time) newbies.

    THANKS!

    Ken Ambrose
    with enough thrust, pigs fly just fine.





    ---- On Thu, 28 Jun 2001, Pence Bob (bobpence_2000@y...)
    wrote:

    > One caveat, TTL refers to 0 _TO_ 5 volts, not always 0
    > or 5. To the Stamp, signals below about 1.4 vdc are
    > logical 0 and above are logical 1. But if I interface
    > directly to my 250-psi range transducer, which
    > produces TTL voltage, I can only read whether I am
    > above or below about 53 psig. Natch, I hook the signal
    > up to a 3-pin serial ADC, and I have lots more
    > information.
    >
    > --- Mark Hillier <Mark@H...> wrote:
    > >
    > >
    > > > Does anyone know if the basic stamp can talk to a
    > > TTL device and if so could you
    > > > give me a snippet code example and a tip on how
    > > the example is connected (use of
    > > > resistors etc.)?
    > >
    > > TTL refers to the voltage levels used to represent
    > > logic 0 and 1 (0 and 5
    > > VDC). The Stamps use these same voltage levels, so
    > > you can connect the 2
    > > directly together.
    > >
    > >
    > > Mark Hillier, VE6HVW
    > > President, HVW Technologies Inc.
    > > Canadian Distributors of Parallax Products and other
    > > Neat Stuff
    > > Tel: (403)-730-8603 Fax: (403)-730-8903
    > > See our NEW BASIC Stamp Prototyping tools !
    > > http://www.hvwtech.com/stampstack.htm
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed
    > > with. Text in the Subject and Body of the message
    > > will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Get personalized email addresses from Yahoo! Mail
    > http://personal.mail.yahoo.com/
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed with. Text
    in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-28 23:51
    > Basically the device is a card that is connected to a dartboard.
    > The dartboard has a switch matrix of (19 pins) 11 X 8 = 88 possibilities.
    > The card has two - 20 pin chips on it, which reads the switch matrix and has a
    6
    > pin (RJ45) port to interface with. The pin outs are as follows: 1 - Ground 2 -
    > Ground 3 - +5v 4 - Data (Out from dartboard) 5 - Clock (In to Dartboard) 6 -
    > Ground
    >
    > I don't have the board with me this second or I would try to tell you what
    > type of chips those are. (If it mattered).

    Sounds like a synchronous serial connection; in which case you would use
    the SHIFTIN command. See the Stamp Manual for the command syntax and
    some good examples.

    In essence, you connect one Stamp pin to the Clock pin, and another to the
    data pin. The SHIFTIN command toggles the clock line and then looks at the
    data line. It repeats this process a number of times (defined by you within
    the SHIFTIN command) and collects all the bits. You need 7 bits to
    represent decimal 88 so it's likely an 8-bit word that comes out of the
    dartboard.


    Mark Hillier, VE6HVW
    President, HVW Technologies Inc.
    Canadian Distributors of Parallax Products and other Neat Stuff
    Tel: (403)-730-8603 Fax: (403)-730-8903
    See our NEW BASIC Stamp Prototyping tools !
    http://www.hvwtech.com/stampstack.htm
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-29 13:11
    Wayne -

    It would seem that there is not a third or forth pin
    to deal with, at least not at this connection point.
    So connect +5 and grounds, and pick a couple of Stamp
    I/O pins for clock and data. The Shiftin command is
    your best choice, e.g.:

    clk CON 0 ' clock pin
    dio CON 1 ' data pin
    ad VAR WORD ' analog data
    SHIFTIN dio, clk, MSBPOST, [noparse][[/noparse]ad\16]
    DEBUG BIN16 ad, CR

    Look for any repetition in ad to see if the data is
    less than 16 bits wide. The MSBPOST is a guess - a
    guess that data follows the clock pulse (versus
    MSBPRE, data present on data pin before the clock
    pulse), and a guess that data is sent
    most-significant-bit first, versus LSBPOST and LSBPRE.
    (MSB first implies that the nibble 1010 = 10 decimal,
    while LSB first would make it 5 decimal. I'm not used
    to thinking of 1010 as 5 and 0101 as 10, but some
    devices use this format, known as "big-endian." Most
    use the "little-endian" format where the MSB comes
    first and the LSB last - the littler part at the end.)

    If this doesn't produce sensible results, there is a
    more manual approach.

    I have an application with TI 'LS674 shift registers
    that just didn't come out right using SHIFTIN. So I
    built a manual version (I may revisit SHIFTIN or the
    delays built into this code, but I maintain that it
    just wasn't working out).

    clk CON 0 ' clock pin
    dio CON 1 ' data pin
    ad VAR WORD ' analog data
    i VAR NIB ' counter
    HIGH clk
    FOR j = 0 TO 15
    ad = ad << 1 ' shift left 1 bit,
    ' implied little-endian
    dio = IN1 ' Aside: can anyone do this better?
    ' So far I am either doing this for
    ' clarity or using literals like IN1
    ' in lines like the next one where
    ' I would much rather use a constant
    ' or variable.
    ad = ad + dio
    ' pulse clock so that next data bit goes to dio
    LOW clk
    PAUSE 10 ' milliseconds
    HIGH clk
    PAUSE 10
    NEXT
    DEBUG BIN16 ad, CR

    Hope this helps. The "<<" above can be replaced by a
    ">>" if the item ends up being big-endian. I use it
    for DIP switches, so big-endian and little-endian
    don't matter in my app.

    Bob Pence

    --- Wayne Fulcher <wayne@d...> wrote:
    > Basically the device is a card that is connected to
    > a dartboard.
    > The dartboard has a switch matrix of (19 pins) 11 X
    > 8 = 88 possibilities.
    > The card has two - 20 pin chips on it, which reads
    > the switch matrix and has
    > a 6 pin (RJ45) port to interface with.
    > The pin outs are as follows:
    > 1 - Ground
    > 2 - Ground
    > 3 - +5v
    > 4 - Data (Out from dartboard)
    > 5 - Clock (In to Dartboard)
    > 6 - Ground
    >
    > I don't have the board with me this second or I
    > would try to tell you what
    > type of chips those are. (If it mattered).
    >
    > Thanks,
    > Wayne Fulcher
    > wayne@d...
    >
    >
    Original Message
    > From: Pence Bob [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=tCl9H8GtTws79cmn8qtNdbj7-C8mrQB2v91VtbEy3tFkSOL43DPI4qxEExZ_XDT3Fa19DM8VmLc3ysOo4Xt2Ng]bobpence_2000@y...[/url
    > Sent: Thursday, June 28, 2001 4:53 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] TTL
    >
    > Wayne -
    >
    > What sort of device are you using? Is it an IC with
    > identifying information? Do you have a data sheet?
    > Or
    > is it a device like a transducer, which gives an
    > analog signal that must be converted to serial
    > digital
    > data by an ADC for the Stamp to deal with. I was
    > ready
    > to send some code samples, but realized that I may
    > be
    > answering the wrong question, so we should define
    > the
    > device to be read first.
    >
    > Bob Pence
    >
    >
    > --- Wayne Fulcher <wayne@d...> wrote:
    > > Thanks but what command do I use to read the data.
    > > The device has a Data Out Pin and a Clock In Pin.
    > > Could you please give me an example of how to read
    > > data from the device?
    > >
    > >
    > > Thanks,
    > > Wayne Fulcher
    > > wayne@d...
    > >
    > >
    Original Message
    > > From: Mark Hillier [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=3TjJhwRFd6jjDPAewBtlaohWUQ0w3foT9FKf8RmpEpqc8-DMN0OoC_QQUhJq8fEjknZGz_vTB1Ec]Mark@H...[/url
    > > Sent: Thursday, June 28, 2001 4:12 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: Re: [noparse][[/noparse]basicstamps] TTL
    > >
    > >
    > > > Does anyone know if the basic stamp can talk to
    > a
    > > TTL device and if so
    > > could you
    > > > give me a snippet code example and a tip on how
    > > the example is connected
    > > (use of
    > > > resistors etc.)?
    > >
    > > TTL refers to the voltage levels used to represent
    > > logic 0 and 1 (0 and 5
    > > VDC). The Stamps use these same voltage levels, so
    > > you can connect the 2
    > > directly together.
    > >
    > >
    > > Mark Hillier, VE6HVW
    > > President, HVW Technologies Inc.
    > > Canadian Distributors of Parallax Products and
    > other
    > > Neat Stuff
    > > Tel: (403)-730-8603 Fax: (403)-730-8903
    > > See our NEW BASIC Stamp Prototyping tools !
    > > http://www.hvwtech.com/stampstack.htm
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed
    > > with. Text in the Subject
    > > and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed
    > > with. Text in the Subject and Body of the message
    > > will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Get personalized email addresses from Yahoo! Mail
    > http://personal.mail.yahoo.com/
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed
    > with. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed
    > with. Text in the Subject and Body of the message
    > will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get personalized email addresses from Yahoo! Mail
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-29 13:42
    Oops. When I use dio = IN1 and ad = ad + dio, I am
    trying to assign a bit value to a constant, which
    tends to work better with variables. Let's pretend
    that I used a bit variable instead, or just did ad =
    ad + IN1, which brings back up my question in the
    comments (viz I can choose which output pin to set
    high or low with a variable, constant, or expression
    (HIGH pin_number_var), but can I read an input pin
    with a variable (ad = ad +
    IN(current_shift_register))?

    Bob Pence
    --- Pence Bob <bobpence_2000@y...> wrote:
    > Wayne -
    >
    > It would seem that there is not a third or forth pin
    > to deal with, at least not at this connection point.
    > So connect +5 and grounds, and pick a couple of
    > Stamp
    > I/O pins for clock and data. The Shiftin command is
    > your best choice, e.g.:
    >
    > clk CON 0 ' clock pin
    > dio CON 1 ' data pin
    > ad VAR WORD ' analog data
    > SHIFTIN dio, clk, MSBPOST, [noparse][[/noparse]ad\16]
    > DEBUG BIN16 ad, CR
    >
    > Look for any repetition in ad to see if the data is
    > less than 16 bits wide. The MSBPOST is a guess - a
    > guess that data follows the clock pulse (versus
    > MSBPRE, data present on data pin before the clock
    > pulse), and a guess that data is sent
    > most-significant-bit first, versus LSBPOST and
    > LSBPRE.
    > (MSB first implies that the nibble 1010 = 10
    > decimal,
    > while LSB first would make it 5 decimal. I'm not
    > used
    > to thinking of 1010 as 5 and 0101 as 10, but some
    > devices use this format, known as "big-endian." Most
    > use the "little-endian" format where the MSB comes
    > first and the LSB last - the littler part at the
    > end.)
    >
    > If this doesn't produce sensible results, there is a
    > more manual approach.
    >
    > I have an application with TI 'LS674 shift registers
    > that just didn't come out right using SHIFTIN. So I
    > built a manual version (I may revisit SHIFTIN or the
    > delays built into this code, but I maintain that it
    > just wasn't working out).
    >
    > clk CON 0 ' clock pin
    > dio CON 1 ' data pin
    > ad VAR WORD ' analog data
    > i VAR NIB ' counter
    > HIGH clk
    > FOR j = 0 TO 15
    > ad = ad << 1 ' shift left 1 bit,
    > ' implied little-endian
    > dio = IN1 ' Aside: can anyone do this better?
    > ' So far I am either doing this for
    > ' clarity or using literals like
    > IN1
    > ' in lines like the next one where
    > ' I would much rather use a
    > constant
    > ' or variable.
    > ad = ad + dio
    > ' pulse clock so that next data bit goes to dio
    > LOW clk
    > PAUSE 10 ' milliseconds
    > HIGH clk
    > PAUSE 10
    > NEXT
    > DEBUG BIN16 ad, CR
    >
    > Hope this helps. The "<<" above can be replaced by a
    > ">>" if the item ends up being big-endian. I use it
    > for DIP switches, so big-endian and little-endian
    > don't matter in my app.
    >
    > Bob Pence
    >
    > --- Wayne Fulcher <wayne@d...> wrote:
    > > Basically the device is a card that is connected
    > to
    > > a dartboard.
    > > The dartboard has a switch matrix of (19 pins) 11
    > X
    > > 8 = 88 possibilities.
    > > The card has two - 20 pin chips on it, which reads
    > > the switch matrix and has
    > > a 6 pin (RJ45) port to interface with.
    > > The pin outs are as follows:
    > > 1 - Ground
    > > 2 - Ground
    > > 3 - +5v
    > > 4 - Data (Out from dartboard)
    > > 5 - Clock (In to Dartboard)
    > > 6 - Ground
    > >
    > > I don't have the board with me this second or I
    > > would try to tell you what
    > > type of chips those are. (If it mattered).
    > >
    > > Thanks,
    > > Wayne Fulcher
    > > wayne@d...
    > >
    > >
    Original Message
    > > From: Pence Bob [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=c5LyLLIKoAzBZlM1qm0Of-0yZsmBodCFborOVOaJDcoiHP4bnG7cnDRg7Zc2_YTyle93p8OOvCjxgz-QsHnKfTQ5]bobpence_2000@y...[/url
    > > Sent: Thursday, June 28, 2001 4:53 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: RE: [noparse][[/noparse]basicstamps] TTL
    > >
    > > Wayne -
    > >
    > > What sort of device are you using? Is it an IC
    > with
    > > identifying information? Do you have a data sheet?
    > > Or
    > > is it a device like a transducer, which gives an
    > > analog signal that must be converted to serial
    > > digital
    > > data by an ADC for the Stamp to deal with. I was
    > > ready
    > > to send some code samples, but realized that I may
    > > be
    > > answering the wrong question, so we should define
    > > the
    > > device to be read first.
    > >
    > > Bob Pence
    > >
    > >
    > > --- Wayne Fulcher <wayne@d...> wrote:
    > > > Thanks but what command do I use to read the
    > data.
    > > > The device has a Data Out Pin and a Clock In
    > Pin.
    > > > Could you please give me an example of how to
    > read
    > > > data from the device?
    > > >
    > > >
    > > > Thanks,
    > > > Wayne Fulcher
    > > > wayne@d...
    > > >
    > > >
    Original Message
    > > > From: Mark Hillier [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=YDTrzS8ic8-VOUsPCTFkHDBek7atla3K6j4AoYqZqp4Ce-Ikgawy98gB-AosLoayQcTUKnpBAxo]Mark@H...[/url
    > > > Sent: Thursday, June 28, 2001 4:12 PM
    > > > To: basicstamps@yahoogroups.com
    > > > Subject: Re: [noparse][[/noparse]basicstamps] TTL
    > > >
    > > >
    > > > > Does anyone know if the basic stamp can talk
    > to
    > > a
    > > > TTL device and if so
    > > > could you
    > > > > give me a snippet code example and a tip on
    > how
    > > > the example is connected
    > > > (use of
    > > > > resistors etc.)?
    > > >
    > > > TTL refers to the voltage levels used to
    > represent
    > > > logic 0 and 1 (0 and 5
    > > > VDC). The Stamps use these same voltage levels,
    > so
    > > > you can connect the 2
    > > > directly together.
    > > >
    > > >
    > > > Mark Hillier, VE6HVW
    > > > President, HVW Technologies Inc.
    > > > Canadian Distributors of Parallax Products and
    > > other
    > > > Neat Stuff
    > > > Tel: (403)-730-8603 Fax: (403)-730-8903
    > > > See our NEW BASIC Stamp Prototyping tools !
    > > > http://www.hvwtech.com/stampstack.htm
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@yahoogroups.com
    > > > from the same email address that you subscribed
    > > > with. Text in the Subject
    > > > and Body of the message will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@yahoogroups.com
    > > > from the same email address that you subscribed
    > > > with. Text in the Subject and Body of the
    > message
    > > > will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > >
    > >
    >
    === message truncated ===


    __________________________________________________
    Do You Yahoo!?
    Get personalized email addresses from Yahoo! Mail
    http://personal.mail.yahoo.com/
Sign In or Register to comment.