Shop OBEX P1 Docs P2 Docs Learn Events
a: synchronous comms and b:stopwatch function info needed — Parallax Forums

a: synchronous comms and b:stopwatch function info needed

ArchiverArchiver Posts: 46,084
edited 2001-12-13 06:48 in General Discussion
Hello all:

I am looking for info on two subjects

1: Synchronous comms between two stamps. I want to do this to get
high speed comms between two stamps. Reading the manual, both the
shiftin and shiftout commands set a clock pin to output. I would have
thought one command would output a clock pulse, the other would
receive it. Not so? This doesn't make sense to me. Can comms be
established this way?

2: Part of my app is a lap timer function. I have thought of doing
this with a stamp for the timer, and another to do everything else,
(hence the comm link above) but would prefer to use something more
accurate. I need to be able to reset the watch and restart it every
few minutes. Looking for 10 millisecond resolution. Any other
hardware I should be looking at?

Thanks in advance

Duncan Potter

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-12-10 17:07
    >Hello all:
    >
    >I am looking for info on two subjects
    >
    >1: Synchronous comms between two stamps. I want to do this to get
    >high speed comms between two stamps. Reading the manual, both the
    >shiftin and shiftout commands set a clock pin to output. I would have
    >thought one command would output a clock pulse, the other would
    >receive it. Not so? This doesn't make sense to me. Can comms be
    >established this way?

    No, the stamp SHIFTIN and SHIFTOUT are designed to function as the
    Master in spi or microwire exchanges. The Stamp cannot function as a
    slave, unless you bit-bang the exchange (slow, but do-able.)

    >
    >2: Part of my app is a lap timer function. I have thought of doing
    >this with a stamp for the timer, and another to do everything else,
    >(hence the comm link above) but would prefer to use something more
    >accurate. I need to be able to reset the watch and restart it every
    >few minutes. Looking for 10 millisecond resolution. Any other
    >hardware I should be looking at?

    Here are external event timer chips that work with the stamp:

    http://www.al-williams.com/awce/pak7.htm
    8 channels, 5 microsecond resolution
    http://home.earthlink.net/~parkiss/tm1summ.txt
    many functions, resolution to 1 microsecond in hours
    http://www.phanderson.com/timer_1_2.html
    10 microsecond resolution in one minute, or 1 milliscond in 1 hour

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 01:43
    I also need to do synchronous coms between two SPI master devices
    (im my case, a Basic Stamp2 and a SitePlayer). Can someone explain
    the "bit-banging" technique? Speed is not critical for my
    application.

    Thanks!
    Wayt

    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >Hello all:
    > >
    > >I am looking for info on two subjects
    > >
    > >1: Synchronous comms between two stamps. I want to do this to get
    > >high speed comms between two stamps. Reading the manual, both the
    > >shiftin and shiftout commands set a clock pin to output. I would
    have
    > >thought one command would output a clock pulse, the other would
    > >receive it. Not so? This doesn't make sense to me. Can comms be
    > >established this way?
    >
    > No, the stamp SHIFTIN and SHIFTOUT are designed to function as the
    > Master in spi or microwire exchanges. The Stamp cannot function
    as a
    > slave, unless you bit-bang the exchange (slow, but do-able.)
    >
    > >
    > >2: Part of my app is a lap timer function. I have thought of doing
    > >this with a stamp for the timer, and another to do everything
    else,
    > >(hence the comm link above) but would prefer to use something more
    > >accurate. I need to be able to reset the watch and restart it
    every
    > >few minutes. Looking for 10 millisecond resolution. Any other
    > >hardware I should be looking at?
    >
    > Here are external event timer chips that work with the stamp:
    >
    > http://www.al-williams.com/awce/pak7.htm
    > 8 channels, 5 microsecond resolution
    > http://home.earthlink.net/~parkiss/tm1summ.txt
    > many functions, resolution to 1 microsecond in hours
    > http://www.phanderson.com/timer_1_2.html
    > 10 microsecond resolution in one minute, or 1 milliscond in 1
    hour
    >
    > -- regards,
    > Tracy Allen
    > electronically monitored ecosystems
    > mailto:tracy@e...
    > http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 06:48
    >I also need to do synchronous coms between two SPI master devices
    >(im my case, a Basic Stamp2 and a SitePlayer). Can someone explain
    >the "bit-banging" technique? Speed is not critical for my
    >application.
    >
    >Thanks!
    >Wayt


    Hi Wayt,

    There are examples of a bit-banged SPI master in BS1 app-notes 22 and
    23. (The old BS1 does not have a built-in SPI command, so
    bit-banging is the only way it can be made to talk with SPI devices.)

    It is really very simple to bit bang either the master or the slave,
    and you can make the BS2 a slave if speed is not the object. On the
    master device, you put a 8 bits of data out in succession on one pin,
    while on a second pin you generate a series of pulses. On the slave
    device, you listen for the series of pulses, and in conjunction with
    each pulse, you read one bit of data and assemble it into a byte at
    the end. The master usually also generates a "Chip select" signal
    on a third pin, and the slave uses that as a signal to start
    listening. You have to decide where to sample the data in relation
    to the pulses and the chip select--this is why there are several
    flavors of SPI.

    When you do this by bit-banging on a BS2, the exchange of 8 bits of
    data is going to take something like 5 to 10 milliseconds. In
    contrast, the serout command transfers the whole 8 bits in about 0.5
    millisecond. Some SPI masters and slaves can operate very
    fast--microseconds. The BS2 will not be able to listen as a slave to
    anything except something that you can program yourself to be slow.
    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com
Sign In or Register to comment.