21.11.2014 Views

STAMP 2 Communications And Control Projects.pdf

STAMP 2 Communications And Control Projects.pdf

STAMP 2 Communications And Control Projects.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

NETWORKING <strong>STAMP</strong> 2’S 29<br />

I/O<br />

VSS<br />

(GND)<br />

I/O<br />

VSS<br />

(GND)<br />

I/O<br />

VSS<br />

(GND)<br />

<strong>STAMP</strong> 2 <strong>STAMP</strong> 2 <strong>STAMP</strong> 2<br />

1 2 3<br />

Figure 2-13<br />

<strong>STAMP</strong> 2 network open/noninverted baudmode.<br />

+5V<br />

1K<br />

I/O VSS I/O VSS I/O VSS<br />

<strong>STAMP</strong> 2 <strong>STAMP</strong> 2 <strong>STAMP</strong> 2<br />

1 2 3<br />

Figure 2-14<br />

<strong>STAMP</strong> 2 network open/inverted baudmode.<br />

party line network. Open baudmodes can actively drive the Serout pins only in one state; in<br />

the other state they disconnect the I/O pin. Since the open baudmodes drive only in one state<br />

and float in the other, there’s no chance of shorting the I/O pins. Note the polarity selected for<br />

Serout determines which state is driven and which is open; see Table 2-2. Since the open baudmodes<br />

drive to only one state, they need a resistor to pull the network into the other state, as<br />

shown in Figs. 2-13 and 2-14.<br />

Open baudmodes allow the <strong>STAMP</strong> 2 to share a party line, but it is up to the software to<br />

resolve other network problems, such as who talks when and how to prevent data errors. In<br />

the example in Fig. 2-15, and in the programs illustrated in BSNET1.BS2 and BSNET2.BS2<br />

(Listings 2-1 and 2-2) the two <strong>STAMP</strong> 2’s share a party line. They monitor the serial line for<br />

a specific word (“Yin” or “Yang”) and then transmit data. A personal computer can be used<br />

to monitor the net activity via a line driver or CMOS inverter, as shown in Fig. 2-15. The<br />

result of the two programs BSNET1.BS2 and BSNET2.BS2 is that a monitoring PC would

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!