
REFS1 REFS0 selects the reference voltage. We have to configure the ADC by setting up ADMUX and ADCSRA registers.
Will connect a LDR( light dependent resistor) which is a light sensor to input. In this sample we will setup and use the ADC in single conversion mode. Peripherals of AVR” before using ADC of AVRs.)
The ADC Data Register – ADCL and ADCH : The final result. Says it has the status of ADC and is also use for controlling it. ADC Control and Status Register A – ADCSRA : As the name. The reference voltage and the input channel.
ADC Multiplexer Selection Register – ADMUX : For selecting. You configure the ADC according to need using these registersĪnd you also get the conversion result also using appropriate registers. You can connect up to 8 different sensors and get theirĪs you know the registers related to any particular peripheral module(likeĪDC, Timer, USART etc.) provides the communication link between the CPU and The ADC in ATmega32 has 8 channels that means you can take samples from eightĭifferent terminal. SystemĬlock can be divided by 2,4,16,32,64,128 by setting the Prescaler. Produces acceptable frequency for ADC from any system clock frequency. As the system frequency canīe set to any value by the user (using internal or externals oscillators)( In Lower frequency the conversion is more accurate. At higher frequency the conversion is fast while a
The ADC requires a frequencyīetween 50KHz to 200KHz. This clock generated by systemĬlock by dividing it to get smaller frequency. The ADC needs a clock pulse to do its conversion. It does a conversion and then start nextĬonversion immediately after that. While inįree it is continuously converting. In single conversion mode the ADC does the conversion and then stop.
#Extreme sample converter manual sampling free
The ADC can be operated in single conversion and free running more. The ADC is multiplexed with PORTA that means the ADC channels are shared Now you know the basics of ADC let us see how we can use the inbuilt ADC ofĪVR MCU.