130-28176 Parallax Inc, 130-28176 Datasheet - Page 211

KIT PARTS PROCESS CONTROL

130-28176

Manufacturer Part Number
130-28176
Description
KIT PARTS PROCESS CONTROL
Manufacturer
Parallax Inc
Datasheets

Specifications of 130-28176

Accessory Type
Education Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Board of Education Full Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
The
respectively. The settings are scaled accordingly to apply 0-5 V to these pins using
PWM. Note that it is again using our transfer function line equation, y = mx + b where
b= 0, though slightly rearranged.
If 255 were divided by 50 first, the slope would have been 5 and not 5.1. By multiplying
first, while ensuring 65535 is not exceeded, we have better resolution and accuracy.
The
After enabling the IC using the Chip Select (CS) pin, the data from the ADC is shifted in
using a clock pulse on the clock (CLK) line and data is collected from the Data Out (DO)
pin. The
In the
Working with the original ADC values, a span of 0.5 would have related to 50 °F. If we
used 50 in our equation for 50/255 this would equal 0.196, but since the BASIC Stamp
does not perform floating-point math, this would be 0! By multiplying by 1000, the
result is 196 providing a reading of 8007 for a temperature of 80.07. Again, a precaution
is that 65535 is not exceeded for any intermediary calculation, such as with a span of
5.0 V.
The
value in decimal and binary respectively, as read from the ADC0831, and also updates
txtTemp
SetADC
UpdateSP
ReadADC
CalcTemp
PWM ADC_Vminus, V_Offset * 255/50,100
PWM value = (voltage desired in 10ths) x (byte value span)/(max. voltage in 10ths)
PWM value = (voltage in tenths) x 255/50
TempF = (V_Span * 1000)/255 * ADC_ByteValue + (V_Offset * 1000)
\9
with the current temperature divided by 100.
DEBUG "!O txtByteBin = ", BIN8 ADC_ByteValue,CR,
DEBUG "!O txtTemp = [", DEC TempF,",/,100]",CR
LOW ADC_CS
SHIFTIN ADC_Dout, ADC_Clk, MSBPOST,[ADC_ByteValue\9]
HIGH ADC_CS
means that 9 bits are collected, though the first is not used and is discarded.
subroutine uses the span and offset values to control the Vref and Vin(-) pins
subroutine reads the ADC and stores the byte collected in
subroutine updates the
"!O txtByte = ", DEC ADC_ByteValue,CR
section, the values of
txtByte
V_Span
and
and
txtByteBin
V_Offset
are multiplied by 1000.
text boxes with the byte
ADC_ByteValue
.

Related parts for 130-28176