How to connect LCD?

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
aquaaddict
Posts: 6
Joined: Wed Oct 07, 2009 10:43 am

How to connect LCD?

Post by aquaaddict » Tue Oct 13, 2009 11:44 pm

Ok basic question I know, but just coming over from PicBasic Pro, which uses all 8 data lines on a HD44780, and it seems SF only uses 3 connections, so I presume its some sort of serial interface?

Is there any specific serial interface driver IC / circuit that you are using to connect to a generic HD44780 LCD?

Thanks

Anthony

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Wed Oct 14, 2009 5:30 am

You can use either 4 or 8 bit interface to an HD44780.

See help file, in Library Reference in LCD section.

You'll find there all help and circuit diagram for connections.


from the same help file (and example provided with SF)

I suppose these lines have put you in trouble.

Code: Select all

// LCD...

#option LCD_DATA = PORTD.4

#option LCD_RS = PORTE.0

#option LCD_EN = PORTE.1

... 

Explanation is given in the same help file :
#option LCD_DATA

The LCD_DATA option sets the port or port pin for the LCD data bus. If a port name is given, without a pin qualifier, then the library defaults to a 8 bit data bus. Specifying a port pin will force the LCD library into 4 bit data mode. Valid pin qualifiers include 0 and 4. If the LCD_DATA option is not used, it defaults to PORTB.4

--------------------------------------------------------------------------------
#option LCD_RS
The LCD_RS option sets the LCD RS pin. If the LCD_RS option is not used, it defaults to PORTB.3

--------------------------------------------------------------------------------
#option LCD_EN
The LCD_EN option sets the LCD EN pin. If the LCD_EN option is not used, it defaults to PORTB.2
Regards
octal

aquaaddict
Posts: 6
Joined: Wed Oct 07, 2009 10:43 am

thanks

Post by aquaaddict » Wed Oct 14, 2009 4:42 pm

Great, got it working now. I had serached the downloadable manual and all of these forums, but for some reqason didn't think to look in the help file.

Thanks!

Anthony

Post Reply