problem with ADC of ATmega16

Thread Starter

eric_s88

Joined Apr 20, 2011
157
Hi everyone..

I have the experience of working with adc of Atmega series uC. but now I have a stranger problem.

I'm going to read the output voltage of CNY70 (optical sensor).

I've set the reference voltage of adc to AVCC pin.

but regardless of what is the voltage, I have 1023 value in result of converting.. whats the matter ?? :( :confused:
 

Shagas

Joined May 13, 2013
804
Link your code please .

Also are you sure you sensor is working correctly? How is the sensor connected? Show a schematic
 
Last edited:

Thread Starter

eric_s88

Joined Apr 20, 2011
157
Hi thanks for your replies.

I tested the uC on a breadboard ( same schematic of the main board ) and it was ok and adc part was working well.
but on the main board even when I disconnect the input of adc , it still shows 1023 as output value..

I'm not able to post a schematic of cny70 right now. and I dont think it's a problem of sensors :(

really strange problem
 

tshuck

Joined Oct 18, 2012
3,534
With neither code, nor schematic, your chances of real help is severely limited.

Is your AVCC connected to your reference voltage? And, is your reference voltage greater than the voltage you are attempting to measure?

By the way, this is an international forum, be a little more patient than an hour or two for a response...
 

Shagas

Joined May 13, 2013
804
Yes , your code and adc was probably working and then when you connected the sensor you either changed something in the hardware by mistake or disconnected something . Or you changed something in your code by mistake and forgot about it . Happens to me all the time .
 

donpetru

Joined Nov 14, 2008
185
The circuit was very useful because is worth a thousand words. Try posting that circuit.

On the other hand, I understand that certain circuits can not be made ​​public, but without them it is almost impossible to formulate an answer. We are in an educational forum, free, and that therefore any project or problem should be treated in all aspects. Who does not want to do that then I think it's better to seek answers elsewhere, such as elance.com.
 
Top