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 interface with atmega32 with two sensors

ADC interface with atmega32 with two sensors

|

Microcontroller › AVR › ADC interface with atmega32 with two sensors

  • This topic has 2 replies, 3 voices, and was last updated 8 years, 2 months ago by Ashutosh Bhatt.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 15, 2017 at 11:49 am #4623
    s.manisrinivas
    Participant

    HI friends ,

      I need help from you that, I am using ATmega32 avr development board for ADC multiple channels  and i am using two POT sensors.What is my doubt is  I want a small delay after two channel conversions,say delay is 2 sec (for example).After every delay conversions have to display.

    I tried but i cannot make delay,for i used timer buts its vain.so, please help me guys

     

    here is my code.

    #include<avr/io.h>
    #define LED PD4 
     
    int main()
    {
    uint8_t timerOverflowCount=0;
    DDRD=0xff;         //configure PORTD as output
    TCNT0=0x00;
    TCCR0 = (1<<CS00) | (1<<CS02);
     
    while(1)
    {
    while ((TIFR & 0x01) == 0); 
     TCNT0 = 0x00;
     TIFR=0x01; //clear timer1 overflow flag              
    timerOverflowCount++;
    if (timerOverflowCount>=6)
    {
    PORTD ^= (0x01 << LED);
    timerOverflowCount=0;
    }
    }
    }
     
     
     
     
    January 26, 2018 at 2:43 pm #14700
    GANEEV SINGH
    Participant

    Hi there

    Could you please share what output are you expecting from the above code.

    According to me the LED should remain ON continuously without blinking with any specific delay.

    January 31, 2018 at 5:56 pm #14708
    Ashutosh Bhatt
    Participant

    if you are using AVR studio then in AVR studio you get built in delay function

    _delay_ms() or _delay_us()

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

RSS Recent Posts

  • compile errors April 22, 2026
  • Quick Tip: Handling CH340 Driver Issues on Uno SMD Clones April 22, 2026
  • My Advanced Realistic Humanoid Robots Project April 22, 2026
  • Getting into an LED bulb April 21, 2026
  • understanding of resonance in time domain April 21, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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