28128 Parallax Inc, 28128 Datasheet - Page 89

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
This would result in I/O pin P6 being set as an output, and all the other pins (P0, P1, P3)
set as inputs. Hence the command
“1”) sets up each of the I/O lines as outputs.
Sweeping the value of
A truly powerful aspect of using this method of addressing is that we can use PBASIC to
count up and down or access values from a look up table to automatically address the I/O
pins. The result is that we can program the BASIC Stamp to more effectively control the
D/A converter output.
Modify the code labeled
DEBUG CLS
Modify the main subroutine as shown:
Delete the line that sets the value of
look like this:
Also modify the
'Start display
DEBUG CLS, "DAC Nibble Values", CR
DEBUG "Decimal
' -----[ Main Routine ]--------------------------------------
FOR n = 0 TO 15
NEXT
STOP
DAC:
RETURN
Display:
RETURN
GOSUB DAC
GOSUB ADC_Data
GOSUB Calc_Volts
GOSUB Display
DIRB = 15
OUTB = n
DEBUG DEC2 n, "
DEBUG DEC1 v, ".", DEC2 v2, " Volts", CR
command, and then add a second line as shown.
Display
n
from 0 to 15 should result in the same values as before.
subroutine as shown.
'Start Display
Binary DVM", CR
", BIN4 n, " "
DIRB=15
n
in the
(by virtue of the fact that all four bits are a
in Program Listing 4.1. First, modify the
DAC
'
subroutine. Once that's done it should
'
'
'

Related parts for 28128