Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

ADC interface with atmega32 with two sensors

3 posts / 0 new
Last post
s.manisrinivas's picture
Last seen: 1 month 6 days ago
Joined: 16/09/2015 - 12:05
ADC interface with atmega32 with two sensors

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, please help me guys


here is my code.

#define LED PD4 
int main()
uint8_t timerOverflowCount=0;
DDRD=0xff;         //configure PORTD as output
TCCR0 = (1<<CS00) | (1<<CS02);
while ((TIFR & 0x01) == 0); 
 TCNT0 = 0x00;
 TIFR=0x01; //clear timer1 overflow flag              
if (timerOverflowCount>=6)
PORTD ^= (0x01 << LED);
GANEEV SINGH's picture
Last seen: 6 hours 54 min ago
Joined: 22/07/2013 - 16:08
Hi thereCould you please

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.

Ashutosh Bhatt
Ashutosh Bhatt's picture
Last seen: 1 day 3 hours ago
Joined: 21/12/2010 - 15:59
if you are using AVR studio

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

_delay_ms() or _delay_us()