Problem with new LCD.h (date 25/4/14)

  • Dimitris Katsaounis

    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

    #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

    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

    locate 0,2 :Print "Ydroponics"
    locate 1,3 :Print "Controler"
    wait 5 s

    goto start

  • Anobium

    Anobium - 2014-04-26

    An error somewhere , clearly.

    please post as a zip both lcd.h files.

  • Anobium

    Anobium - 2014-04-27

    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.


    Last edit: Anobium 2014-04-27
    • Anobium

      Anobium - 2014-04-27

      I had an PIC18F27J53.... I cannot program, so, I cannot test for you.

      Last edit: Anobium 2014-04-27
      • Dimitris Katsaounis

        Last edit: Dimitris Katsaounis 2014-04-27
      • Dimitris Katsaounis

        Last edit: Dimitris Katsaounis 2014-04-27
      • Dimitris Katsaounis

        Same problem on 18F2550 (real world) but no problem on 16F877A in PicsimLab Board 3

  • Dimitris Katsaounis

    Νο. What change should I do?

  • Anobium

    Anobium - 2014-04-27

    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.

  • Dimitris Katsaounis

    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

  • Anobium

    Anobium - 2014-04-27

    Good approach. The changes to the files where:

    1. Changes to the 4 bit initialisation routine to improve stability.
    2. 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.

  • Dimitris Katsaounis

    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

  • Anobium

    Anobium - 2014-04-28

    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
  • Dimitris Katsaounis

    My final file


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks