[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] The ADC interrurpt can't triger in studio?
From: |
Ian Caddy |
Subject: |
Re: [avr-gcc-list] The ADC interrurpt can't triger in studio? |
Date: |
Thu, 25 Mar 2004 09:20:18 +0800 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040316 |
hi Whiteman,
To start the ADC conversion you must either set:
ADSC - start conversion
or
ADFR - free run operation
before you will get an interrupt.
regards,
Ian Caddy
whiteman wrote:
> HI,all!
>
> I used studio4.08 simulate the program as follows:
>
> SIGNAL(SIG_ADC) //ADC server
> {
> ADC_L = ADCL;
> ADC_H = ADCH;
> }
>
> int main(void)
> {
> DDRC = (1<<DDC5)|(1<<DDC6);
> DDRD = 0xc0;
> DDRB = 1 << DDB0;
> ADMUX = 0x40; //ADC channel 0
> ADCSRA = 0x85; //ADC clock is
> 125k
> ADCSRA = (1 << ADIF) |(1 << ADIE) | ADCSRA;
> sei();
> //enable the global interrupt
> Delay(10000);
> ;
> ;
> while(1)
> {
> PORTC = PORTC^0x20;
> Delay(60000);
> ADCSRA = (1 << ADSC) |ADCSRA; //START ADC
> ;
> ;
> for(;;){}
> }
> return(0);
> }
>
> I simulate this program. I have started the ADC converter and man-made
> modified the interrupt flag "ADIF" to 1,but the studio can't triger the ADC
> interrup, don't execute the server. Whether it is a buy in studion or in gcc??
> thanks!!!
>
> best regard
>
> whiteman
> address@hidden
> 2004-03-24
>
>
>
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list
>
_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list