jdh_1984
Member level 2
Hi
I am doing a project where a Atmel Atmega 16L(3.3V) is used as a AD converter. To start the ADC converting cycle I am using a external interrupt (INT0), and the resulting readings (10 bit) are outputted (see attachment for the code). I am using the internal 2,56V as references for the ADC reading. The problem is that the results at the output is to high compare to the voltage at the ADC input.
Here are some examples: (using the formula at page 216 in the atmega datasheet Vin=(ADC*Vref)/1024 )
The input ref signal:1.852V the digital output:776bit, which corresponds to 1.940V
The input ref signal:1.551V the digital output:647bit, which corresponds to 1.617V
The input ref signal:1.251V the digital output:514bit, which corresponds to 1.285V
What could be the reason for this inaccurate readings? I am not using any kind of filter, could this be the reason? I see the recommend an external capacitor for the AREF pin in the datasheet to improve noise immunity.
I did a new test with a voltage (3.2V) at the AREF pin as references.
I got the following results:
The input ref signal:1.826V the digital output:481bit, which corresponds to 1.503V
The input ref signal:1.551V the digital output:385bit, which corresponds to 1.203V
The input ref signal:1.241V the digital output:257bit, which corresponds to 0.803V
So something is obviously wrong, but where do I mess up???
I am doing a project where a Atmel Atmega 16L(3.3V) is used as a AD converter. To start the ADC converting cycle I am using a external interrupt (INT0), and the resulting readings (10 bit) are outputted (see attachment for the code). I am using the internal 2,56V as references for the ADC reading. The problem is that the results at the output is to high compare to the voltage at the ADC input.
Here are some examples: (using the formula at page 216 in the atmega datasheet Vin=(ADC*Vref)/1024 )
The input ref signal:1.852V the digital output:776bit, which corresponds to 1.940V
The input ref signal:1.551V the digital output:647bit, which corresponds to 1.617V
The input ref signal:1.251V the digital output:514bit, which corresponds to 1.285V
What could be the reason for this inaccurate readings? I am not using any kind of filter, could this be the reason? I see the recommend an external capacitor for the AREF pin in the datasheet to improve noise immunity.
I did a new test with a voltage (3.2V) at the AREF pin as references.
I got the following results:
The input ref signal:1.826V the digital output:481bit, which corresponds to 1.503V
The input ref signal:1.551V the digital output:385bit, which corresponds to 1.203V
The input ref signal:1.241V the digital output:257bit, which corresponds to 0.803V
So something is obviously wrong, but where do I mess up???
Attachments
Last edited: