Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Need some help on LCD

Discussion about LCD's and other related hardware

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo, Fast351, hydrolisk1792

Post Reply
Mrsuperman
Posts: 5
Joined: July 17th, 2006, 4:29 am

Need some help on LCD

Post by Mrsuperman »

Hi brothers,
I am doing a project in sch and i am required to add in a LCD for the project. Like to check with u all what the things to look out for when selecting the LCD. I am intending to use a chip PIC16F877 and intend to buy a 20 by 4 LCD.

Thankz

_X7JAY7X_
Hardware Genie - Plugin Author
Posts: 374
Joined: February 16th, 2005, 10:24 pm
Location: Michigan

Post by _X7JAY7X_ »

Well here are some things:

1. Make sure its HD44780 Compatible
2. Make sure it has an LED backlight (not el - it requires more parts) if your project requires one
3. Make sure it has a POSITIVE voltage on the contrast pin. Usually the cold weather LCDs have negative, but then you need more parts (i.e. negative voltage generator)

J

Mrsuperman
Posts: 5
Joined: July 17th, 2006, 4:29 am

Post by Mrsuperman »

_X7JAY7X_ wrote:Well here are some things:

1. Make sure its HD44780 Compatible
2. Make sure it has an LED backlight (not el - it requires more parts) if your project requires one
3. Make sure it has a POSITIVE voltage on the contrast pin. Usually the cold weather LCDs have negative, but then you need more parts (i.e. negative voltage generator)

J
Like to check with u what is this "HD44780 Compatible" ? and what are the other components i need to purchase to wire the parts together.

_X7JAY7X_
Hardware Genie - Plugin Author
Posts: 374
Joined: February 16th, 2005, 10:24 pm
Location: Michigan

Post by _X7JAY7X_ »

It is the controller chip on the back of the LCD. More specifically it is the command set that the LCD uses.

For a rundown of the LCD and its commands go here

http://www.myke.com/lcd.htm

Besides the LCD and the PIC you really dont need anything else. A 10k pot should be used on the contrast pin of the LCD. Just curious, what are your intentions for the LCD?

J

Mrsuperman
Posts: 5
Joined: July 17th, 2006, 4:29 am

Post by Mrsuperman »

Well... my project is an automated medicine dispenser and the LCD is used as an interface to allow the user to see the type of medicine. Then for my programming portion i will be using the old sch assembly language to do..

Mrsuperman
Posts: 5
Joined: July 17th, 2006, 4:29 am

Post by Mrsuperman »

Hi, like to check with u guys whether any one knows how to use assembly language to program the LCD module ? and how do i set the cursor to the 3rd and 4th line of the 4X20 LCD module using assembly language

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

Have you used PIC assembler before? If not, there's a lot to take in so get hold of a PIC programming book and start with the basics, or read the various PIC datasheets and documents from Microchip, and look at PIC projects and resources on the net.

If you're up to speed with PIC assembler but aren't sure about the LCD routines, you can look in the same places as above - there is a lot of info on the web about LCDs and PICs, for example this page. There is also a Microchip application note with info on programming LCDs.

There is a standard set of commands that most alpha-numeric LCDs use (the HD44780 compatible LCDs), so download a datasheet for your LCD and study the command set. There's a copy on Myke's PIC LCD page.

You should be able to find code snippets on the web (there are some at the link above) that you can adapt to suit your project. Most of my LCD code is in C so I don't have any assembler LCD code to show you unfortunately.

A 4x20 LCD functions internally like a 2x40 module that has been folded in the middle - line 3 follows line 1 and line 4 follows line 2 (confusing or what!?). Line 1 uses display RAM addresses 0-13h, line 2 uses 40h-53h, line 3 uses 14h-27h, and line 4 uses 54h-67h.

Hope that info helps!

Mrsuperman
Posts: 5
Joined: July 17th, 2006, 4:29 am

Post by Mrsuperman »

thankz for the help. well i used to have a module on assembly language but now they are using C programming which i didn't learn b4. another problem is does any one know whether MPLAB v7.41 is able to program a PIC16F877 with assembly language anot?

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

Any recent MPLAB should support the 16F877 and similar devices - I was using v6.6 and those devices are supported.

You can write the code and assemble to a HEX file in MPLAB. You probably need other software to actually load the program into the PIC unless you have a Microchip programming system (like PICstart or ProMate).

You can get some very good C compilers for the PIC, but unfortunately they are too expensive for many hobbyists, especially if you're only going to use it occasionally. Having said that, there are some newer C compilers specifically for hobbyists at reasonable prices. There are also several BASIC compilers for PIC.

I use the David Tait "Classic" programmer (I built it myself and it connects to the parallel port), for which you can find schematics on the net. I use IC-Prog software to do the programming (downloading the HEX code into the PIC).

_X7JAY7X_
Hardware Genie - Plugin Author
Posts: 374
Joined: February 16th, 2005, 10:24 pm
Location: Michigan

Post by _X7JAY7X_ »

I use the CHBASIC 4.0. Although like mattcro said, it wasnt cheap. I think it was $180USD. I mainly bought it because I didnt have the time to relearn assembly. It is a tedious language.

I have a programmer that I bought of ebay. It is a serial programmer but it uses the USB port for power. The problem with the old programmer I had (olimex jdm) is that it could not be used with a laptop because it uses power from the serial port. It needs +/-13 volts to work. Laptop serial port only use +/- 5v.

J

Post Reply