I have a alternative signal which has positive voltage and negetive voltage. So I have to put them into differential channel which can convert the alternative signal. But arduino does not support the function. arduino supports single ended conversion language that is analogRead. There is another way to solve the problem. I can add a direct constant voltage on the alternative signal, which can avoid the negetive voltage. But I want to read the conversion of differential channel result.
the following is about AD conversion of differential channel and single ended which is from datasheet of ATMEGA2560
After the conversion is complete (ADIF is high), the conversion result can be found in the ADC Result Registers (ADCL, ADCH).
For single ended conversion, the result is
ADC=VIN*1024/ VREF
where VIN is the voltage on the selected input pin and VREF the selected voltage reference . 0x000 represents analog ground, and 0x3FF represents the selected reference voltage minus one LSB.
If differential channels are used, the result is
ADC=(VPOS- VNEG )* 512 /VREF