Shop OBEX P1 Docs P2 Docs Learn Events
Help! Looking for info on how to connect two BS2''s together? — Parallax Forums

Help! Looking for info on how to connect two BS2''s together?

ArchiverArchiver Posts: 46,084
edited 2002-09-05 19:56 in General Discussion
On Thu, 2002-09-05 at 13:15, eccentric_mofo wrote:
> I am new to BS' and am looking for some information on tying two
> BS2's together.
>
> What I want to do is connect two basic stamps together, essentially
> make one a "master" and one a "slave." If the master fails, I want
> the slave to take over the master's tasks. I think this can be
> accomplished via a subroutine of some sorts, but I am not sure of how
> one would "monitor" the other.....

There's a few different ways you can go about this.

First off, you should be able to find some previous stamp apps in
regards to networking two stamps together, although it sounds like you
don't really need a network between the stamps, but more of a heartbeat
between them, the heartbeat would just be a recurring pulse on a pin.
Unless of course the primary stamp is going to hold some values in one
or more variables that you want to keep the standby stamp updated with.

This sort of redundancy is common in networking equipment, which is
where the method I'll describe is borrowed from...

Basically, I'd suggest configuring such that 1 stamp is designated as
the primary and 1 is the standby. The logic should dictate that the
primary have every chance to perform its role. The primary stamp tells
the standby stamp that it is doing it's job by sending a heartbeat to
the standby every "x" seconds, where x is some number that ensures
minimal interruption without placing a burden on the program loop (put
another way, you have to find your own best value for x). If the
secondary stamp doesn't see a heartbeat from the primary stamp in x+1
seconds, then it "shoots" the first stamp, basically by toggling the
reset pin to cause the primary to reset, then waits x+1 seconds for a
heartbeat again. If no heartbeat is heard then the secondary stamp
removes power to the primary stamp and takes over itself, and hopefully
throws up some kind of a visible or audible flag.

Another option that makes the stamp more interchangeable would be they
have the exact same program and they are sending heartbeats to each
other. When one stamp sees a lack of heartbeat from the other, it
"shoots" the idle stamp and takes over.

The other logistics can range from very simple to very difficult,
depending on what these stamps will be doing. You may have to implement
some way to electrically share and/or switch I/O's between the 2 stamps.
Sign In or Register to comment.