Menu

LCD problem with HSerReceive

Jvan
2015-01-12
2015-01-17
  • Jvan

    Jvan - 2015-01-12

    chip PIC16f1847 at 8 MZ
    Program receives input from 433Mz transmitter.
    When received data is displayed via rs232 to PC using PUTTY everything is OK.
    When received data is displayed on LCD data seems to have extra 1 bit at db6.
    Example; what should be 6 displays as v and what should be 5 displays as u.
    Also locate does not put character on correct line or column.
    Checked LCD with same program without any serial code and it works ok.

    I am a newb but all my projects have worked up till now.

     
  • Anobium

    Anobium - 2015-01-13

    Welcome.

    1) Please try adding this to your code and test. This emulates the LCD command set on your Putty terminal. If all is good, then revert your code by remove these methods, then proceed to step two then three. Let us know the results.

     #define locate ANSI_rev
     #define CLS ANSIERASECREEN
     #define print hserprint
    
    ' Position cursor on Terminal
    Sub ANSI ( IN xpos, IN ypos )
        HSerSend 27
        HSerPrint "["
        HSerPrint ypos
        HSerSend 59
        HSerPrint xpos
        HSerPrint "H"
    End Sub
    
    ' Position cursor on Terminal
    Sub ANSI_rev ( IN ypos, IN xpos )
        ypos++
        HSerSend 27
        HSerPrint "["
        HSerPrint ypos
        HSerSend 59
        HSerPrint xpos
        HSerPrint "H"
    End Sub
    
    
    ' Eraase Terminal
    Sub ANSIERASECREEN
        HSerSend 27
        HSerPrint "["
        HSerPrint "2"
        HSerPrint "J"
        Ansi ( 0, 0 )
    
        HSerSend 27
        HSerPrint "["
        HSerPrint "?"
        HSerPrint "25"
        HSerPrint "l"
    
    
    
    end Sub
    ~~~~
    
    2)  Add or change the following parameters, but, LCD_SPEED SLOW is the default if nothing is specified.
    

    LCD_SPEED FAST
    LCD_SPEED MEDIUM
    LCD_SPEED SLOW
    ~~~

    3) Use the LAT configuration for the LCD screen See the bottom of this page: http://gcbasic.sourceforge.net/help/relevantconstantslcd.htm

     
    • Jvan

      Jvan - 2015-01-13

      Hi

      New to posting on forum. Not sure how to Reply. Hope this works.

      Ran Code suggested. Got Garbage on PUTTY screen.

      Will try LCD_SPEED and LAT next.

       
      • Jvan

        Jvan - 2015-01-13

        OK; Tried LAT and SPEED Slow and Fast. Same problem. I'm beginning to wonder if the problem may be that serial in is being used without a serial out. Serial out not needed because the data is input from the serial receiver(wireless) and the only output I need is the data that is received to display on the LCD.

        Any thoughts ?

        P.S. I really appreciate GCBASIC and the forums. Thanks to all involved.

         
  • Jvan

    Jvan - 2015-01-14

    Problem Solved
    Turns out that serout port needs to be declared and on a viable TX pin even though this port is not used for output.

     
  • Anobium

    Anobium - 2015-01-15

    May I ask you to post your code please. I am puzzled... in a good way. 😃

     
  • Jvan

    Jvan - 2015-01-15

    Here is the code.

     
  • Anobium

    Anobium - 2015-01-17

    If it works then great. :-)

     

Log in to post a comment.