connecting lcd
connecting lcd
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: connecting lcd
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: connecting lcd
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)
by the way i checked the oscillator frequency and it matches my current oscilator (XT)
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: connecting lcd
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
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
Martin
Re: connecting lcd
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
- Attachments
-
- Flowcode1.fcf
- (12 KiB) Downloaded 347 times
Re: connecting lcd
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: connecting lcd
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: connecting lcd
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
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
Martin
Re: connecting lcd
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