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.

convert adc value in to multiples

Status
Not open for further replies.

asthra123

Member level 1
Joined
Jul 2, 2013
Messages
32
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,582
dear sir,
how can we convert an input voltage 0-5 volts to 0-500 (measuring parameter) and show in to windows foam (visual c#).
i am using pic16f877 programmed in assembly ...
i can receive the actual input voltage (0-5) from uart (RS232) in windows foam in visual c#.how to show the multiples of 10 or 100 ?
please help me.
seby
 

volt = volt * 5 / 1023; //for 10 bit adc

//The above gives 5V for 5V


//If 5V has to be represented as 500 then you have to multiply by 100


volt = volt * 500 / 1023;

//if volt is 1023 (1023 raw adc value = 5V) then
//1023 * 500 / 1023 = 500
 
data = ADC_value*500/1023; don forget multiply divide sequence

(this is for 10 bit adc.. put( ( 2^number_of_bits ) - 1 ) in 1023s place for various bit lengths....
 

Microcontroller datasheets (e.g. from Microchip) keeps pretending that an ADC LSB is Vref/1024 rather than Vref/1023.
 

In assembly you not sent a raw bit, it may cause receive problem because it send control char too for certain ADC value.

you need to divide into 3 char such as 0011 1111 1111 send as adc::123;

in c# read char 1,2,3 separately by ref of adc:: and ;

and finally can convert actual value by simple math functions.
 

thanks
i can solve this problem
seby
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top