28123 Parallax Inc, 28123 Datasheet - Page 160

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
How ReadPotWithRcTime.bs2 Works
Here are the pseudo-code steps the program goes through to take the RC-time
measurement.
Before the
RCTIME
input. As an input, the I/O pin looks about the same to the circuit as when the pushbutton
was released (open circuit) in Activity #2. The
of the polling that was used in Activity #2, and it measures the amount of time it takes for
the capacitor to lose its charge and fall below the I/O pin’s 1.4 V input threshold. Instead
of counting in 100 ms increments, the
Your Turn – Changing Time by Changing the Capacitor
ACTIVITY #4: CONTROLLING A SERVO WITH A POTENTIOMETER
Potentiometers together with servos can be used to make lots of fun things. This is the
foundation for model airplanes, cars and boats. This activity shows how the BASIC
Stamp can be used to monitor a potentiometer circuit and control the position of a servo.
command executes, the BASIC Stamp changes the I/O pin from an output to an
Declare the variable
Code block within
Replace the 0.1 µF capacitor with a 0.01 µF capacitor.
Try the same positions on the potentiometer that you did in the main activity
and compare the value displayed in the Debug Terminal with the values
obtained for the 0.1 µF capacitor. Are the
value?
Go back to the 0.1 µF capacitor.
With the 0.1 µF capacitor back in the circuit and the 0.01 µF capacitor
removed, make a note of the highest and lowest values for the next activity.
RCTIME
o
o
o
o
o
Set I/O pin P7 to
Wait for 100 ms (20 ms to make sure the capacitor is charged up and 80
more ms to keep the Debug Terminal display steady).
Execute the
Store the time measurement in the
Display the value
command is executed, the capacitor is fully charged. As soon as the
DO…LOOP
RCTIME
time
HIGH
time
to store a time measurement.
:
command.
RCTIME
.
in the Debug Terminal.
command counts in 2 µs increments.
RCTIME
time
RCTIME
command is a high speed version
variable.
measurements one tenth the

Related parts for 28123