Hey guys
I have a strange problem...
I've got a RFID terminal running with an LCD that I need to alter the coding...
The flow code is as follows:
String Manipulation
LCD Start
RFID Initialise
LCD cursor set
Connection Point
String Maipulation
LCD clear
LCD Print ASCII
1s Delay
While Loop
If I delete the while loop and everything after, and remove the then invalid connection point, then the LCD displays nothing.
If I put a while loop just before the programmed while loop, the LCD shows nothing.
If I start a new program, setup connections as need be... I cant get LCD to display anything?
Can anyone shed some light on this for me?
Thanks
Strange LCD Problem
Moderator: Benj
- 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: Strange LCD Problem
Hello,
Best way to get started is to create a one second flasher program.
This is a loop containing a output high to a pin, a second delay, an output low to the pin and another second delay.
There are then two settings to get your hardware to run at the right speed.
1) Clock speed setting in the Project Options window. Ensure this matches your crystal frequency.
2) Configuration settings in the Chip -> Configure menu.
Once you have your program configured correctly so the hardware is running as expected things like the LCD will just start up and work.
Best way to get started is to create a one second flasher program.
This is a loop containing a output high to a pin, a second delay, an output low to the pin and another second delay.
There are then two settings to get your hardware to run at the right speed.
1) Clock speed setting in the Project Options window. Ensure this matches your crystal frequency.
2) Configuration settings in the Chip -> Configure menu.
Once you have your program configured correctly so the hardware is running as expected things like the LCD will just start up and work.
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: Strange LCD Problem
Hi Benj
Still to no avail...
These are my details and what i've tried...
PIC16F877A
20mhz Oscillator
LCD:
data 1 A2
data 2 A3
data 3 A4
data 4 A5
RS A0
Enable A1
My clock speed has been tried at 20000000 and 19660800
I'm running HS with everything else diabled and off in chip options
Oscillator at 20.0002
Tried:
Output: A0,1 - delay 1s - A0,0 - delay 1s - LCD start - LCD Clear - LCD Cursor -LCD Print Ascii "hello"
Output: C0,1 - delay 1s - C0,0 - delay 1s - LCD start - LCD Clear - LCD Cursor -LCD Print Ascii "hello"
Output: Cport,255 - delay 1s - Cport,0 - delay 1s - LCD start - LCD Clear - LCD Cursor -LCD Print Ascii "hello"
Output: Aport,255 - delay 1s - Aport,0 - delay 1s - LCD start - LCD Clear - LCD Cursor -LCD Print Ascii "hello"
Tried chip clock = XT (though it cant be that)
Power up timer on and off
I thought it might be my circuit, but then surely the LCD wouldnt come on with my other program?
Still to no avail...
These are my details and what i've tried...
PIC16F877A
20mhz Oscillator
LCD:
data 1 A2
data 2 A3
data 3 A4
data 4 A5
RS A0
Enable A1
My clock speed has been tried at 20000000 and 19660800
I'm running HS with everything else diabled and off in chip options
Oscillator at 20.0002
Tried:
Output: A0,1 - delay 1s - A0,0 - delay 1s - LCD start - LCD Clear - LCD Cursor -LCD Print Ascii "hello"
Output: C0,1 - delay 1s - C0,0 - delay 1s - LCD start - LCD Clear - LCD Cursor -LCD Print Ascii "hello"
Output: Cport,255 - delay 1s - Cport,0 - delay 1s - LCD start - LCD Clear - LCD Cursor -LCD Print Ascii "hello"
Output: Aport,255 - delay 1s - Aport,0 - delay 1s - LCD start - LCD Clear - LCD Cursor -LCD Print Ascii "hello"
Tried chip clock = XT (though it cant be that)
Power up timer on and off
I thought it might be my circuit, but then surely the LCD wouldnt come on with my other program?
- 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: Strange LCD Problem
Hello,
How did you get on with the 1 second flasher test? This should not involve the LCD.
Also pin RA4 requires a pull up resistor to allow it to source current. This could be why your display isn't working. A resistor of around 1 - 10K between +V and RA4 should work.
Might also be worth testing on Port B if your unsure.
When the 1 second flasher test is running on the hardware at 1 second intervals then your working LCD program should just look like this.
LCD start - LCD Print String "hello"
How did you get on with the 1 second flasher test? This should not involve the LCD.
Also pin RA4 requires a pull up resistor to allow it to source current. This could be why your display isn't working. A resistor of around 1 - 10K between +V and RA4 should work.
Might also be worth testing on Port B if your unsure.
When the 1 second flasher test is running on the hardware at 1 second intervals then your working LCD program should just look like this.
LCD start - LCD Print String "hello"
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: Strange LCD Problem
Hi Benj
The flasher test works perfectly...
I made a breadboard to test LCD on PortB and that works perfectly...
Must be the resistor missing... Never read that in the data sheet though?
Still confuses me though...
The LCD displays on PortA with no problems when I've got my entire program loaded, but does not when I delete half the program? Nothing else is changed...
The flasher test works perfectly...
I made a breadboard to test LCD on PortB and that works perfectly...
Must be the resistor missing... Never read that in the data sheet though?
Still confuses me though...
The LCD displays on PortA with no problems when I've got my entire program loaded, but does not when I delete half the program? Nothing else is changed...
- 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: Strange LCD Problem
Hello,
Hm that's odd. Maybe it's a single icon / combination of icons that is causing the issue. If you can narrow it down to what is causing the problem then I would be interested to find out.The LCD displays on PortA with no problems when I've got my entire program loaded, but does not when I delete half the program? Nothing else is changed...
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