32_device - SUM ;SUM = SUM+NOW 012A CE 03 84 LDX #900 012D...

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 D:\ece567\32.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 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
Background image of page 1

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

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

Unformatted text preview: 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 DECA 0133 97 F0 STAA INDEX 0135 26 D8 BNE LOOP1 0137 FC 01 E0 LDD SUM 013A 04 LSRD 013B 04 LSRD 013C 04 LSRD 013D 04 LSRD 013E 04 LSRD 013F 04 LSRD 0140 04 LSRD 0141 86 3D LDAA #61 0143 3D MUL 0144 04 LSRD 0145 04 LSRD 0146 04 LSRD 0147 04 LSRD 0148 04 LSRD 0149 04 LSRD 014A 04 LSRD 014B 53 COMB 014C F7 10 04 STAB PORTB 014F 20 B4 BRA LOOP3 END Symbol Table Symbol Table D:\ece567\32.asm PAGE 2 OPTION 1039 LOOP1 010F DELAY 012D LOOP2 0114 LOOP3 0105 INDEX 00F0 ADCTL 1030 SUM 01E0 ANALOG 0001 NOW 01D0 ADR2 1032 PORTB 1004...
View Full 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 / 2

32_device - SUM ;SUM = SUM+NOW 012A CE 03 84 LDX #900 012D...

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