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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] anyone work with ADC on 355E?


From: ken omura
Subject: [avr-gcc-list] anyone work with ADC on 355E?
Date: Sun, 20 Nov 2005 22:47:44 -0800 (PST)

hello, i have been trying to get the ADC to read..
i am using some ADC code from a 355 demo... and
i find that it is looping in the while loop below:

void MT_ADStartConv(void)
{
    while (a_dcomp == NOTHING);    // Wait for 1st
conversion to clear
    a_dcomp = CONVERT ;           // Tell the next
routine that conversion is ongoing  
    ADCSR |= BIT(ADSC) ;          // start A/D
conversion
}

the interrupt that changes the value of a_dcomp isn't
being called.
is that because the start A/D conversion bit isn't set
until line #3??
anyone know what this "1st conversion to clear" refers
to?

also, does anyone know what the value of AG_A2D_ADCSR
is in the following?

void AG_Setup_ADC(void)
{
    ADCSR = BIT(ADSC) | AG_A2D_ADCSR;
    ADMUX = CLEAR ;                    // connects to
first pin by clearing A/D's MUX
    a_dcomp = NOTHING ;                // clears out
interrupt first
}

thanks,
ken


        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com




reply via email to

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