Difference between revisions of "ADC"
| m | |||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 32: | Line 32: | ||
| {{#Widget:LibTable}} | {{#Widget:LibTable}} | ||
| |- | |- | ||
| − | |Definition || uint16_t ADC_GetAdcValue(uint8_t  | + | |Definition ||<syntaxhighlight> uint16_t ADC_GetAdcValue(uint8_t var_adcChannel_u8)</syntaxhighlight> | 
| |- | |- | ||
| | Input Arguments || uint8_t : channel number | | Input Arguments || uint8_t : channel number | ||
| Line 46: | Line 46: | ||
| adc_result = ADC_GetAdcValue(0);  //Adc value for channel 0 | adc_result = ADC_GetAdcValue(0);  //Adc value for channel 0 | ||
| |} | |} | ||
| − | |||
| − | |||
| − | |||
| ==User guide== | ==User guide== | ||
| − | < | + | <html>    | 
| − | / | + | <script src="https://gist.github.com/Amritach/c2832a936ab1faf3117e.js"></script> | 
| − | + | </html>  | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | / | + | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | {{DISQUS}} | |
Latest revision as of 18:07, 30 May 2015
ADC
This library provides the functions for initializing the adc and to get the raw adc values. In case of AVR/PIC/ARM or other high end controllers the inbuilt adc is used. In case of 8051/8052 as it doesn't have an inbuilt adc, ADC0809(8-bit) adc is used.
ADC_Init
| Definition | void ADC_Init() | 
| Input Arguments | none | 
| Return Value | none | 
| Description | This function initializes the ADC module. | 
| Usage | void main() { ADC_Init(); } | 
ADC_GetAdcValue
| Definition | uint16_t ADC_GetAdcValue(uint8_t var_adcChannel_u8) | 
| Input Arguments | uint8_t : channel number | 
| Return Value | uint16_t(10 bit ADC result) | 
| Description | This function does the ADC conversion for the Selected Channel and returns the converted 10bit result. The adc value per bit depends on the resolution of the ADC. For AVR/PIC(10-bit adc) the adc value per lsb will be 5/1023=0048v | 
| Usage | uint16_t adc_result; adc_result = ADC_GetAdcValue(0); //Adc value for channel 0 | 
User guide
