Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to convert input dc voltage to hexa decimal

Status
Not open for further replies.

suvaraj

Member level 2
Joined
Dec 24, 2010
Messages
50
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
erode
Activity points
1,580
hi to all
i'm using pic pic16f877a with ccs c compiler.inn my project i have a two pin level sensor and it has 4 different o/p's for eg level1 reached means it's o/p 1.1v,level2 reached means it's o/p 2.1v,level3reached means it's o/p 3v,level4 reached means it's o/p 4.2v .how to i convert this voltage to hexadecimal value.?and i need level 1 hexadecimal value reached means i display one led,etc...., i'm use pin RA0 for adc input .pls help me

thanks to all
 

If you are using the supply voltage as your A/D reference.
Then its a 10-bit converter, so the resolution is:

5/1024

So 1.1 volt is 1.1 / (5/1024) = 225.28 = Rounded 0xe1.
So 2.1 volt is 2.1 / (5/1024) = 430.08 = Rounded 0x1ae.
etc.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top