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.

[SOLVED] 8051 and ADC0804 interface code related Convert ADC Value to display voltage

Status
Not open for further replies.
I have used SDCC C Compiler with M-IDE Studio http://www.opcube.com/home.html

As a LCD library I have two files downloaded from here: http://www.8051projects.net/download-d5-lcd-library.html

---------- Post added at 17:56 ---------- Previous post was at 17:50 ----------

Hello papunblg, I am doing a simliar project with ADC0804 and LM35, but it's data on LCD is not changing, which it's not giving me any degree back, and i had post a thread, plz can you help me out, and I have copy the code above into Keil, and it give me error on #include<lcd.c>, wondering why?
thank you

The lcd.c file is missing. I have never used Keil compiler. So I don't know if any LCD library present in it or what is it's name.
 

Hi, Mr. Papunblg, wondering do you have a complete diagram of this project, such may include LM35, ADC, and LCD. according to the code that you are providing. thank you for you response.
 

Write now I dont have ready code. But if you want to get, there is a similar diagram with code in Muhammad Ali Mazidi's book on 8051 Microcontroller
 

Hi Barasha,
Thank you for your question.
There are 2 ways to send commands/data to LCD. --(1) Call a time delay before sending next data/command to an LCD (2) To monitor the busy flag before issuing a command / data to the LCD.

The READY subroutine follows the second method.
Note:- D7 bit of (command reg) LCD is busy flag which is connected to P1.7 of the microcontroller in my case(as D0 to D7 connected to port 1). To check that flag you need to make R/S=1 and RS=0 and a low to high pulse for the E pin. After that P1.7 reflects the state of busy flag.

READY:
SETB P1.7 ;To make P1.7 input port
CLR P2.0 ;RS=0 to access command reg
SETB P2.1 ;R/W = 1 to read command Reg​
BACK:
CLR P2.2 ;E=0 to provide low to high pulse
ACALL DELAY ; give some time(pulse time)
SETB P2.2 ; low to high pulse ends
JB P1.7,BACK ; stay till busy flag=0
RET​

Hope this will throw some light.
Today its already very late. I will check your code tomorrow.
Thanks

Rajsekhar

Read the following line :-
To check that flag you need to make R/S=1 and RS=0 and a low to high pulse for the E pin. After that P1.7 reflects the state of busy flag.

as-

To check that flag you need to make R/W=1 and RS=0 and a low to high pulse for the E pin. After that P1.7 reflects the state of busy flag.
 

Dear Mr. Papunblg,

In summary:
1) Could you please share the assembly code and give some advice, example: How to view 5V in LCD while step resolution 255, what formula need to use/what method need to use???

My project testing able to show the response of step resolution from 0 to 255 but don't know How to show the actual voltage

thanks for cooperation and great support :)
Aljabar...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top