SHIFTOUT - BASIC Stamp Command Reference
Page 314
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
At their heart, synchronous-serial devices are essentially shift-registers;
trains of flip-flops that receive data bits in a bucket brigade fashion from a
single data input pin. Another bit is input each time the appropriate edge
(rising or falling, depending on the device) appears on the clock line.
The SHIFTOUT instruction first causes the clock pin to output low and the
data pin to switch to output mode. Then, SHIFTOUT sets the data pin to
the next bit state to be output and generates a clock pulse. SHIFTOUT
continues to generate clock pulses and places the next data bit on the data
pin for as many data bits as are required for transmission.
Making SHIFTOUT work with a particular device is a matter of matching
the mode and number of bits to that device’s protocol. Most
manufacturers use a timing diagram to illustrate the relationship of clock
and data. One of the most important items to look for is which bit of the
data should be transmitted first; most significant bit (MSB) or least
significant bit (LSB). Table 5.92 shows the values and symbols available
for the Mode argument and Figure
5.39 shows SHIFTOUT’s timing.
Symbol
Value
Meaning
LSBFIRST
0
Data is shifted out lsb-first
MSBFIRST
1
Data is shifted out msb-first
(Msb is most-significant bit; the highest or leftmost bit of a nibble, byte, or word. Lsb is the
least-significant bit; the lowest or rightmost bit of a nibble, byte, or word.)
Figure 5.39: SHIFTOUT Timing
Diagram. Refer to the SHIFTOUT
Quick Answers table for timing
information on t
h
, t
l
, t
a
and t
b
.
Table 5.92: SHIFTOUT Mode
Values and Symbols.
SHIFTOUT
OPERATION
.
t
h
Clock
(cpin)
Data
(dpin)
t
l
SHIFTOUT begins,
makes Cpin output low
=previous state of pin unknown
t
a
t
a
t
b
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...