27297 Parallax Inc, 27297 Datasheet - Page 218
27297
Manufacturer Part Number
27297
Description
KIT STAMPWORKS WITH BS2-IC
Manufacturer
Parallax Inc
Datasheet
1.27297.pdf
(230 pages)
Specifications of 27297
Lead Free Status
Contains lead
Product
Microcontroller Accessories
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
- Current page: 218 of 230
- Download datasheet (3Mb)
Get_ADC:
Behind the Scenes
A comparator is a circuit used to compare two voltages; when the voltage on the +
(noninverting) input of the comparator is greater than the voltage on the –
(inverting) input, the output will be high, otherwise it is low. Using this behavior an
unknown voltage can be determined by applying a known voltage to the other side
of the comparator and checking the output.
This process can, of course, be done with any BASIC Stamp and an external
comparator. For this experiment we will take advantage of the built-in comparator
feature of the BS2px. By doing so we use just three I/O pins and a few standard
components.
A simplistic method for determining the unknown voltage would be a loop that
essentially sneaks up on the unknown voltage:
The problem with this strategy is the length of conversion when the unknown voltage
is biased toward the high side of the scale. The solution this problem is a technique
adcVal = 0
bias = 128
DO
LOOP UNTIL (bias = 0)
RETURN
adcVal = adcVal + bias
PWM DacOut, adcVal, 15
COMPARE 2, result
IF (result = 1) THEN
ENDIF
bias = bias / 2
adcVal = adcVal - bias
Get_ADC_Simple:
adcVal = 0
DO
LOOP UNTIL (adcVal = 255)
RETURN
PWM DacOut, adcVal, 15
COMPARE 2, result
IF (result = 1) THEN EXIT
adcVal = adcVal + 1
' clear ADC
' start in middle
' add bias to adc result
' output new test value
' check comparator
' if unknown lower than test
' -- reduce adcVal
' check next half
' slow version
' output new value
' check comparator
' voltage found
' increment result
Related parts for 27297
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
CONTROLLER 16SERVO MOTOR CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BASIC STAMP LOGIC ANALYZER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: