-
ADC conversion time
- Conversion time of ADC depend upon clock of crystal oscillator through which it gets clock, in modern microcontroller, provided separately in Ksps (Kilo sample per second).
- ADC requires an input clock of frequency less than 200 KHz for maximum accuracy
- Lower the frequency higher the precision
- In AVR first conversion take 25 ADC clock cycle to initialize analog circuitory and pass the sample and hold circuit
- Then next each consecutive conversion take 13 ADC clock cycle
-
ADC connection to ATmega32
- To get better accuracy of ADC, we must provide stable voltage source to AVcc.
- And we done throut it by 100nF capacitors and inductor of 10 uH.
-
Register associated in programming of ADC are
ADMUX
- ADLAR – ADC left adjust result,In ATmega32 ADC is of 10 bit which mean result is of 10 bit. So it can’t see in single byte register and there for there is two register of each single byte named as ADCH (high byte) and ADCL (low byte). In this 16 bit only 10 bit are used rest are not used. By ADLAR bit we can use this 10 bit of left most or right most.
If ADLAR = 1 , 10 bit are shifted left in ADCH and ADCL
If ADLAR = 0 , 10 bit are shifted right in ADCH and ADCL
|
- MUX (DIFFERENTIAL INPUT TO USE OPAMP GAIN)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
- MUX (SINGLE ENDED)- in differential mux select, we can also control a gain of op-amp upto 200x. in this mode , positive input of the opamp to ve ADC0 to ADC7 and negative input of the opamp be ADC0, ADC1 and ADC2. And in this mode of operation we can use single channel of ADC as input and common ground as ground.
|
ADCSRA
- ADEN = 1, mean ADC enable and ADEN = 0, mean ADC disable
- ADSC = 1, mean ADC start conversion and ADEN = 0 mean ADC conversion disable
- ADATE = ADC auto trigger enable
- ADIF = ADC interrupt flag. 1 mean conversion complete
- ADIE = ADC interrupt enable when 1.
- ADPS
|