| Electronic Components Datasheet Search |
|
STC12LE5616AD Datasheet(PDF) 233 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC12LE5616AD Datasheet(HTML) 233 Page - STCmicro Technology Co,.Ltd |
|
233 / 377 page ![]() void main() { InitUart(); //Init UART, use to show ADC result InitADC(); //Init ADC sfr while (1) { ShowResult(0); //Show Channel0 ShowResult(1); //Show Channel1 ShowResult(2); //Show Channel2 ShowResult(3); //Show Channel3 ShowResult(4); //Show Channel4 ShowResult(5); //Show Channel5 ShowResult(6); //Show Channel6 ShowResult(7); //Show Channel7 } } /*---------------------------- Send ADC result to UART ----------------------------*/ void ShowResult(BYTE ch) { SendData(ch); //Show Channel NO. SendData(GetADCResult(ch)); //Show ADC high 8-bit result //if you want show 10-bit result, uncomment next line // SendData(ADC_LOW2); //Show ADC low 2-bit result } /*---------------------------- Get ADC result ----------------------------*/ BYTE GetADCResult(BYTE ch) { ADC_CONTR = ADC_POWER | ADC_SPEEDLL | ch | ADC_START; _nop_(); //Must wait before inquiry _nop_(); _nop_(); _nop_(); while (!(ADC_CONTR & ADC_FLAG)); //Wait complete flag ADC_CONTR &= ~ADC_FLAG; //Close ADC return ADC_DATA; //Return ADC result } 233 |
|
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 |