[En-Nut-Discussion] Analog Input

Andre Riesberg andre at riesberg-net.de
Wed Sep 9 19:26:21 CEST 2009


Daniel wrote:

>Hi all,
>
>Sadly I have to bother you again with ADC issues. I am not able to get a 
>signal on the ADC inputs. I've uploaded an image of the simple circuit 
>I'm using: (http://www.darthziu.de/Bilder/Circuit.jpg).
>
>I bridged Pin 1&2 on the ADC connector as Harald wrote on 2009/09/02.
>
>Code is as follows (as the example at NutWiki):
>
>int main(void)
>{
>    // UART registrieren
>    u_long baud = 115200;
>    NutRegisterDevice(&DEV_UART, 0, 0);
>    freopen(DEV_DEBUG_NAME, "w", stdout);
>    _ioctl(_fileno(stdout), UART_SETSPEED, &baud);
>
>    puts("\nADC example");
> 
>    ADCInit();
>    uint16_t adc_value = 0;
>   
>    for (;;) {
>       
>    ADCStartConversion();   
> 
>        while (ADCRead(&adc_value))
>        {
>            NutThreadYield();
>        }
> 
>       printf("Value: %u\n", adc_value);
>               NutSleep(1000);
>    }
>   
>    return 0;
>}
>
>Get always the same values on the ADC (eg. ADC0==255, ADC7==1023), even 
>if I play with the poti. With an external voltage meter I get different 
>voltages as expected.
>
>Where is my error? I'm getting insane here. Just tried with 2 Ethernuts, 
>every ADC Pin and nearly every ADC software configuration.
>
>Thanks in advance
>Daniel
>_______________________________________________
>http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
>  
>
Hallo Daniel,

I  missed the previous discussions. What kind of board do you use? CPU type?

Greetings
Andre



More information about the En-Nut-Discussion mailing list