|
|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| 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 |
|
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
|
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: ![]() (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. |
|
|
|
|
#2 |
|
diyAudio Member
|
|
|
|
|
|
#3 |
|
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 |
|
|
|
|
#4 |
|
diyAudio Member
|
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 |
|
|
|
|
#5 |
|
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. |
|
|
|
|
#6 | ||
|
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:
Quote:
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 |
||
|
|
|
|
#7 |
|
diyAudio Member
|
Hello!
The symbols seem to be pretty random. Now, for example, they are all the same on each LCD, but different between the two: ![]() 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. |
|
|
|
|
#8 |
|
diyAudio Member
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 |
|
|
|
|
#9 |
|
diyAudio Member
|
Thanks to everyone has answered. I tried to follow al suggestions... but nothing.
So I decided to wire the controllers in 8-bit mode: ![]() 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! |
|
|
|
|
#10 | |
|
diyAudio Moderator Emeritus
Join Date: Jan 2005
Location: Pennsylvania
|
Quote:
__________________
Brian |
|
|
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| kit /module psu | spacejay | Solid State | 2 | 31st March 2008 09:42 AM |
| DSP module with AD-DA | Snickers-is | Parts | 4 | 20th August 2007 05:00 PM |
| dbx 117 module | mmerig | Swap Meet | 0 | 11th April 2006 02:29 AM |
| LCD module? | DJG | Swap Meet | 0 | 12th December 2002 11:01 PM |
| Need diy kit module | purist | Solid State | 2 | 21st June 2002 01:27 AM |
| New To Site? | Need Help? |
| Page generated in 0.12500 seconds (84.86% PHP - 15.14% MySQL) with 10 queries |