Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
arthur92710
PostPosted: Aug 29, 2009 - 03:43 AM
Hangaround


Joined: May 19, 2008
Posts: 197
Location: NY

I have the code:
(LCD library for HD44870 from http://www.jump.to/fleury)
Code:

#include <util/delay.h>      /* Functions to waste time */
#include "lcd.h"      /* Lib for LCD */

int main(void)
   {
   lcd_init(LCD_DISP_ON); /* initialize display, cursor off */
      while (1) /* loop forever */
      {
         lcd_clrscr(); /* clear the screen*/
         lcd_puts("test program"); /* displays the string on lcd*/
         _delay_ms(50);
      }
   }


and it is giving me the errors:
undefined reference to `lcd_init'
undefined reference to `lcd_clrscr'
undefined reference to `lcd_puts'
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Aug 29, 2009 - 03:45 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 22833
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Have you added the lcd.c file to your project?

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
arthur92710
PostPosted: Aug 29, 2009 - 03:58 AM
Hangaround


Joined: May 19, 2008
Posts: 197
Location: NY

Aha!
Thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
arthur92710
PostPosted: Aug 30, 2009 - 12:24 AM
Hangaround


Joined: May 19, 2008
Posts: 197
Location: NY

I cant get any thing to show up on the lcd

Code:

#include <avr/io.h>
#define F_CPU 8000000UL      /* Sets up the chip speed for delay.h */
#include <util/delay.h>      /* Functions to waste time */
#include "lcd.h"      /* Lib for LCD */

int main(void)
   {
      lcd_init(LCD_DISP_ON); /* initialize display, cursor off */
      while (1) /* loop forever */
      {
         lcd_clrscr(); /* clear the screen*/
         lcd_puts("test program"); /* displays the string on lcd*/
         _delay_ms(50);
      }
   }


I adjusted the contrast, checked the connections(4bit) and it does not show. I can tell it is connected right because when I change the contrast 2 lines are on.
 
 View user's profile Send private message  
Reply with quote Back to top
arthur92710
PostPosted: Aug 30, 2009 - 03:15 AM
Hangaround


Joined: May 19, 2008
Posts: 197
Location: NY

I have verified that the lcd works. If I switch RS and RW I sometimes get the 32's and a box's running across the screen.
I have not seen the programed message yet.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Aug 30, 2009 - 05:34 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 22833
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Not familiar with that driver, do you need to tell it which line to print to? May have to wait for someone that has used that code.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
arthur92710
PostPosted: Aug 30, 2009 - 05:46 AM
Hangaround


Joined: May 19, 2008
Posts: 197
Location: NY

What do you use for lcd's? Maybe you have something I can figure out. I also tried from scratch.
I have been playing with this lcd sim @ http://www.geocities.com/dinceraydin/dj ... cdsim.html
But that also does not go far. XD
I am mostly confused with the commands.
http://www.8051projects.net/lcd-interfa ... mmands.php
Lets say I wanted to use 4
[code]
Function Set: 4-bit, 2 Line, 5x7 Dots 0x28 40
[code]
Where do I send the 0x28? I doubt its as simple as PORTD = 0x28; (unless I wire it up correctly) And then what is the LSB and MSB on the lcd DB4 or DB7?
And do I just individually work the 3 control pins?
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Aug 30, 2009 - 06:01 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 22833
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

There are lots of LCD code in the project or tutorial forums. I use asm drivers which I wrote years ago and no longer remember what I did. Laughing

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Aug 30, 2009 - 11:46 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 71883
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

What do you use for lcd's? Maybe you have something I can figure out.

Have you tried the one that comes with GCC:

http://www.nongnu.org/avr-libc/user-man ... odemo.html

(but then again, who ever reads user manuals eh? Wink)

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
arthur92710
PostPosted: Aug 31, 2009 - 12:15 AM
Hangaround


Joined: May 19, 2008
Posts: 197
Location: NY

Sorry, but I find that one even more confusing.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits