Inverting a2d input

Status
Not open for further replies.

pixman

Member
Hi
Is it possible to invert the input of an A2D.
What i want to do is read the the A2D then swop it around.
so if the voltage is 0 i want to change the ADRESH and ADRESL
to 1s and if voltage is 5 the ADRESH and ADRESL to 0s.

thanks
 
You can do anything you want with the data once you've got it, but EXACTLY what are you trying to do?, just invert the data? - in which case you need XOR.
 
thanks for the help.
i will try it later.
i want to use the data in a delay timer.
but i just need to invert the data.
so if the voltage is high the timer would be fast.
if voltage low timer will be slow.
 
thanks for the help.
i will try it later.
i want to use the data in a delay timer.
but i just need to invert the data.
so if the voltage is high the timer would be fast.
if voltage low timer will be slow.

I suspect you would be better just subracting the value from 1023?.
 
Or just start the timer at the ADC result value and have it run to 1023 instead of starting it at 0 and running to the ADC result value.

6 of 1, half dozen of the other...
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…