aLec22_ADC - Introduction to Embedded Microcomputer Systems...

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

View Full Document Right Arrow Icon
Introduction to Embedded Microcomputer Systems Lecture 23.1 Jonathan W. Valvano Recap Output compare interrupts Metrowerks Codewarrior Overview Analog to Digital Convertor Transducer: mechanical, electrical Using output compare interrupts to establish sampling Range(volts) = Precision(alternatives) • Resolution(volts) Figure 11.1. An analog signal is represented in the digital domain as discrete samples. Analog to digital Converter Analog input 0 V in +5 Digital output 0 ATD0DR0 1023 Digital Output is about 1024*V in /5 or Digital Output is about 1023*V in /5 Figure 11.2. Input/output functions of a 10-bit DAC and a 10-bit ADC. Find the 16 analog inputs on the 9S12DP512 Figure 4.18. Block diagram of a Freescale 9S12DP512. ATD0CTL2=$80; set bit 7 to enable ADC ATD0CTL3=$08; sequence length=1 10-bit, internal clock (how fast the ADC runs) Let m be the bottom 5 bits of ATD0CTL4 Internal clock is ½E/( m +1) (want this to be 1 MHz) At 4 MHz make ATD0CTL4=$01 ; m=1 At 8 MHz make ATD0CTL4=$03 ; m=3 At 24 MHz make ATD0CTL4=$0B ; m=11 Internal clock can be between 500kHz and 2 MHz ATD0CTL5 write channel number to start ADC channel number $80 to $87 ATD0STAT bit 7 SCF cleared by write to ATD0CTL5 set when ADC finished ATD0DR0 first 10-bit ADC result precision 10-bit, 1024 alternatives range 0 to +5V
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.

Page1 / 2

aLec22_ADC - Introduction to Embedded Microcomputer Systems...

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