Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Adc channel selection of atmega16

Status
Not open for further replies.

ravruch

Newbie level 5
Joined
Dec 31, 2011
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Pune India
Activity points
1,354
hi;
I am using ATMEGA16 and interfacing three analog sensors with it.
Initially I just interfaced only one sensor ,and did required programming in 'c' in codevision avr compiler.
for one sensor i am getting the required output on LCD but when i did the same programming with two sensors interfaced ,I did select the corresponding channels and did correct programming.then also output on lcd coming wrong that is the output which is supposed to come for 1st is showing for second ,,,,,,,,is this a programming defect or something is wrong with internal adc of atmga16??
 

ravruch said:
for one sensor i am getting the required output on LCD but when i did the same programming with two sensors interfaced ,I did select the corresponding channels and did correct programming.then also output on lcd coming wrong that is the output which is supposed to come for 1st is showing for second
If your ADC program is correct, then the only reasonable explanation would be incorrect LCD programming. Make sure that you print both values, and that those values are not printed in the same LCD position. Because if they do, then the result on screen would be what you described, that is one visible value, the last one that was printed. So I would double check that printing is done at the correct position.
If you are using a debugger, you could place a breakpoint when LCD's enable pin is toggled and the character is printed on the LCD screen. In this way you will be able to see characters one by one when they printed on screen.


ravruch said:
is this a programming defect or something is wrong with internal adc of atmga16??
Let's just forget about this scenario, it is out of the question! :smile:
The only case something could go wrong with the ADC result is when you violate maximum convertion speed per resolution, or temperature range, or absolute specifications in general. If you follow manufacturer's specs and you have proper ADC circuitry (AVCC, AREF pins) as described in the datasheet, everything should work as expected.


Alexandros
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top