Page 1 of 1

Using ADC channels

Posted: Fri Sep 11, 2009 1:42 am
by kdalyan
Hi,
How can use the ADC channels on GPIO socket. i want to use 3 adc input but the board has only one pot. i can connect 2 extra but in software how can use them. is ADC drive in linux adaptable for changing the channels?
is there a simple example please?


Thankyou for your help

Re: Using ADC channels

Posted: Fri Sep 11, 2009 4:45 pm
by nicolas
Im not sure if linux has a driver for it.


But directly via i/o...
To read the other channels you need to change the channel on the mux then tell the adc to perform a conversion then read the value (unless you have the READ_START bit set, in which case a read will cause an auto adc calculation)

To change the channel, set the proper bits of the ADCCON register.

See sample code without OS\2440test\src\adc.c for example

Re: Using ADC channels

Posted: Mon May 17, 2010 11:08 am
by Sak1s
hello.I there any tip about adding an adc input ?