Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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
 

Nigel Goodwin

Super Moderator
Most Helpful Member
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.
 

pixman

Member
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.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
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?.
 

Noggin

Member
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...
 

Noggin

Member
Status
Not open for further replies.

Latest threads

Top