Вы находитесь на странице: 1из 26

ANALOG TO DIGITAL

CONVERSION
ADC

ROBO INDIA
http://roboindia.com

WHY
SIGNALS ???

SIGNAL
CARRY
INFORMATIO
N

TYPE OF
SIGNALS???

TYPE OF SIGNALS
SIGNAL

DISCRETE

CONTINO
US

ANALOG SIGNAL
Are all CONTINUOUS time signals
ANALOG ?
All continuous time signals are
analog but all analog signals are
not continuous time

ANALOG SIGNAL

ANALOG
Cont.
Time

Discrete
Time

A/D WORKING
The ADC converts an analog input
voltage to a 10-bit digital value
through successive approximation.
The minimum value represents
GND and the maximum value
represents the voltage on the
AREF pin minus 1 LSB

A/D CONVERSION

SIGNAL PROCESSING
Signal
Processi
ng
Analog

Digital

Mixed

SIGNAL PROCESSING
What's wrong with totally
analog

Ans Two arrows in a Quiver is


always better than one

SIGNAL PROCESSING
A digital signal is superior to an
analog signal because it is more
robust to noise and can easily be
recovered,
corrected
and
amplified. For this reason, the
tendency today is to change an
analog signal to digital data

NEED OF A/D OR D/A ?

PROGRAMMING OF ADC

ADC PROGRAM
ReadADCX()
{
ADMUX=0x4X;
ADCSRA=0x86;
SETBIT(ADCSRA,BIT(6));
while(!(ADCSRA & (1<<ADIF)));
s=ADC;
return(s);
}

NOTE: X can take value

ADMUX
ADMUX = 0x4X
Let x = 1
ADMUX = 0x41 ADMUX =
01000001

ADMUX

REFS1 = 0
REFS0 = 1

ADMUX

The ADLAR bit affects the


presentation of the ADC
conversion result in the ADC Data
Register.
ADLAR = 0 LEFT ADJUST
ADLAR = 1 RIGHT ADJUST

ADMUX

MUX4..0 =
00001

ADC PROGRAM
ReadADCX()
{
ADMUX=0x4X; // DONE
ADCSRA=0x86;
SETBIT(ADCSRA,BIT(6));
while(!(ADCSRA & (1<<ADIF)));
s=ADC;
return(s);
}

NOTE: X can take value

ADCSRA
ADCSRA = 0x86
Let x = 1
ADCSRA = 0x41 ADCSRA =
10000110

ADCSRA

BIT 7
ADEN ADC Enable bit
ADEN = 1 Enable ADC
ADEN = 0 Disable ADC

ADCSRA

BIT 6
ADSC - Write this bit to one to
start each conversion

ADCSRA

BIT 4
ADIF - This bit is set when an
ADC conversion completes

ADCSRA

ADPS2..0 = 110 Division factor


is 64

ADC PROGRAM
ReadADCX()
{
ADMUX=0x4X; // DONE
ADCSRA=0x86; // DONE
SETBIT(ADCSRA,BIT(6)); // DONE
while(!(ADCSRA & (1<<ADIF)));
s=ADC;
return(s);
}

NOTE: X can take value

Вам также может понравиться