28128 Parallax Inc, 28128 Datasheet - Page 105

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
peak amplitude. The D/A converter's output is programmed for a maximum of 3 volts and
a minimum of 1.6 volts. Therefore the peak-to-peak amplitude is 3 – 1.6 volts = 1.4 volts.
The DC offset is the difference between 0 volts and the waveform's minimum value. We
already know the lowest point of the sample triangle wave is 1.6 volts, and that's the DC
offset.
An alternative reference point for both Amplitude and DC offset is half way between the
upper and lower peak. The half way point would be (3 + 1.6), 2 volts = 2.3 volts. The
amplitude would be 3 – 2.3 volts = 0.7 volts. The DC offset would be 1.6 + 0.7 volts =
2.4 volts.
The
block. This code block uses a
counts for
D/A converter increases and then decreases in the Stamp-O-Scope display.
Each time a
sends the program to the
The
difference is that now it's a subroutine. The
our Stamp-O-Scope display, so the
save EEPROM memory, you could also delete the entire subroutine. Keep that in mind if
you use this in a larger application and start to run out of EEPROM memory to store your
program.
About the Code
Main
Main
DO
LOOP
Main:
subroutine still does the same job it did in the previous experiment. The only
n
routine is has been relegated to a subroutine in favor of the
FOR n = 7 TO 15
NEXT
FOR n = 14 TO 8
NEXT
GOSUB DAC
GOSUB ADC_Data
'GOSUB Calc_Volts
, the value sent to the D/A converter. This is why the measured output of the
FOR…NEXT
GOSUB Main
GOSUB Main
loop in the
Main
subroutine.
FOR…NEXT
DO…LOOP
GOSUB Calc_Volts
loop to increment and decrement up and down
Calc_Volts
routine increments the value of
subroutine is not necessary for
command is commented. To
DO…LOOP
n
, it also
code

Related parts for 28128