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.
#chip 18F2550, 8
#config FOSC_INTOSC_HS, WDT=OFF, LVP=OFF, MCLRE=OFF, BOR=OFF
#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
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
locate 0,2 :Print "Ydroponics"
locate 1,3 :Print "Controler"
wait 5 s
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.
From: Dimitris Katsaounis [mailto:firstname.lastname@example.org]
Sent: 26 April 2014 23:33
Subject: [gcbasic:discussion] Problem with new LCD.h (date 25/4/14)
Attachment: lcd.zip (8.3 kB; application/x-zip-compressed)
Problem with new LCD.h (date 25/4/14)
Sent from sourceforge.net because you indicated interest in
To unsubscribe from further messages, please visit
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.
I had an PIC18F27J53.... I cannot program, so, I cannot test for you.
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.
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.
My final file
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.