| Electronic Components Datasheet Search |
|
STC12LE5616AD Datasheet(PDF) 227 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC12LE5616AD Datasheet(HTML) 227 Page - STCmicro Technology Co,.Ltd |
|
227 / 377 page ![]() BYTE ch = 0; //ADC channel NO. void main() { InitUart(); //Init UART, use to show ADC result InitADC(); //Init ADC sfr AUXR |= 0x10; //set EADCI IE = 0xa0; //Enable ADC interrupt and Open master interrupt switch //Start A/D conversion while (1); } /*---------------------------- ADC interrupt service routine ----------------------------*/ void adc_isr() interrupt 5 using 1 { ADC_CONTR &= !ADC_FLAG; //Clear ADC interrupt flag SendData(ch); //Show Channel NO. SendData(ADC_DATA); //Get ADC high 8-bit result and Send to UART //if you want show 10-bit result, uncomment next line // SendData(ADC_LOW2); //Show ADC low 2-bit result if (++ch > 7) ch = 0; //switch to next channel ADC_CONTR = ADC_POWER | ADC_SPEEDLL | ADC_START | ch; } /*---------------------------- Initial ADC sfr ----------------------------*/ void InitADC() { P1 = P1M0 = P1M1 = 0xff; //Set all P1 as Open-Drain mode ADC_DATA = 0; //Clear previous result ADC_CONTR = ADC_POWER | ADC_SPEEDLL | ADC_START | ch; Delay(2); //ADC power-on delay and Start A/D conversion } /*---------------------------- Initial UART ----------------------------*/ 227 |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |