problems whit lcd
Moderator: Benj
problems whit lcd
hi
I'm using an 4x20 lcd on a 16f877a pic and I cant get it runing can someon help me.
lcd:
http://www.e-lab.de/diverse/DEM20486.pdf
I'm using an 4x20 lcd on a 16f877a pic and I cant get it runing can someon help me.
lcd:
http://www.e-lab.de/diverse/DEM20486.pdf
- 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: problems whit lcd
Hello,
Have you ensured that your program is running at the right speed. Creating a simple 1 second LED flasher program will confirm if you have the clock speed and chip configuration setup correctly for your hardware.
Secondly have you connected the R/W line to anything? This should be tied to ground.
Thirdly the data pins specified in Flowcode should be connected as follows.
Data1 -> LCD Data 4
Data2 -> LCD Data 5
Data3 -> LCD Data 6
Data4 -> LCD Data 7
The other Data pins D0-D3 should be left disconnected.
The schematic shown in the EB005 E-block datasheet will help you to confirm that your connections are correct.
Have you ensured that your program is running at the right speed. Creating a simple 1 second LED flasher program will confirm if you have the clock speed and chip configuration setup correctly for your hardware.
Secondly have you connected the R/W line to anything? This should be tied to ground.
Thirdly the data pins specified in Flowcode should be connected as follows.
Data1 -> LCD Data 4
Data2 -> LCD Data 5
Data3 -> LCD Data 6
Data4 -> LCD Data 7
The other Data pins D0-D3 should be left disconnected.
The schematic shown in the EB005 E-block datasheet will help you to confirm that your connections are correct.
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: problems whit lcd
no successe
it's conected like you said.
When I max the contrast is it normal that only the 2nd and the 4th line are black the 1st and 3rd line are blanck.
I'v tested the setup of the pic whit a flashing led and everithing is ok.
is there any thing else I need to setup in flowcode
it's conected like you said.
When I max the contrast is it normal that only the 2nd and the 4th line are black the 1st and 3rd line are blanck.
I'v tested the setup of the pic whit a flashing led and everithing is ok.
is there any thing else I need to setup in flowcode
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: problems whit lcd
If you post your flowchart along with details of osc speed, I can have a look to see if issue is with that or not.
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: problems whit lcd
Your Flowchart should controll LCD fine.
Looking like a hardware issue.
With LCD uninitialized.
Can you vary contrast from no squares showing to at least a single row of squares showing?
You will not see letters or numbers on the display if too much or not enough contrast.
If it was me and I can't get lcd to work:
With lcd connected, I would get the flowchart to toggle the all the pins that are not tied to +5V or 0V.
Toggle high for a few seconds, then low for a few seconds and make sure the voltage changes correctly from 0V to +5V on D4 to D7 and RS and E of LCD.
That should help track down the problem.
As Ben said, check R/W is shorted to 0V (so don't toggle R/W of course)
If they are changing OK, then check individually that portb0 goes to D4 of LCD module, portb1 goes to D5, Portb2 goes to D6 and portb3 goes to D7 of LCD module etc.
Luckily I have not heard of an lcd dispaly that does not work with Flowcode
Looking like a hardware issue.
With LCD uninitialized.
Can you vary contrast from no squares showing to at least a single row of squares showing?
You will not see letters or numbers on the display if too much or not enough contrast.
If it was me and I can't get lcd to work:
With lcd connected, I would get the flowchart to toggle the all the pins that are not tied to +5V or 0V.
Toggle high for a few seconds, then low for a few seconds and make sure the voltage changes correctly from 0V to +5V on D4 to D7 and RS and E of LCD.
That should help track down the problem.
As Ben said, check R/W is shorted to 0V (so don't toggle R/W of course)
If they are changing OK, then check individually that portb0 goes to D4 of LCD module, portb1 goes to D5, Portb2 goes to D6 and portb3 goes to D7 of LCD module etc.
Luckily I have not heard of an lcd dispaly that does not work with Flowcode
Martin
Re: problems whit lcd
hi
reply after some time
I am testing the outputs of the pic whit an osciloskop where the lcd should be conected. results:
when the pic is powerd the outputs data1, data2 "1" data3, data4 "0" RS "1" enable "0"
no oscillations no nothing just constant +5v output
does this mean something to somebody
tnx
reply after some time
I am testing the outputs of the pic whit an osciloskop where the lcd should be conected. results:
when the pic is powerd the outputs data1, data2 "1" data3, data4 "0" RS "1" enable "0"
no oscillations no nothing just constant +5v output
does this mean something to somebody
tnx
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: problems whit lcd
What that means is the pins that are connected to data lines of LCD are floating. Due to the nature of LCD display, the data lines are pulling up the pins to target device. RS and enable don't.some3 wrote:I am testing the outputs of the pic whit an osciloskop where the lcd should be conected. results:
when the pic is powerd the outputs data1, data2 "1" data3, data4 "0" RS "1" enable "0"
no oscillations no nothing just constant +5v output
does this mean something to somebody
tnx
I'm surprised you are getting a flashing led, as the data lines are pulled up if either oscillator is not working, So ports have defaulted to high impedance state, or hardware is pulling lines up so much that o/p from chip cannot pull low, i.e shorted to +5V. If not done already. How about you connected an LED to a spare pin so it is flashing all the time, with LCD still attached, then measure data lines. My guess is osc is not working correctly now.
What is the voltage on pin 1?
It need to be +5V. If it is not then connect to +5V via a pull up resistor(only if programming in situ). If you are not programming chip via ICSP then pin 1 can be connected directly to +5V.
Sorry can't help any further than that.
Martin
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Re: problems whit lcd
Hmm thats very interesting
Ive just built a 4 x 20 LCD eblock as well and its behaving exactly the same as above.
Mine came from Rapid Electronics (not sure of the part number at the moment)
My test program was a simple loop (set up lcd before the loop) just to use the cursor statement and write ascii to each line, wait a couple of seconds clear the display and back to the start.
This is the display I'm using
http://www.rapidonline.com/sku/Electron ... 37/57-0946
Ive just built a 4 x 20 LCD eblock as well and its behaving exactly the same as above.
Mine came from Rapid Electronics (not sure of the part number at the moment)
My test program was a simple loop (set up lcd before the loop) just to use the cursor statement and write ascii to each line, wait a couple of seconds clear the display and back to the start.
This is the display I'm using
http://www.rapidonline.com/sku/Electron ... 37/57-0946
1 in 10 people understand binary, the other one doesn't !
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Re: problems whit lcd
I have now got my display working.
The problem was I had missed of the wire from LCD Pin 5 (R/W) to gnd.
Maybe if some3 looks around this area as it sounds like our faults are very similar.
I tried his simple flowchart on my hardware and it works fine. Ive attached my test program as well.
The problem was I had missed of the wire from LCD Pin 5 (R/W) to gnd.
Maybe if some3 looks around this area as it sounds like our faults are very similar.
I tried his simple flowchart on my hardware and it works fine. Ive attached my test program as well.
- Attachments
-
- Large LCD Test Program.fcf
- (6 KiB) Downloaded 275 times
1 in 10 people understand binary, the other one doesn't !
- Dan81
- Valued Contributor
- Posts: 268
- Joined: Sun Jan 15, 2006 4:07 pm
- Location: Albi France
- Been thanked: 60 times
- Contact:
Re: problems whit lcd
Hello some3
There is no delay in your Flowchart, try to add a 200ms delay.
Did you test lcd AND flashing led (at the same time)
Daniel
There is no delay in your Flowchart, try to add a 200ms delay.
Did you test lcd AND flashing led (at the same time)
Daniel
Re: problems whit lcd
(
I am testing all diferebt combnations of delays.
I alsow tried to conect the lcd via pul up resistors (10kohm). Pin no 1 is alsow conected to +5v via 10 k resistor on the pin 1 is alsow 5v.
ther is one led blincking all the time on the pin 7 of B port the elc is conected to pins 1,2,3,4,5 port B.
I am testing all diferebt combnations of delays.
I alsow tried to conect the lcd via pul up resistors (10kohm). Pin no 1 is alsow conected to +5v via 10 k resistor on the pin 1 is alsow 5v.
ther is one led blincking all the time on the pin 7 of B port the elc is conected to pins 1,2,3,4,5 port B.
- 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: problems whit lcd
Hello,
You don't need a pullup resistor on pin 1, this could be causing your issues.
Have you looked at the schematic available at the end of the file here it should show you exactly how to connect up the display.
http://www.matrixmultimedia.com/datashe ... 5-30-3.pdf
You don't need a pullup resistor on pin 1, this could be causing your issues.
Have you looked at the schematic available at the end of the file here it should show you exactly how to connect up the display.
http://www.matrixmultimedia.com/datashe ... 5-30-3.pdf
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
-
- Posts: 234
- Joined: Thu May 31, 2007 2:18 pm
- Has thanked: 7 times
- Been thanked: 12 times
- Contact:
Re: problems whit lcd
Iv see on post the the clock was 4Mhz but project has 19660800Mhz selected.
hope you get it working soon.
Wayne
hope you get it working soon.
Wayne
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: problems whit lcd
When I mentioned pin 1, I was referring to pin 1 of microcontroller (MCLR/VPP), But I did leave a bit of information out which would of made this point clearer. Sorry about that.some3 wrote:(
I alsow tried to conect the lcd via pul up resistors (10kohm). Pin no 1 is alsow conected to +5v via 10 k resistor on the pin 1 is alsow 5v..
However This may turn out to be a blessing in disguise!
According to the LCD data-sheet you posted pin1= VSS = GND =0V
Since power supply internal resistance is much lower then 10K, If you use a 10K across VCC =+5V and VSS = 0V, then pin 1 would not go up to +5V. If it does, then I don't believe there is a connection between VSS of LCD and 0V of your power supply. That would also explain the extra +5V on the LCD pins.
Perhaps you can disconnect +Ve of power supply and do a continuity test between 0V of LCD and 0V of power supply.
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: problems whit lcd
hi
I was busy the past few days so I had no time to experiment.
The clock is set at 4 Mhz
Daniel
I'm using an 4x20 lcd on a 16f877a pic
lcd:http://www.e-lab.de/diverse/DEM20486.pdf
I have tried to test all the wires thet conect the pic to lcd and ar ok.
the pin1 of the pic is conected to +5v via 10k resistor like it should be?
I'v also conected a 10K resistor across +5V and gnd and there is always 5V betwin pin 1 an 2 on the lcd.
I'm starting to think that I bought a broken lcd
I was busy the past few days so I had no time to experiment.
The clock is set at 4 Mhz
Daniel
I'm using an 4x20 lcd on a 16f877a pic
lcd:http://www.e-lab.de/diverse/DEM20486.pdf
I have tried to test all the wires thet conect the pic to lcd and ar ok.
the pin1 of the pic is conected to +5v via 10k resistor like it should be?
I'v also conected a 10K resistor across +5V and gnd and there is always 5V betwin pin 1 an 2 on the lcd.
I'm starting to think that I bought a broken lcd
- Dan81
- Valued Contributor
- Posts: 268
- Joined: Sun Jan 15, 2006 4:07 pm
- Location: Albi France
- Been thanked: 60 times
- Contact:
Re: problems whit lcd
Hello some3
Can you post the schematic of your wiring between LCD and Pic.
when the pic is powerd the outputs data1, data2 "1" data3, data4 "0" RS "1" enable "0"
no oscillations no nothing just constant +5v output
If you look at "enable" (pin 6 of LCD) with an oscilloscope , there must be pulses with 100us long (at Vcc)
Like John ,I think it's a hardware problem.(like DB0-DB3 connected instead of DB4-DB7 sorry)
Daniel
Can you post the schematic of your wiring between LCD and Pic.
when the pic is powerd the outputs data1, data2 "1" data3, data4 "0" RS "1" enable "0"
no oscillations no nothing just constant +5v output
If you look at "enable" (pin 6 of LCD) with an oscilloscope , there must be pulses with 100us long (at Vcc)
Like John ,I think it's a hardware problem.(like DB0-DB3 connected instead of DB4-DB7 sorry)
Daniel
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Re: problems whit lcd
As Ben pointed out above you DO NOT need a resistor on the 5 V line.
Mine is wired in the same way as the lcd e-block
I have build my display on a Matrix prototype board to use it as an e-block.
My test program is used with a 16F877A pic running at the standard 19.660800 MHz
Just as a thought, I assume you have tried another PIC , just in case it is faulty
How long are the wires between the pic and the lCD, are you getting some kind of noise pickup?
Mine is wired in the same way as the lcd e-block
I have build my display on a Matrix prototype board to use it as an e-block.
My test program is used with a 16F877A pic running at the standard 19.660800 MHz
Just as a thought, I assume you have tried another PIC , just in case it is faulty
How long are the wires between the pic and the lCD, are you getting some kind of noise pickup?
1 in 10 people understand binary, the other one doesn't !
Re: problems whit lcd
the lcd is connected folowing
in flowcode I'v set to use port B
0,1,2,3,4,5
lcd
pin1..gnd
pin2..5v (direct NO resistor)
pin3..10k potenciometer
pin4..rs pin 6 on pic
pin5..gnd (direct NO resistor)
pin6..pin5 pic
pin7,8,9,10..not conected..in air
pin11..pin 0 pic
pin12..pin1 pic
pin13..pin 2 pic
pin 14..pin 3 pic
pin15,pin16 led becground
the wires are +-10 cm long
I will try to put an other cristal for the clock
in flowcode I'v set to use port B
0,1,2,3,4,5
lcd
pin1..gnd
pin2..5v (direct NO resistor)
pin3..10k potenciometer
pin4..rs pin 6 on pic
pin5..gnd (direct NO resistor)
pin6..pin5 pic
pin7,8,9,10..not conected..in air
pin11..pin 0 pic
pin12..pin1 pic
pin13..pin 2 pic
pin 14..pin 3 pic
pin15,pin16 led becground
the wires are +-10 cm long
I will try to put an other cristal for the clock
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Re: problems whit lcd
Think you have a slight difference in your connetions to mine, or maybe its the way im reading your wiring list
This is my wiring, as I posted earlier, once I connected LCD R/W to gnd , that Id missed initially, my display started working.
Remember Bit numbers start at zero on a port
LCD Pin 6 Enable = PIC PORT B5 (PIN 6 on 9pin D Connector on programmer)
LCD Pin 5 R/W = PIC GND
LCD Pin 4 R/S = PIC PORT B6 (PIN 5 on 9 pin D Connector on programmer)
Your data lines look the same as mine
DB4 Pin 11 = B0 Pin 1 on 9 Pin D
DB5 Pin 12 = B1 Pin 2 on 9 Pin D
DB6 Pin 13 = B2 Pin 3 on 9 Pin D
DB7 Pin 14 = B3 Pin 4 on 9 Pin D
This is my wiring, as I posted earlier, once I connected LCD R/W to gnd , that Id missed initially, my display started working.
Remember Bit numbers start at zero on a port
LCD Pin 6 Enable = PIC PORT B5 (PIN 6 on 9pin D Connector on programmer)
LCD Pin 5 R/W = PIC GND
LCD Pin 4 R/S = PIC PORT B6 (PIN 5 on 9 pin D Connector on programmer)
Your data lines look the same as mine
DB4 Pin 11 = B0 Pin 1 on 9 Pin D
DB5 Pin 12 = B1 Pin 2 on 9 Pin D
DB6 Pin 13 = B2 Pin 3 on 9 Pin D
DB7 Pin 14 = B3 Pin 4 on 9 Pin D
1 in 10 people understand binary, the other one doesn't !
Re: problems whit lcd
Now I have tryed everything thet was sayed
checking wires
tried a new crystal (16. ....Mhz)
conect the lcd to all ports
tried whit a 2nd pic
whit a 2nd lcd
the rw wirew has conected to gnd 100%
it's not working
checking wires
tried a new crystal (16. ....Mhz)
conect the lcd to all ports
tried whit a 2nd pic
whit a 2nd lcd
the rw wirew has conected to gnd 100%
it's not working
- Dan81
- Valued Contributor
- Posts: 268
- Joined: Sun Jan 15, 2006 4:07 pm
- Location: Albi France
- Been thanked: 60 times
- Contact:
Re: problems whit lcd
Hello some3
try this file
Is the led flashing ? (if not there is a trouble with pic or cristal (config seems to be OK))
- Have you got an oscilloscope ?
if yes , do you see pulses (100us) on enable RB5 (pin 38 of 16F877)
---if yes : take a look at RB0 ...RB5 on Pic pins and on Lcd pins
---if not : remove wires between Pic and Lcd and look at Pic pins.
Can you post (or send it via PM) a picture of your hardware
Daniel
try this file
Is the led flashing ? (if not there is a trouble with pic or cristal (config seems to be OK))
- Have you got an oscilloscope ?
if yes , do you see pulses (100us) on enable RB5 (pin 38 of 16F877)
---if yes : take a look at RB0 ...RB5 on Pic pins and on Lcd pins
---if not : remove wires between Pic and Lcd and look at Pic pins.
Can you post (or send it via PM) a picture of your hardware
Daniel
- Attachments
-
- lcd_some3_v3.fcf
- (7 KiB) Downloaded 183 times
Re: problems whit lcd
IT IS WORKING
It looks like that there wase something wrong in the setup of the flowcode
Thank you very much for your help
It looks like that there wase something wrong in the setup of the flowcode
Thank you very much for your help