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.

ADC value to lcd display doubts

Status
Not open for further replies.

thannara123

Advanced Member level 5
Joined
Jan 7, 2010
Messages
1,580
Helped
122
Reputation
244
Reaction score
114
Trophy points
1,353
Location
India
Activity points
10,381
Hello experts , i want to know what value we get from an 8 bit ADC (0804) ?
Binary ,or hex ?
how it pass to LCD ?
i googled but the programs are available but not logic .
please help me ,.
any understandable c code
 

It is binary.
Datasheet says " The digital outputs vary from 0 to a maximum of 255".

To display it in a LCD -- you have to read the binary value (probably using a microcontroller) and drive the LCD accordingly.
 
thats means we need to converts that binary to decimal for the LCD display ?
 

It all depends on how you are programming the LCD.
 

Yes.
You have to remember the reference voltage value.
datasheet says
"The step size can be adjusted by setting the reference voltage at pin9. When this pin is not connected, the default reference voltage is the operating voltage, i.e., Vcc. The step size at 5V is 19.53mV (5V/255), i.e., for every 19.53mV rise in the analog input, the output varies by 1 unit. To set a particular voltage level as the reference value, this pin is connected to half the voltage. For example, to set a reference of 4V (Vref), pin9 is connected to 2V (Vref/2), thereby reducing the step size to 15.62mV (4V/255). "
Let say
Your Vref = 5V
You get ADC result = 10001100 i.e decimal 140
your value to be display = 19.53mV x 140 = 2.73 V
 
i am not connected vref . thats 5 v, taken as step size 19.53.

i want a simple program to display .
including the conversion ?
 


sir ,it need to convert in to corresponding voltage
 

If ADC value is 255 and max voltage is 5V for 255. So 255 * 5.0 / 255 = 5.0 which is the volts.

If adc value is 100 then 100 * 5 / 255 = 1.9 approx.

If you change the scale to say 300 V then

255 * 300 / 255 = 300

ADC value * scale / 255 for 8 bit adc.
 
acan i get a sample binary to decimal conversion pgm in c ?/
 

The value of adc result will be in binary form in the hardware but it doesn't matter whether the value is represented by binary or hex or decimal. To convert it to character you just add 0x30 or 48d (decimal) to it.

0 + 0x30 = '0' which can be print on LCD.
 
i have added the 0x30 with value and displayed ,but some asci higher value shows
 

Attachments

  • ADC0804+LCD 4bit + 8051.zip
    54.9 KB · Views: 59


Code C - [expand]
1
2
3
4
5
6
lcdcom(0x80);
lcddata(adcval / 100 + 48);
lcdcom(0x81);
lcddata((adcval / 10) % 10 + 48);
lcdcom(0x82);
lcddata(adcval % 100 + 48);

 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top