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.

How can I display the info from a DS18B20 onto an LCD...

Status
Not open for further replies.

hawk1943

Member level 3
Joined
Jun 14, 2010
Messages
62
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
United Kingdom
Activity points
1,859
Hi there,

I'm struggling to get an LCD to correctly display the information being recieved from a DS18B20 temperature sensor...

I do have the code working for a 16F636 outputting serially to hyperterminal... but due to code space issues I have had to port it over to a 16F877... but whilst I get the uart up and running correctly I'd like to display the information on a LCD...

The LCD is already displaying correctly, so I have that side of things working...

But what I need to sort out is a way of using the printf command but instead of it sending the data to hyperterminal it displays it on the LCD...

this is the line I need to get working correctly on the LCD...

Code:
--------------------------------------------------------------------------------

printf("\n\r ScratchPAD DATA = %X %X %X %X %X %X %X %X %X \n\r",get[8],get[7],get[6],get[5],get[4],get[3],get[2],get[1],get[0]);

--------------------------------------------------------------------------------


Any idea's on how I would go about doing it?
 

But what I need to sort out is a way of using the printf command but instead of it sending the data to hyperterminal it displays it on the LCD...

your printf() is expecting a function, putc() (both in stdio.h). so rather than using the stock putc(), you can redefine putc() to use your lcd routine that writes a char.

something like
Code:
void putc(unsigned char c) {
  lcd_putch(c); //where lcd_putch() is the lcd routine that outputs a char on the lcd
}

if you want to output both to the lcd and uart, you just need to add a serial putch() function in there.

after that, recompile and you are reading to go.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top