EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / ADC in atmega16 or 32

ADC in atmega16 or 32

|

Microcontroller › AVR › ADC in atmega16 or 32

  • This topic has 1 reply, 2 voices, and was last updated 13 years ago by Adwaitanand.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 4, 2012 at 3:38 pm #1765
    Uttam Dutta
    Participant

    Please help me to understand,

     

    First 3 bits og ADCMUX   are for ADC channel selection and if it is 000 means channel 0

             001 means channel 1

             010 means channel 2

     

    ……

    …..

    and  111 means channel 7

    These thinngs are mentioned in ADC tutorial in

    “

    How to use inbuilt ADC of AVR microcontroller (ATmega16)“- Description

    Also matching with Atmega32 datasheet.

    So if I want select channle for ADC then

      ch= ch & 0b00000111; // channel must be b/w 0 to 7

      ADMUX |= ch;

    is OK because  0000 0000 AND 0000 0111

     will give 0000 0000

    ADMUX  bit pattern will be 0000 0000 – means only channel 0 is selected

     but if we want to use more than 1 channel ,

    suppose want to use  ADC channel  0,1,2,3 then

    how this can be done, one thing written in many other program

     that ch=ch&0b00000111;
       ADMUX&=0b11100000;
       ADMUX|=ch;

    but how it works for all 0 to 7  channel

    can anybody please explain it or any other way to use more than 1 channel

    of ADC port.

     

     

     

     

     

    June 26, 2012 at 2:04 am #8129
    Adwaitanand
    Participant

    I think you should use each channel separately and store it in an Array.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Can I make two inputs from one?? July 9, 2025
  • The Analog Gods Hate Me July 9, 2025
  • How to make string LEDs? July 9, 2025
  • Fixing board, Easy question HEX SCHMITT July 9, 2025
  • It's Amazing What A Buck And A Quarter.... July 8, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise