I am trying to print in 16x2 LCD display and the program only prints the first row (with bright backlight) and not the second row.
I tried to do the same thing with the old LCD.h (date 24/12/13) and everything printed just fine.
My Code:
'Variables
Dim Sec As byte
Dim Min As byte
Dim Hour As byte
Dim DayOfWeak as byte
Dim CDate as byte
Dim CMonth as byte
Dim CYear as Byte
Dim text as string *16
I do not think it is the LAT code. As you would get nothing displayed if
that we messed up.
We now have scripts to optimise the code and I think a timing was removed.
Please test and let me know the results.
Anobium
From: Dimitris Katsaounis [mailto:katsjim@users.sf.net]
Sent: 26 April 2014 23:33
To: [gcbasic:discussion]
Subject: [gcbasic:discussion] Problem with new LCD.h (date 25/4/14)
I do not think it is the LAT code. As you would get nothing displayed if that we messed up. I had no errors on the simulator or on a real 1f6877a setup. Most odd.
We now have scripts to optimise the code and I think a timing was removed.
All my Lcd is the standard 16x2 HD44780 Character LCD. It works just fine with the old LCD.h in my 18F2550 projects. I Keep the old LCD.h and i try to change (especially in Locate command) the new LCD.h (27-4-14). Thanks for your help Anobium
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Changes to the 4 bit initialisation routine to improve stability.
Changes to support LATx.
I would revert the initialisation routine first. Does this resolve the issue? There is a parameter to set the number of lines in the LCD. I wonder if this is set incorrectly.
Try please.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Problem solved. I replaced in InitLCD subroutine :
1) set LCD_DB4 ON in line 573 of LCD.h 27-4-14 with set LCD_DB4 OFF
2) line 577 to line 629 of LCD.h 27-4-14 with line 487 to line 492 of old LCD.h (I sent it in zip file)
Thanks again. You have given great impetus to our beloved language
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to print in 16x2 LCD display and the program only prints the first row (with bright backlight) and not the second row.
I tried to do the same thing with the old LCD.h (date 24/12/13) and everything printed just fine.
My Code:
'Chip Settings
#chip 18F2550, 8
#config FOSC_INTOSC_HS, WDT=OFF, LVP=OFF, MCLRE=OFF, BOR=OFF
'Includes
#include "GreekChar.h"
#include "DS1307.h"
'Defines (Constants)
#define LCD_NO_RW
#define LCD_IO 4
#define LCD_RS PORTB.5
#define LCD_Enable PORTB.4
#define LCD_DB4 PORTB.3
#define LCD_DB5 PORTB.2
#define LCD_DB6 PORTB.1
#define LCD_DB7 PORTB.0
'Variables
Dim Sec As byte
Dim Min As byte
Dim Hour As byte
Dim DayOfWeak as byte
Dim CDate as byte
Dim CMonth as byte
Dim CYear as Byte
Dim text as string *16
'Welcome Screen
Cls
locate 0,2 :Print "Ydroponics"
locate 1,3 :Print "Controler"
wait 5 s
start:
......
goto start
An error somewhere , clearly.
please post as a zip both lcd.h files.
the problem is probably in LATx ?
Please try the attached file.
I do not think it is the LAT code. As you would get nothing displayed if
that we messed up.
We now have scripts to optimise the code and I think a timing was removed.
Please test and let me know the results.
Anobium
From: Dimitris Katsaounis [mailto:katsjim@users.sf.net]
Sent: 26 April 2014 23:33
To: [gcbasic:discussion]
Subject: [gcbasic:discussion] Problem with new LCD.h (date 25/4/14)
the problem is probably in LATx ?
Attachment: lcd.zip (8.3 kB; application/x-zip-compressed)
Problem with new LCD.h (date 25/4/14)
https://sourceforge.net/p/gcbasic/discussion/596084/thread/47bf9dd6/?limit= 25#1bd2
Sent from sourceforge.net because you indicated interest in
https://sourceforge.net/p/gcbasic/discussion/596084/
To unsubscribe from further messages, please visit
https://sourceforge.net/auth/subscriptions/
Please try the attached file.
I do not think it is the LAT code. As you would get nothing displayed if that we messed up. I had no errors on the simulator or on a real 1f6877a setup. Most odd.
We now have scripts to optimise the code and I think a timing was removed.
Please test and let me know the results.
Anobium
Last edit: Anobium 2014-04-27
I had an PIC18F27J53.... I cannot program, so, I cannot test for you.
Last edit: Anobium 2014-04-27
Last edit: Dimitris Katsaounis 2014-04-27
Last edit: Dimitris Katsaounis 2014-04-27
Same problem on 18F2550 (real world) but no problem on 16F877A in PicsimLab Board 3
Did you try the changes in the https://sourceforge.net/p/gcbasic/discussion/596084/thread/47bf9dd6/d13c/attachment/lcd_27_4_14.h file I posted? Any change?
Νο. What change should I do?
Please, post the specification and the datasheet of the LCD.
It may be different - one of devices I have is very different. The standard 'locate' command may not. Let us have a look at the datasheet.
All my Lcd is the standard 16x2 HD44780 Character LCD. It works just fine with the old LCD.h in my 18F2550 projects. I Keep the old LCD.h and i try to change (especially in Locate command) the new LCD.h (27-4-14). Thanks for your help Anobium
Good approach. The changes to the files where:
I would revert the initialisation routine first. Does this resolve the issue? There is a parameter to set the number of lines in the LCD. I wonder if this is set incorrectly.
Try please.
Problem solved. I replaced in InitLCD subroutine :
1) set LCD_DB4 ON in line 573 of LCD.h 27-4-14 with set LCD_DB4 OFF
2) line 577 to line 629 of LCD.h 27-4-14 with line 487 to line 492 of old LCD.h (I sent it in zip file)
Thanks again. You have given great impetus to our beloved language
Thank you and well done.
Can you please upload your final file. I will try and understand why on some devices this works but on your device.... not. Oh joy.
Last edit: Anobium 2014-04-28
My final file