28128 Parallax Inc, 28128 Datasheet - Page 155

no-image

28128

Manufacturer Part Number
28128
Description
KIT BASIC ANALOG/DIGI PARTS ONLY
Manufacturer
Parallax Inc
Datasheet

Specifications of 28128

Accessory Type
ADC, DAC
Product
Microcontroller Accessories
For Use With/related Products
BASIC Stamp® 2 and Board of Education
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
The PBASIC instruction set has a command called
of time it takes a capacitor to discharge under the conditions just described. The format
of the
As usual,
P15. Now, what about
circuit shown in Figure 8-1. If we used an RC circuit instead, the state would be set to 0.
The
during discharge. How does this work?
First I/O pin 15 must be set high, to charge the capacitor to 5 volts. When the BASIC
Stamp gets to the
drop as shown in Figure 8-2. The BASIC Stamp counts the number of 2 microsecond
increments between switching to input and the time the voltage at P15 crosses the 1.4 volt
logic threshold. The number of 2 microsecond increments then gets saved as the
variable.
We'll use this segment of code in Program Listing 8.1 to measure the RC time. We will
first wait 100 ms with pin P15 high. This gives the capacitor enough time to charge up.
Result
RCTIME
RCTIME Pin, State, Result
HIGH 15
PAUSE 100
Pin
is a number of 2 microsecond time increments that the BASIC Stamp counted
P15
P14
P13
P12
P11
P10
P9
P8
P7
P6
P5
P4
P3
P2
P1
P0
refers to a BASIC Stamp I/O pin. Referring to Figure 8-1, we are using pin
X2
command is:
X3
RCTIME
Vdd
State
command, it switches I/O pin 15 to input. The voltage starts to
Vin
? The operator state is set to 1 when we are using the RC
Vss
Figure 8-4
Placement of the Photoresistor
Face the photoresistor into the slot in
the middle of the breadboard. This
way the photoresistor will detect the
light reflected off the white
breadboard. This will make the
photoresistor less subject to wide
resistance swings that can happen
when the photoresistor is faced
directly at bright light sources.
RCTIME
, which measures the amount
result

Related parts for 28128