Problems with a LCD Module - diyAudio
Go Back   Home > Forums > General Interest > Everything Else

Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools......

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 22nd April 2007, 02:01 PM   #1
Giaime is offline Giaime  Italy
diyAudio Member
 
Giaime's Avatar
 
Join Date: Oct 2004
Send a message via MSN to Giaime
Default Problems with a LCD Module

Hello friends,

I'm working on a remote controlled, PIC powered audio preamp.

It will have an LCD display: so I'm trying to make it work. I wrote some LCD routines for the PIC, but most of them were written by a friend of mine, that tried them and they work.

But instead of displaying characters, it displays those strange symbols:

Click the image to open in full size.
(sorry for the low-quality photo)

What's that? I checked and those symbols aren't chinese, and they aren't on the LCD module character ROM.

So, do I have a broken LCD module? Or what else?

I'm using a KS0066-based LCD module, and a 16F877A PIC. Obviously the PIC works, and it appears that on the LCD there is the right number of character, and also the display's functions (return to line 1, go to line 2, cursor blink...) DO work. Only the characters are screwed up.

I have an identical module here, will try to swap them and see if it work.

What can it be?

Thanks in advance for anyone who wants to help.
  Reply With Quote
Old 22nd April 2007, 02:26 PM   #2
Giaime is offline Giaime  Italy
diyAudio Member
 
Giaime's Avatar
 
Join Date: Oct 2004
Send a message via MSN to Giaime
Just put the other module in parallel with the "suspect" one: still it doesn't work, it puts out strange symbols. What's interesting is that the symbols are different between displays:

Click the image to open in full size.

I guess I understand why I bougth them cheap from eBay...
  Reply With Quote
Old 22nd April 2007, 05:23 PM   #3
BWRX is offline BWRX  United States
diyAudio Moderator Emeritus
 
Join Date: Jan 2005
Location: Pennsylvania
It looks like they both work but the pixel mapping is incorrect. Notice how you see the same "character" in the same position on both LCDs. You mentioned your friend wrote the LCD routines you're using. What LCD did he write them for and what LCD are you using? How exactly does the PIC control the LCD? Are you writing to it too fast?

On the hardware side, check carefully for solder bridges on the LCD and around the PIC processor.
__________________
Brian
  Reply With Quote
Old 22nd April 2007, 06:29 PM   #4
Giaime is offline Giaime  Italy
diyAudio Member
 
Giaime's Avatar
 
Join Date: Oct 2004
Send a message via MSN to Giaime
Hello Brian!

thank you very much for your answer. First I would like to say I'm trying various display initialization routines, from various sources (all for HD44780 compatible displays, and all for 4-bit data transfer), from the web, from the HD44780 datasheet, from the KS0066 datasheet, etc etc... they all look about the same, and I'm following them closely, with all the needed delays inbetween cycles, etc etc.

I also have to add that since I posted, I disconnected the unusued data LCD bits (d0...d3, unusued in 4bit mode) from ground. I was told to connect them to ground, but the datasheet and some internet tutorials and faqs say to leave them unconnected (internal pullups, they say). But still nothing, only strange characters.

Note that now the two LCDs don't follow the same strange symbols: now the simbols are different (however the same number of symbols).
And sometimes they change the symbol randomly on some PIC reset, or some power off.

To answer your questions,

1) my friend write the routines for a 16x2 LCD, very similar to those above. He's helping me, and even with good PIC experience, he's as puzzled as me.

2) The PIC does control the LCD with the data bits on PORTD (it's a PIC16F877A, and yes I disabled all the features on the ports I'm using, such as parallel port, serial ports, A/D converter, comparators, etc etc...). The LCD enable bit, and the RS bit (register select) are on PORTC bit 4 and 5. RS has a pull-up.

3) On the PIC side, there aren't solder bridges because I'm testing it on a breadboard. On the LCD, I checked several and several time, I couldn't find any problem.

A bit puzzled
  Reply With Quote
Old 22nd April 2007, 07:03 PM   #5
mopus is offline mopus  Canada
diyAudio Member
 
Join Date: Jul 2004
Location: nowhere
try to build a simple circuit like the winamp lcd plugin to test your modules an isolate your problem.

http://www.markuszehnder.ch/projects...n/download.php

it's not much more than a couple of pots, a voltage regulator and a parallel interface.

also, i don't know if it's recommended or not, but i like to solder a pin header onto the modules and connect with a ribbon cable.
  Reply With Quote
Old 22nd April 2007, 07:19 PM   #6
BWRX is offline BWRX  United States
diyAudio Moderator Emeritus
 
