Motorola Axiom CMD11E1 Betriebsanweisung Seite 97

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 101
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 96
9.7. A SIMPLE DIGITAL VOLTMETER 97
scanning mode, there is no need to issue any new commands. Measure the
input voltage, V and compute
255V
5
. Also note down the values in locations
$1031-$1034. Fill in the following table for different input voltages and
verify your results.
Measured
j
255
³
V
5
´k j
255
³
V
5
´k
Memory dump
Voltage (V) In Decimal In Hex $1031 $1032 $103 $1034
9.7 A simple digital voltmeter
We can write a simple voltmeter program to measure voltages in the zero to 5
volts range. Since the output is intended for human eyes, we want the output
to be in decimal. We will use one decimal accuracy so that the numbers will be
between 0 and 50 (decivolts) and we will put a decimal point between the two
digits. To convert the digital values to decivolts, we need to multiply by 50 and
then divide by 255. The steps are as follows:
1. Turn the A/D on and wait the required 100 microseconds
LDAA #%10000000
STAA OPTION
LDAA #40
LT
DECA
BNE LT
2. Initiate conversion with SCAN=1, MULT=0, PIN=3
LDAA #%00100011 *SCAN=1, MULT=0, PIN = 011 (PE3)
STAA ADCTL
3. Make sure that the conversion is complete
WCCF
LDAA ADCTL
ANDA #%10000000
BEQ WCCF
Seitenansicht 96
1 2 ... 92 93 94 95 96 97 98 99 100 101

Kommentare zu diesen Handbüchern

Keine Kommentare