28129 Parallax Inc, 28129 Datasheet - Page 86

TEXT BASIC ANALOG & DIGITAL

28129

Manufacturer Part Number
28129
Description
TEXT BASIC ANALOG & DIGITAL
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28129

Style
Book
Title
Basic Analog and Digital
Contents
Basic Analog and Digital Text
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
Addressing
Until now, we’ve been addressing each of the I/O lines one at a time. This works well
whenever you need to have control over the status of a particular control line. For
example, a single LED, is easily addressed by the individual I/O pin to which it is
connected using
either 0 or 1.
Since the I/O pins (P4 through P7) are used as outputs in this experiment, it would be
easier and more efficient to have a method of addressing this group of bits. Notice that it
takes four lines of code just to set up the bits as outputs, and then it takes 4 additional
lines to individually set each bit. It’s not a big deal now, but as time goes on and you
Addressed: When an I/O pin is addressed, it means that a value has been written into a
particular place in the BASIC Stamp's RAM. For example, a particular memory location can
be set high to set a given I/O pin to be an output. Another address might be used to set the
pin high or low.
Performing these operations one bit at a time is not always efficient. The memory locations
are adjacent to each other so that the operations can be performed 1 nibble (4-bits) at a time
or one byte (8-bits) at a time, or even a word (16-bits) at a time.
OUTp=value
, where p is a pin number between 0 and 15, and value is
Figure 4-4
Debug Terminal
Output for Program
Listing 4.1, Revision
1.

Related parts for 28129