Author Topic: Hitachi HD44780 LCD  (Read 5009 times)

0 Members and 1 Guest are viewing this topic.

Offline hazzer123Topic starter

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Hitachi HD44780 LCD
« on: January 19, 2008, 07:02:49 PM »
I have a standard Hitachi HD44780 LCD module, and i am trying to show some text on it using a PIC18f4525 and Microchip C18. I am using the XLCD library with C18.

So far i have not ben able to display anything. When i hook everything up to the power, the top line of the display is just a line of blocks (every pixel is dark) and the bottom is clear (no pixel is dark). When i run the MCU nothing happens on the display. If i put an LED on the pins of the PIC which communicate with the LCD it flashes as if data is being sent.
Im starting to think the module may be faulty.

Is there any way of knowing if it is faulty or not?

Any ideas?

Thanks
Imperial College Robotics Society
www.icrobotics.co.uk

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: Hitachi HD44780 LCD
« Reply #1 on: January 19, 2008, 07:27:27 PM »
Maybe the code is sending data incorrectly.

BTW, have you set the contrast properly?

This could be of some help:
http://home.iae.nl/users/pouweha/lcd/lcd0.shtml
http://ouwehand.net/~peter/lcd/lcd.shtml
http://www.repairfaq.org/filipg/LINK/F_Tech_LCD.html
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline hazzer123Topic starter

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: Hitachi HD44780 LCD
« Reply #2 on: January 19, 2008, 07:34:16 PM »
Thanks for your reply again :D

I have just been going through the code instruction by instruction. I have found something but using LEDs on the 4 data lines.

I found something really strange. When any of the bits on the PORTA of my PIC are changed, the whole port seems to reset. For example -
 
I have 5 bits: Enable, then D8 - D4 on my PORTA. I set the bits i need for the nibble i want to send to the LCD but when i try to strobe the enable pin with this code -
Code: [Select]
PORTAbits.RA4 = 1The D8-D4 turn off and the enable turns on.

The same happens with this code -

Code: [Select]
PORTA ^= 0b00010000;
I don't know why this is...

Any ideas.
« Last Edit: January 19, 2008, 07:39:14 PM by hazzer123 »
Imperial College Robotics Society
www.icrobotics.co.uk

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: Hitachi HD44780 LCD
« Reply #3 on: January 21, 2008, 03:17:35 PM »
i don't have any ideas :( sorry i'm not a PIC guy.
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline hazzer123Topic starter

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: Hitachi HD44780 LCD
« Reply #4 on: January 21, 2008, 04:11:33 PM »
No Problem, I went to the microchip forum and they helped me out. Apparently a new feature of the PIC18s means that you use LATA (meaning Latch on port A) as your port register rather than PORTA as with PIC16s. Im not really sure of the electronics behind this, but it works.

so the new code is

Code: [Select]
LATAbits.LATA4 = 1
Thankyou anyway :D
Imperial College Robotics Society
www.icrobotics.co.uk

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Hitachi HD44780 LCD
« Reply #5 on: January 21, 2008, 05:12:34 PM »
No Problem, I went to the microchip forum and they helped me out. Apparently a new feature of the PIC18s means that you use LATA (meaning Latch on port A) as your port register rather than PORTA as with PIC16s. Im not really sure of the electronics behind this, but it works.

so the new code is




Code: [Select]
LATAbits.LATA4 = 1
Thankyou anyway :D

thanks for sharing the answer , it will come in helpful for me later  ;)
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

 

SMF spam blocked by CleanTalk