The main use of this Register is to enable the ADC features in AVR's I/O Port, Starting the conversion of analog, Enabling Interrupt, Setting a flag bit after conversion, Declaring mode either it will be free running or Single Conversion mode, and defining the Prescaler
ADEN (ADc ENable) : This bit of this register is used to enable the ADC feature in Atmega8's I/O Port (PC0 to PC5) otherwise these pins will work as GPIO (general purpose input output) pins.
ADSC (ADc Start Conversion) : Writing a logical 1 to this bit will start a conversion of analog data of that selected I/O pin. (ADMUX Register is used to select the pin for conversion. We will study ahead) In Single Conversion Mode, this bit will remain cleared until the conversion completes.
ADFR (ADc Free Running) : Writing a logical one to this bit enables the Free Running Mode where the ADC samples and updates the Data Register continuously. Clearing this bit will terminate this mode.
ADIF (ADc Interrupt Flag) : when the conversion is finished and Data Register is updated this bit is set to 1 automatically thus it is used to check whether conversion is completed or not
ADIE (ADc Interrupt Enable) : when this bit is set to 1 and the global interrupt ( I bit in SREG) are enabled the ADC interrupt is activated and the ADC ISR (Interrupt Service Routine) is called when conversion completed.
ADPS2 to ADPS0 (ADc Prescaler Select) : this bit determines the division factor between AVR clock frequency and the ADC clock frequency the following table describes the setting of this bits...
No comments:
Post a Comment