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
Visit site
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.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…