hi,
i have design my circuit but i want u to tell me why i am not getting voltages from lm35
also, i want your help for my circuit if it have any problem that i can fix ..
and this is my circuit:
**broken link removed**
and this is my code for the microcontroller "atmega8" ..
#include<avr\io.h>
#include<avr\interrupt.h>
ISR(SIG_ADC)
{
if(ADCH<12)
{
PORTB&=~((1<<PB1)|(1<<PB2));
PORTB|=(1<<PB0);
}
else if(ADCH>12 && ADCH<17)
{
PORTB&=~((1<<PB0)|(1<<PB2));
PORTB|=(1<<PB1);
}
else if(ADCH>17)
{
PORTB&=~((1<<PB0)|(1<<PB1));
PORTB|=(1<<PB2);
}
ADCSRA|=(1<<ADSC); //start conversion
}
int main()
{
DDRB=(1<<DDB0)|(1<<DDB1)|(1<<DDB2);
ADMUX=(1<<REFS0)|(1<<ADLAR); //Make AVcc the reference and select ADC0 channel.
ADCSRA=(1<<ADEN)|(1<<ADFR)|(1<<ADIE)|(1<<ADPS2); //Enable Analog convertor,
//set prescaler to 16
ADCSRA|=(1<<ADSC); //start conversion
sei(); //start interrupt
while(1);
return 1;
}
if you have any question please tell me