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.

Lcd display with pic16f877a

Status
Not open for further replies.

pisces12

Junior Member level 2
Joined
Dec 2, 2009
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
malaysia
Activity points
1,436
hi...

how to write the code to display the value taken from adc and display it on the 16x2 lcd?i'm using the pic16f877a and picc pcw compiler...can anyone provide me the code please...tq
 

from 8-bit ADC u would get values in the range 000 --> 255
convert it to ASCII
eg
2 => 0000 0010
5 => 0000 0101
5 => 0000 0101
now Send the each Digit separately to the LCD
 

Hi,
Take three values like d1, d2, d3.
Code:
unsigned char d1, d2, d3;
If for eg, ADC reading = 127
Code:
d1 = ADC_Reading / 100
d2 = (ADC_Reading / 10) % 10
d3 = ADC_Reading % 10
Thus, d1 = 1, d2 = 2, d3 = 7
Then convert these to ascii:
Code:
d1 = d1 + 0x30
d2 = d2 + 0x30
d3 = d3 + 0x30
Now print the digits on LCD.
Hope this helped.
Tahmid.
 

hi...

sorry, but i'm not going to display the adc reading..i need to used it in my calculation only..how must i write the code. for example there are two input to the adc that is X and Y. then i have also 8-bit binary input at portb. what i have to do is Z = XY cos (8-bit binary)...can u help?
 

Hi Tahmid
I have same problem hope you will help me over this
I have found some ADC sample source from a website but I can't understand the logic behind the reading value from ADC.
I want to display temperature (LM35) on LCD (16*2) with PIC16f877a
actually it shows the temp but not properly as the real temp is
thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top