ARM9(S3C2440) ADC

Publisher:Blissful567Latest update time:2022-04-27 Source: eefocusKeywords:ARM9  S3C2440  ADC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Analog signal/digital signal

(1) An analog signal is a physical quantity that is continuous in time and value, and has an infinite number of values. Most physical quantities perceived from nature are analog in nature, such as speed, pressure, temperature, sound, etc.


(2) Digital signals are discrete in both time and value, and the values ​​of discrete signals are only true or false, yes or no, so they can be represented by 0 and 1 in binary.

 

 

ADC driving process

 

 

 

 

ADC main driver


main.c


#define ADC_FREQ 2500000


void Main(void)

{

    /*Clock initialization*/

    Set_Clk();

   

    /*ADC initialization*/

    adc_init();

   

    while(1)

    {

     /*Read the conversion value*/

        adc_value=ReadAdc(0);


 delay(1000);

    }

}


 


void adc_init(void)

{undefined

 

 //Select the input channel, AIN0, corresponding to the W1 adjustable resistor on the development board

 int channel=0;

 

 /*Set the divided clock*/

 preScaler = ADC_FREQ;

 preScaler = 50000000/ADC_FREQ - 1; //PCLK=50M

 

 /*AD conversion frequency setting, maximum frequency is 2.5MHz*/

 rADCCON = (1<<14)|(preScaler<<6)|(channel<<3); //setup channel

 delay(1000);  


}


 


******************************************************/   

int ReadAdc(int channel)

{undefined

   /*Start AD conversion*/

   rADCCON |= 0x01; //start ADC

 

   while(rADCCON & 0x1); //check if Enable_start is low

 

   /* Check if the conversion is finished */

   while(!(rADCCON & 0x8000)); //check if EC(End of Conversion) flag is high

   

   return ( (int)rADCDAT0 & 0x3ff );

}


Keywords:ARM9  S3C2440  ADC Reference address:ARM9(S3C2440) ADC

Previous article:ARM9(S3C2440) Touch Screen
Next article:ARM9(S3C2440) UART

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号