problem with ADC of ATmega16

Discussion in 'The Projects Forum' started by eric_s88, Aug 24, 2013.

  1. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    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:
     
  2. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    :( any comment ?
     
  3. Shagas

    Active Member

    May 13, 2013
    802
    74
    Link your code please .

    Also are you sure you sensor is working correctly? How is the sensor connected? Show a schematic
     
    Last edited: Aug 24, 2013
    eric_s88 likes this.
  4. absf

    Senior Member

    Dec 29, 2010
    1,492
    372
    I am helping with the attachment of the datasheet of CNY70.

    Is your AVR part working if you connect a pot to the ADC input ?

    Allen
     
    eric_s88 likes this.
  5. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    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
     
  6. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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...
     
  7. Shagas

    Active Member

    May 13, 2013
    802
    74
    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 .
     
  8. donpetru

    Active Member

    Nov 14, 2008
    186
    25
    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.
     
Loading...