Page 1 of 1

connecting lcd

Posted: Tue May 31, 2011 8:04 am
by tompzone
hi, i have been trying to connect the lcd to the pic 16f88 and 16f877A but non shows anything on the lcd, i connect them to port B as default, but i doesnt work and i have been tryng several lcd displays (16x4 and one 16x2 the displays works so that's not the issue), so is there anything i should know about connecting the lcd? (by the way i am conecting the R/W to ground), the simulations work great on flowcode but i doesnt on Proteus and on the real board

Re: connecting lcd

Posted: Tue May 31, 2011 10:21 am
by Benj
Hello,

To get the LCD to work correctly you must ensure you are doing the following things.

1) Wiring +V connection to the display. If you are using E-blocks then you need to connect a wire from the +V terminal on the multiprogrammer to the +V terminal on the E-block.

2) Chip -> Configuration. You will probably need to go in here and change the crystal type to XTAL. If your chip is not in the simple settings list then you will need to use the expert settings to configure your device. Without doing this your program will not run as expected or at the correct speed.

3) View -> Project Options. Make sure that the speed specified here matches the frequency of your oscillator so that delays and baud rates etc can be calculated correctly.

Re: connecting lcd

Posted: Tue May 31, 2011 7:35 pm
by tompzone
well i amo not using Eblocks, i am testing it on a protoboard, and i have followed the conections (RW to GND) but it doesnt work, i am using the f877A and the ldc is on port B and it still doesnt work

by the way i checked the oscillator frequency and it matches my current oscilator (XT)

Re: connecting lcd

Posted: Tue May 31, 2011 7:58 pm
by medelec35
Hi tompzone,
Take a look here:
http://www.matrixmultimedia.com/mmforum ... =26&t=6936
It may help you get going.
After reading this, if you post your flowchart, I can have a look at it for you.
In general LCD not working is usually down to Flowcode settings, E.g Low voltage programming or watchdog timer may not be disabled. You might have MCLR set for external, so chip will not run if MCLR pin is not pulled up to +5V.
You could make a 1Hz flasher to check pin is toggling at 1Hz.

Martin

Re: connecting lcd

Posted: Wed Jun 01, 2011 2:59 am
by tompzone
hi thanks for the advice and the link i checked the settings and they are correct, using a cristal of 4Mhz, and double checked the connections and it still doesnt work, i am uploading the code

Re: connecting lcd

Posted: Wed Jun 01, 2011 3:36 am
by tompzone
by the way maybe this is the problem, the lcd that i am using (16x2) is a TC1602A and the 16x4 is a kl sn102 94v and a pwb 20434-cem

Re: connecting lcd

Posted: Wed Jun 01, 2011 10:02 am
by Benj
Hello,

Just a thought but how are you connecting the data lines to the LCD? Flowcode's data lines are numbered 1 - 4 but are actually connected through to the upper nibble on the LCD's data bus.

Re: connecting lcd

Posted: Wed Jun 01, 2011 10:19 am
by medelec35
I generally find other LCD’s do work with Flowcode.

I have looked at your flowchart and I agree that settings seem correct.
Delay at the start: If I was you I would place a 50ms delay at the start of your main program. This allows LCD warm up time.
Switch detection: In flowchart Your LCD does not display anything until a switch is pressed. Could you set 1 pin up to toggle at 1Hz all the time and another pin to toggle at 1Hz only when switch is pressed. This will test OSC and switches are correctly working.
If you adjust contrast, can you see a row of black squares, when power first connected?

Usually if LCD is initialised the squares will then disappear.
If squares do not appear then there could be a problem with contrast control, power to LCD or LCD itself.

Could there be a open or short between microcontroller and LCD?
Perhaps you could do a continuity test between each of connections and between microcontroller and LCD

Re: connecting lcd

Posted: Thu Jun 02, 2011 5:07 am
by tompzone
Thanks alot, i was connecting the Lcd as the bits as the connections show it, and not to the uppernibble, thanks Benj you saved me :), and thanks alot medelec35 your advices were very helpful as well