avr-gcc-list
[Top][All Lists]
Advanced

[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: whiteman
Subject: Re: [avr-gcc-list] The ADC interrurpt can't triger in studio?
Date: Thu, 25 Mar 2004 10:2:18 +0800

Hi,Ian Caddy!

        I have  start ADC conversion.
        The sentence "ADCSRA = (1 << ADSC) |ADCSRA;     //START ADC" in the 
"while(1)" statement.
        but the studio(4.08) always be triger.


======= 2004-03-25 09:20:00 =======

>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
>> 

= = = = = = = = = = = = = = = = = = = =
                        
Best regard 
                                 
        whiteman
address@hidden
          2004-03-25





_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list


reply via email to

[Prev in Thread] Current Thread [Next in Thread]