1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

code error

Discussion in 'AVR' started by Adam2014, Aug 18, 2014.

  1. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,142
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    Whats your MCU... I can browse the datasheet to see what's needed..
     
  2. Adam2014

    Adam2014 Member

    Joined:
    Jan 25, 2014
    Messages:
    109
    Likes:
    0
    MCU : atmega16
    i write code using code-vision in c language
     
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,142
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Adam2014

    Adam2014 Member

    Joined:
    Jan 25, 2014
    Messages:
    109
    Likes:
    0

    thanks
    i read it .
    when the MCU store ADC data in 2 register ADCH ADCL
    how i can write int x = ADC data that include the registers value
     
  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,142
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    Most compilers use a word to access the ADC result ADCL and ADCH are addressed next to each other so the variable ADC returns the full result... Just copy the function and that will return the ADC result...
     

Share This Page