PIC MCU to a external LCD (HD44870)

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
sssuneth
Posts: 2
Joined: Tue Feb 08, 2011 12:51 pm

PIC MCU to a external LCD (HD44870)

Post by sssuneth »

I am using a EB 006 , EB005, EB007 to program a PIC16F887 to use in my project. my project is a score board and I have built separate hardware. it has no Matrix main board or e blocks connected. I do use the same LCD as Matrix EB005 uses which is HD44870 and LEDs on my hardware.

I program the PIC with Matrix e blocks and works fine with EB005 but when I moved the PIC MCU to my hardware, LEDs are working but LCD is not displaying.

there for I am assuming I may have not connected LCD as EB005 does.

I found the schematic for EB005 via http://www.matrixmultimedia.com/datashe ... 5-30-3.pdf and i made sure that my connection from PIC to LCD as same as EB005. I as I understand EB005 uses 4bit data method to connect pic to LCD so did I.
Here is how i connected mine;

my LCD data sheet http://www.farnell.com/datasheets/653680.pdf

LCD PIN # ==connects===>> PIC MCU
1..VSS............................................................GND
2..VDD ...........................................................(+)
3..V0..............................................................(Potential meter)
4..(RS).......................... RA4
5..(R/W)........................................................ GND
6..(E)............................RA5
7..(D0)...........................................................GND
8..D1.............................................................GND
9..D2.............................................................GND
10.D3............................................................ GND
11..(D4)...................... ..RA0
12..(D5).........................RA1
13..(D6).........................RA2
14..(D7).........................RA3
15..LED+.........................................................(+)
16..LED(-).................................................... ...GND

If any one can suggest me to change my connection to get LCD running I would be much appreciated

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: PIC MCU to a external LCD (HD44870)

Post by medelec35 »

Hi y sssuneth,
The only difference I can see to how I wired my display is I left D0 to D3 O/C and not connected to ground. Im not sure, but could it be, if D0 to D3 are grounded then treating as 8 bit mode. But If D0 to D3 is o/c then treating as 4bit mode?? This is just a pure guess and not fact.
You can also check continuity of R/W and make sure it's connected to GND.

I also noticed looking at your connections you have LED connected between + and GND. There should be a current limiting resistor connected in series with LED and supply.
If you have left LED out of the circuit could the 5V rail be dragged down by forward voltage drop LED drawing too much current?
You could check by measuring 5V rail (unless limiting resistor is built-in of course.

If I think of anything else I will let you know.


Martin
Martin

sssuneth
Posts: 2
Joined: Tue Feb 08, 2011 12:51 pm

Re: PIC MCU to a external LCD (HD44870)

Post by sssuneth »

thank you very much for your reply

I left (D0 to D3) open circuited and connected R/W to ground, tough luck it was the same result

well about Back light LED, regardless Back light LED connection, display displays 16 black dot squares.
but nothing else.. even without PIC it shows those squares..

here are my volt meter readings when I left D0..D3 O/C
D4--->5V
D5--->5V
D6--->5v
D7--->5V

R/W--->0V (connected to GND)
E--->5V


back light LED works
contrast controller works

could you think of anything else...
Attachments
LCD
LCD
DSC01019.JPG (76.83 KiB) Viewed 4370 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: PIC MCU to a external LCD (HD44870)

Post by medelec35 »

The black squares is usually when the LCD is not initialised. This would either be down to either software or hardware.
E.g
Software.
is usually a pin connection issue or Timing issue. My suggestion would be to create a 1Hz flasher.
e.g :

Code: Select all

Loop forever
Led on
delay 500ms
Led off
delay 500ms
Make sure LED is flashing at 1Hz
Are you using the same Flowchart for both Eblocks and proto board without any alterations at all?

Hardware
Again timing issue. It could be that capacitances of tracks wires etc are causing OSC to run at wrong speed. Do the 1Hz test, or better still use a scope or frequency meter and check osc is running at correct speed.For that you will probably have to increase from 1 HZ to say 1KHz as an example.


Different connections assigned in flowchart to what is connected to LCD.
LCD connections either shorted or open.

If it was was me I would try two things:
1) With no power, check connections between chip and LCD for open and short circuits. That way you can confirm connections are to correct pins of LCD and chip. Place a probe on one pin of LCD and check there are no shorts on adjacent pins. do the same for chip as you could have o/c and s/c.
If all turns out to be 100% correct then my other option:

2) Add to the beginning of flowchart a test routine (and remove it when test passes.)
I would use the switch to toggle each pin of LCD in turn each time switched is pressed (must include a de-bounce routine, and port does not change until switch is released)
and check each pin is at correct voltage level after switched is pressed and released.

If your using a different Flowchart for the non working board, or you want help in the test routine, then if you post your flowchart, I can assist you further

This may seem a bit time consuming, but in the end would be more time consuming if you had a short circuit/ open Circuit/faulty chip and constantly adjusting software to try and make it work.

Martin
Martin

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: PIC MCU to a external LCD (HD44870)

Post by Dan81 »

Hello sssuneth

if it is not a wire problem
May be a problem of "raising" of the supply voltage.
Try to reset the pic when the power is steady
or Add a 500ms delay at the begin of the main, before the "start" macro of the LCD.

Daniel

Post Reply