yogi
Full Member level 6
atmega32 adc
I am having too much problems with noise in the in-built ADC of atmega32
Instead of external voltage I used internal 2.56 Vref and applied the voltage, then I am getting 2.55V for 2.24V. I used a capacitor of 150pf,22pf b/w AREF and ground.
I removed the multimeter probes from the breadboard, then a small difference came. But the noise is too much. My aim is to interface LM35 with atmega32. So I am just checking with a potentiometer.
Is there any way to avoid this noise
wht should be the value of capacitor b/w AREF and ground
My code
.cseg
.org 0x000
rjmp RESET
RESET:
ldi r16,0xff
out $11,r16 ;DDRD as output
out $12,r16 ; for checking if ADC is not good
out $17,r16
out $18,r16
rjmp ADC_INIT
ADC_INIT:
ldi r16,0b11100000 ; setting AD1,AD0 in ADCL
;internal 2.56 reference,Single
;channel A0
out $07,r16 ;setting ADMUX
ldi r16,0b10000101 ;setting control reg. ck/32
out $06,r16 ;setting ADCSRA
rjmp ADCSTART
ADCSTART:
sbi $06,6
WAIT:
sbis $06,4
rjmp WAIT
in r16,$04;ADCL
in r17,$05;ADCH
out $12,r17
out $18,r16
rjmp ADCSTART
I am having too much problems with noise in the in-built ADC of atmega32
Instead of external voltage I used internal 2.56 Vref and applied the voltage, then I am getting 2.55V for 2.24V. I used a capacitor of 150pf,22pf b/w AREF and ground.
I removed the multimeter probes from the breadboard, then a small difference came. But the noise is too much. My aim is to interface LM35 with atmega32. So I am just checking with a potentiometer.
Is there any way to avoid this noise
wht should be the value of capacitor b/w AREF and ground
My code
.cseg
.org 0x000
rjmp RESET
RESET:
ldi r16,0xff
out $11,r16 ;DDRD as output
out $12,r16 ; for checking if ADC is not good
out $17,r16
out $18,r16
rjmp ADC_INIT
ADC_INIT:
ldi r16,0b11100000 ; setting AD1,AD0 in ADCL
;internal 2.56 reference,Single
;channel A0
out $07,r16 ;setting ADMUX
ldi r16,0b10000101 ;setting control reg. ck/32
out $06,r16 ;setting ADCSRA
rjmp ADCSTART
ADCSTART:
sbi $06,6
WAIT:
sbis $06,4
rjmp WAIT
in r16,$04;ADCL
in r17,$05;ADCH
out $12,r17
out $18,r16
rjmp ADCSTART