28128 Parallax Inc, 28128 Datasheet - Page 139
28128
Manufacturer Part Number
28128
Description
KIT BASIC ANALOG/DIGI PARTS ONLY
Manufacturer
Parallax Inc
Datasheet
1.28129.pdf
(176 pages)
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
- Current page: 139 of 176
- Download datasheet (3Mb)
Usually, we know what voltage we want, so we can rearrange the equation to tell us what
duty we need:
Since we want our D/A output to be 3.25 volts:
The number 165.75 should be rounded to 166 so that we can set the duty to an integer
value.
The last quantity we need to determine for the
how many milliseconds the PWM output lasts, and it can be a number up to 65,535. The
typical method for choosing how many cycles to charge is:
Since we used a 1.0 µF capacitor and a 10 kΩ resistor,
For the components we are using, we need to set the
40.
Now we know that to generate a 3.25 volt output, our
Let's try it.
Program It
Modify the declarations section of Program 4.1 so that the variable n is defined as a word
instead of a nibble:
duty = 255 × (D/A Output ÷ 5)
duty = 255 × (3.25 ÷ 5) = 165.75
cycles = 4 × R × C, in milliseconds
cycles = 4 × 0.000001 × 10,000 = 0.04 = 40 × 10-3 = 40 ms
' -----[ Declarations ]--------------------------------------
adcBits
v
r
v2
v3
n
' -----[ Initialization ]------------------------------------
CS
PWM 8, 166, 40
VAR
VAR
VAR
VAR
VAR
VAR
PIN
Byte
Byte
Byte
Byte
Byte
Word
0
PWM
‘
command is
Cycles
PWM
changed line
command needs to be:
value in the
Cycles
, which specifies
PWM
command to
Related parts for 28128
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: