[En-Nut-Discussion] Analog Input

Daniel ziu82 at gmx.de
Thu Sep 10 11:08:25 CEST 2009


Andre Riesberg schrieb:
> Daniel wrote:
>
>   
>> Andre Riesberg schrieb:
>>  
>>
>>     
>>> 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
>>> _______________________________________________
>>> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>>>
>>>  
>>>    
>>>
>>>       
>> It's an Ethernut 1.3 H.
>>
>> Daniel
>> _______________________________________________
>> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>>
>>
>>  
>>
>>     
> Hi Daniel,
>
> another qestion:
> What are the settings in the "Nut/OS Configurator" in parameters 
> "Architecture->AVR->ADC Driver" ?
>
> Greetings
> André
>
>
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>   
Hi André,

Each of the values under "ADC Driver" and "ADC Driver" itself are enabled.

Daniel



More information about the En-Nut-Discussion mailing list