34_device - ADDR B1 B2 B3 B4 F:\ECE567\jrECE...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ADDR B1 B2 B3 B4 F:\ECE567\jrECE 567\34_device.ASM PAGE 1 OPTION EQU $1039 ADCTL EQU $1030 ADR2 EQU $1032 INDEX EQU $F0 NOW EQU $1D0 SUM EQU $1E0 PORTB EQU $1004 ANALOG EQU $1 TOTAL EQU $3 INDEX2 EQU $5 B EQU $7 A EQU $8 ORG $10 0010 01 TABLE FCB $1 ;BCD table 0011 02 FCB $2 0012 04 FCB $4 0013 08 FCB $8 0014 16 FCB $16 0015 32 FCB $32 0016 64 FCB $64 ORG $100 0100 86 90 LDAA #$90 ;TURN ON ADC 0102 B7 10 39 STAA OPTION 0105 CC 00 00 LOOP3 LDD #$0000 0108 FD 01 E0 STD SUM ;initialize running total to zero 010B 86 80 LDAA #128 010D 97 F0 STAA INDEX ;loop index for averaging 010F 86 01 LOOP1 LDAA #1 0111 B7 10 30 STAA ADCTL ;channel selection 0114 7D 10 30 LOOP2 TST ADCTL ;wait for EOC 0117 2A FB BPL LOOP2 0119 4F CLRA 011A 5F CLRB 011B F6 10 32 LDAB ADR2 ;Get converted result 011E FD 01 D0 STD NOW 0121 FC 01 E0 LDD SUM ;Get running total 0124 F3 01 D0 ADDD NOW 0127 FD 01 E0 STD SUM ;SUM = SUM+NOW 012A CE 03 84 LDX #900 012D 09 DELAY DEX 012E 26 FD BNE DELAY 0130 96 F0 LDAA INDEX 0132 4A
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/08/2011 for the course ECE 567 taught by Professor Staff during the Spring '08 term at Ohio State.

Page1 / 3

34_device - ADDR B1 B2 B3 B4 F:\ECE567\jrECE...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online