Join Date: Jan 2005
Location: Pennsylvania
Hi Giaime. I'll come right out and say I'm not much of a coder. In fact, I barely know enough to be dangerous.

Quote:
Originally posted by Giaime
Note that now the two LCDs don't follow the same strange symbols: now the simbols are different (however the same number of symbols).
And sometimes they change the symbol randomly on some PIC reset, or some power off.
The symbols are different, but notice how they're same for certain positions on both displays. For example, positions 2, 3, and 4 are the same on the one LCD and are a different pattern on the second LCD but are the same for those positions. That means the PIC is telling the LCD to display the same thing for both LCDs, however the command is not being interpreted correctly by the LCD controller.

Quote:
Originally posted by Giaime
My friend write the routines for a 16x2 LCD, very similar to those above. He's helping me, and even with good PIC experience, he's as puzzled as me.

The LCD enable bit, and the RS bit (register select) are on PORTC bit 4 and 5. RS has a pull-up.
Is this the datasheet for the LCD controller? --> http://www.datsi.fi.upm.es/docencia/...cd/ks0066u.pdf

Are you sure it is configured for 4-bit bus mode (DL = 0)? Look at page 15 of the datasheet I linked to above to see the function set control bits. Also, it says "When in 4-bit bus mode it needs to transfer 4-bit data twice."
__________________
Brian
  Reply With Quote
Old 22nd April 2007, 08:33 PM   #7
Giaime is offline Giaime  Italy
diyAudio Member
 
Giaime's Avatar
 
Join Date: Oct 2004
Send a message via MSN to Giaime
Hello!

The symbols seem to be pretty random. Now, for example, they are all the same on each LCD, but different between the two:

Click the image to open in full size.

The datasheet you linked is the right one. For the LCD initialization, I followed very strictly the procedure at page 27, but it didn't work. Now, maybe I made some changes, so I'm going to rewrite the initialization procedure, following the datasheet. I will report later...

edit: re-did the routine the same as the datasheet says, and nothing: still the same results, as in the photo above.
  Reply With Quote
Old 22nd April 2007, 11:21 PM   #8
diyAudio Member
 
I_Forgot's Avatar
 
Join Date: Jan 2005
Location: Phoenix, Az.
Many LCD modules have some user programmable CG locations. It may be that your code is addressing one of those locations and displaying the random stuff that is normally there until you program it with something non-random. Check your code and make sure you haven't mixed up the CG row and column addresses.

If you're using a PIC MCU you can use the free Maestro program from Microchip's web site to automatically generate the code required to address and control the LCD module. You tell it a few deatils about the module such as whether the interface is 4 or 8 pins, which port it is connected to, etc., and it generates a group of subroutines you can access to write to the module. I've used it a couple times and it works well.

I_F
  Reply With Quote
Old 23rd April 2007, 08:51 PM   #9
Giaime is offline Giaime  Italy
diyAudio Member
 
Giaime's Avatar
 
Join Date: Oct 2004
Send a message via MSN to Giaime
Thanks to everyone has answered. I tried to follow al suggestions... but nothing.

So I decided to wire the controllers in 8-bit mode:

Click the image to open in full size.

at least I know for sure they work!

I'm trying to understand what went wrong. Because I don't know yet if I have the space to work in 8bit mode with the LCD, I will use a smaller PIC in the definitive project (PIC16F876A) and I don't know if I have free pins available.

I'll let you know how the thing proceeds. Thanks to anyone!
  Reply With Quote
Old 23rd April 2007, 11:13 PM   #10
BWRX is offline BWRX  United States
diyAudio Moderator Emeritus
 
Join Date: Jan 2005
Location: Pennsylvania
Quote:
Originally posted by Giaime
So I decided to wire the controllers in 8-bit mode... at least I know for sure they work!
Hi Giaime. I suspect that you weren't sending data properly to the LCD controller in 4bit mode since it works fine in 8bit mode. Were you transferring the higher 4bits then the lower 4bits or vice versa?
__________________
Brian
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
kit /module psu spacejay Solid State 2 31st March 2008 10:42 AM
DSP module with AD-DA Snickers-is Parts 4 20th August 2007 06:00 PM
dbx 117 module mmerig Swap Meet 0 11th April 2006 03:29 AM
LCD module? DJG Swap Meet 0 13th December 2002 12:01 AM
Need diy kit module purist Solid State 2 21st June 2002 02:27 AM


New To Site? Need Help?

All times are GMT. The time now is 06:22 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2