28128 Parallax Inc, 28128 Datasheet - Page 138

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 format of the
The term
between 0 and 15 to select a pin. Since the converter input is connected to BASIC Stamp
pin P8 in the schematic, we need to set the pin value to 8.
Now, what about
pulse width to signal period. The term duty is different in the sense that it isn't the duty of
a cycle. It's the duty of all the pulses over a certain period of time. In other words, the
term
specific interval of time.
When the duty is 255, that means that all the pulses are high, and there is no low signal
between them. When all the pulses are high, it means that the capacitor will charge all the
way to 5 volts, the high value of the pulses. In theory, the capacitor can never actually
charge to 5 volts, but in practice, a time of 5×R×C brings the voltage to within 99.3% of
5 volts.
Therefore,
the duty to be? It's actually pretty simple because it works on a scale from 0 to 255,
where 0 is 0 volts and 255 is 5 volts. This looks like a method we already covered in
Chapter #3.
Assume we want 3.25 volts. In Chapter #3, we learned how to normalize a scale of 0 to 5
volts to a scale of 0 to 255. Remember that the measured voltage was to 5 as the A/D
output was to 255. This translated to fractions as:
In this case, the D/A output voltage is to 5 as the duty is to 255, which translates to
fractions as:
Duty
PWM Pin, Duty, Cycles
Voltage
D/A
Pin
specifies the ratio of high signal to the time duration of all the pulses in a
Duty
5
Output
5
refers to a BASIC Stamp I/O pin, and you can specify a pin number
is what controls the voltage level, but how do we figure out what we want
=
Duty
PWM
Decimal
=
? Remember from the Chapter #5 that duty cycle is the ratio of the
command is:
duty
255
255
A
/
D
input

Related parts for 28128