hi guys,
I am using the following code in cvavr, my code is not working. My adc read code is working if i don't use interrupt. So there is issue with my interrupt call, i tried to make it manual call :
void main(void)
{
DDRB=0xFF;
DDRC=0xFF;
PORTC=0x00;
PORTB=0x00;
LCD_Init();
delay_ms(100);
adc_init();
#asm("sei")
while (1)
{
delay_ms(1000);
PORTB.2= ~PORTB.2;
}
}
interrupt [ADC_INT] void adc_isr(void)
{
ADCSRA |= (1<<ADSC);
read_adc();
}
I am using the following code in cvavr, my code is not working. My adc read code is working if i don't use interrupt. So there is issue with my interrupt call, i tried to make it manual call :
void main(void)
{
DDRB=0xFF;
DDRC=0xFF;
PORTC=0x00;
PORTB=0x00;
LCD_Init();
delay_ms(100);
adc_init();
#asm("sei")
while (1)
{
delay_ms(1000);
PORTB.2= ~PORTB.2;
}
}
interrupt [ADC_INT] void adc_isr(void)
{
ADCSRA |= (1<<ADSC);
read_adc();
}