Example 11 Analog-to-Digital Converter - PowerPoint PPT Presentation

About This Presentation
Title:

Example 11 Analog-to-Digital Converter

Description:

Method of Successive Approximation. Method of Successive ... { PLL_init(); // set system clock frequency to 24 MHz. ad0_enable(); // enable a/d converter 0 ... – PowerPoint PPT presentation

Number of Views:99
Avg rating:3.0/5.0
Slides: 8
Provided by: Richard6
Category:

less

Transcript and Presenter's Notes

Title: Example 11 Analog-to-Digital Converter


1
Example 11Analog-to-Digital Converter
  • Lecture L5.1

2
miniDragon
2 pushbutton switches
3
(No Transcript)
4
Method of Successive Approximation
5
Method of Successive Approximation
6
(No Transcript)
7
Example 11
// Example 11 A/D Converter -- Pot include
lthidef.hgt / common defines and macros
/ include ltmc9s12dp256.hgt / derivative
information / include "main_asm.h" / interface
to the assembly module / pragma LINK_INFO
DERIVATIVE "mc9s12dp256b" int val void
main(void) PLL_init() // set system clock
frequency to 24 MHz ad0_enable() //
enable a/d converter 0 lcd_init()
// enable lcd while(1) val ad0conv(7)
// read pot on channel 7 val val gtgt
1 // shift 1 bit right (divide by 2)
set_lcd_addr(0x40) // display on 2nd row of
LCD write_int_lcd(val) // write value in
field of 5 ms_delay(100) // delay 0.1
seconds
Write a Comment
User Comments (0)
About PowerShow.com