28123 Parallax Inc, 28123 Datasheet - Page 168

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
Page 160 · What’s a Microcontroller?
SUMMARY
This chapter introduced the potentiometer, a part often found under various knobs and
dials. The potentiometer has a resistive element that typically connects its outer two
terminals and a wiper terminal that contacts a variable point on the resistive element. The
potentiometer can be used as a variable resistor if the wiper terminal and one of the two
outer terminals is used in a circuit.
The capacitor was also introduced in this chapter. A capacitor can be used to store and
release charge. The amount of charge a capacitor can store is related to its value, which
is measured in Farads, (F). The µ is engineering notation for micro, and it means one-
millionth. The capacitors used in this chapter’s activities ranged from 0.01 to 3300 µF.
A resistor and a capacitor can be connected together in a circuit that takes a certain
amount of time to charge and discharge. This circuit is commonly referred to as an RC-
time circuit. The R and C in RC-time stand for resistor and capacitor. When one value
(C in this chapter’s activities) is held constant, the change in the time it takes for the
circuit to discharge is related to the value of R. When the value of R changes, the value
of the time it takes for the circuit to charge and discharge also changes. The overall time
it takes the RC-time circuit to discharge can be scaled by using a capacitor of a different
size.
Polling was used to monitor the discharge time of a capacitor in an RC circuit where the
value of C was very large. Several different resistors were used to show how the
discharge time changes as the value of the resistor in the circuit changes. The
RCTIME
command was then used to monitor a potentiometer (a variable resistor) in an RC-time
circuit with smaller value capacitors. Although these capacitors cause the discharge
times to range from roughly 2 to 1500 µs (millionths of a second), the BASIC Stamp has
no problem tracking these time measurements with the
command. The I/O pin
RCTIME
must be set
, and then the capacitor in the RC-time circuit must be allowed to charge
HIGH
by using
before the
command can be used.
PAUSE
RCTIME
PBASIC programming can be used to measure a resistive sensor such as a potentiometer
and scale its value so that it is useful to another device, such as a servo. This involves
performing mathematical operations on the measured RC discharge time, which the
command stores in a variable. This variable can be adjusted by adding a constant
RCTIME
value to it, which comes in handy for controlling a servo. In the Projects section, you

Related parts for 28123