(vii) Learning AD conversion for ADC0809 analog-to-digital conversion

Source: Internet
Author: User

ADC0808

Pin function each pin function is as follows:

26~28 (in0~in7): 8 Analog inputs 8, 14, 15 and 17~21:8 bits digital output (ALE): Address latch allows signal, input, high active. 6 (START): A/D conversion start pulse input, input a positive pulse (at least 100ns wide) to enable it to start (pulse rising edge to make 0809 reset, falling edge to start A/D conversion). 7 (EOC): A/D conversion end signal, output, when the A/D conversion ends, this end outputs a high level (always low during conversion).    9 (OE): Data output allows signal, input, high active. At the end of the A/D conversion, this terminal inputs a high level and outputs a digital quantity. (CLK): clock pulse input. Requires a clock frequency of not more than 640KHZ. (Vref (+)) and (Vref (-)): Reference voltage input 23~25 (ADDA, ADDB, ADDC): 3-bit address input line for the one-way simulation in the 8-channel analog input: Calculation formula: 3.45/5= x/255 then x=175.95 is 176 (corresponding to the LED 1011 0000), the experiment correctly refer to the program code:
1#include <reg52.h>2 #defineUchar8 unsigned char3 #defineuint16 unsigned int4 #defineLED P05 #defineOut P16Sbit start = p2^1 ;7Sbit OE = p2^7;//at the end of the A/D conversion, this terminal inputs a high level and outputs a digital quantity. oe=0, turn off output, no output to single chip microcomputer8Sbit EOC = p2^3;//A/D conversion end signal, output, when the A/D conversion ends, this end outputs a high level (the conversion period has been low). 9Sbit CLOCK = p2^0;//clock-Pulse inputTen  OneSbit add_a = p2^4;//ABC is used to select the channel of the ADC chip, ASbit add_b = p2^5; -Sbit Add_c = p2^6; -  the voidMainvoid) - { -  - Uchar8 temp; +  -Add_a=0; add_b=0; Add_c=1;//Select the ADC0809 chip Channel 4 corresponds to +  A    while(1) at   { -start=0; -start=1;//Rising edge makes 0809 reset -start=0;//Falling edge start ad conversion -        -        while(1) in       { -CLOCK =! CLOCK;if(EOC = =1) Break;//wait for the transition to end, jump out of the loop to       } +         -Oe=1; the  *temp = out;//Staging Conversion Results $OE =0;//Turn off outputPanax Notoginseng  -Led=~temp;//This is the reverse, because I have the wiring of the circuit. the                       //so through the software modification, so that the LED light is 1, out of 0 +                         //sample results are output to LED lights via P0 Port A   } the  +}

Summary: How to expand the display on the digital tube or LCD screen display it?????? A bit difficult, can't think of, there is no special decoder????

(vii) Learning AD conversion for ADC0809 analog-to-digital conversion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.