Analog-to-Digital Converter - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Analog-to-Digital Converter

Description:

Analog-to-Digital Converter ... (e.g. the MC33272A from Motorola or the AD522 High Accuracy Data Acquisition Instrumentation Amplifier from Analog Devices) ... – PowerPoint PPT presentation

Number of Views:118
Avg rating:3.0/5.0
Slides: 33
Provided by: RichardH169
Category:

less

Transcript and Presenter's Notes

Title: Analog-to-Digital Converter


1
Analog-to-Digital Converter
  • Chapter 9
  • MC9S12DP256

2
Method of Successive Approximation
3
Implementing Successive Approximation
4
(No Transcript)
5
(No Transcript)
6
(No Transcript)
7
(No Transcript)
8
(No Transcript)
9
(No Transcript)
10
(No Transcript)
11
(No Transcript)
12
(No Transcript)
13
(No Transcript)
14
(No Transcript)
15
(No Transcript)
16
(No Transcript)
17
(No Transcript)
18
(No Transcript)
19
(No Transcript)
20
(No Transcript)
21
(No Transcript)
22
(No Transcript)
23
(No Transcript)
24
(No Transcript)
25
(No Transcript)
26
(No Transcript)
27
(No Transcript)
28
(No Transcript)
29
(No Transcript)
30
\ 9S12DP256 Analog-to-Digital Converter --
File ATD256.WHP HEX   0082 CONSTANT
ATD0CTL2 \ ATD Control Register 2 0084
CONSTANT ATD0CTL4 \ ATD Control
Register 4 0085 CONSTANT ATD0CTL5
\ ATD Control Register 5 0086 CONSTANT
ATD0STAT \ ATD Status Register 0090
CONSTANT ADR00H \ A/D Result
Register 0 ADCONV.ON ( -- ) 85
ATD0CTL4 C! \ 8-bit resol, /8 clock C0
ATD0CTL2 C! \ Set ADPU and AFFC  
ADCONV.OFF ( -- ) 0 ATDCTL2 C! \
Clear ADPU   WAIT.FOR.CONV ( -- ) BEGIN
7 ATD0STAT ?HI UNTIL
31
  AVG4 ( -- n ) \ Average 4
values in ADR0 - ADR3 0 ADR00H 2- 4 FOR
\ sum addr DUP R_at_ 2 C_at_ \
sum addr val ROT SWAP \ sum addr
NEXT DROP 4 /   ADCONV ( ch --
val ) \ Avg 4 readings from channel ch
ADCONV.ON 8 MOD 80 OR ATDCTL5 C! \ ch lt 8
SCAN0 MULT0 WAIT.FOR.CONV AVG4 ADCONV.OFF
 
32
  GET.4VALUES ( -- val4 val3 val2 val1 ) \
read 4 a/d regs ADR0H 2- 4 FOR
\ addr1 DUP R_at_ 2 C_at_ SWAP
\ valn addr1 NEXT DROP   ADCONV03
( -- val3 val2 val1 val0 ) \ Convert 1st 4
channels ADCONV.ON 10 ATDCTL5 C!
WAIT.FOR.CONV GET.4VALUES   ADCONV47
( -- val3 val2 val1 val0 ) \ Convert 2nd 4
channels ADCONV.ON 14 ATDCTL5 C!
WAIT.FOR.CONV GET.4VALUES   DECIMAL  
Write a Comment
User Comments (0)
About PowerShow.com