Menu

LCD 4 bit mode help me

Help
2010-04-09
2013-05-30
  • Paulo Marcio Silva

    Hi,
    I can't get the lcd working. I'm trying to run in 4 bit mode.
    here's the code:

    #chip 16F688, 4
    #config WDT=off
    #config MCLR=off
    #config osc = INTRC_OSC_NOCLKOUT

    #define LCD_IO 4
    #define LCD_Enable PORTC.4
    #define LCD_RS PORTC.3
    #define LCD_DB4 PORTC.5
    #define LCD_DB5 PORTA.3
    #define LCD_DB6 PORTA.4
    #define LCD_DB7 PORTA.5
    #define LCD_RW PORTC.2

    main:
      CLS
      PRINT "Hello"
      LOCATE 1, 5
      PRINT "World"
      cls
    goto main

    Can anybody help me? I checked my wire connections plenty times. Is it a bug?

     
  • Nobody/Anonymous

    my LCD is a JHD162A is it compatible with gcb?

     
  • kent_twt4

    kent_twt4 - 2010-04-10

    The JHD162A should work.  Unfortunately the MCLR (PortA.3) has been assigned as a data pin.  PortA.3 is an input only pin, so pick another one.

     
  • Nobody/Anonymous

    Does tying the R/W pin to ground affect the performance of the LCD? Will it interfere with any initialization of the screen?

     
  • kent_twt4

    kent_twt4 - 2010-04-11

    Yes it would affect performance.  If the code is dependent on every last ms (10's of ms?), then go with the R/W;  Else, I doubt if anyone would really notice.  Haven't heard of any initialization problems with the #define LCD_NO_RW.

     
  • Paulo Marcio Silva

    Tanks kent_twt4, the problem is probably this!!!!
    When I was testing the pic I remember that this port only had 5V. Tomorrow I'll test it. I'll try to put (MCLR)! ON to see if works. If not I'll just change the ports as you said!
    Thanks again!
    Regards from Brazil

     
  • gcha44

    gcha44 - 2010-05-05

    Hi,

    I was interested by this post because a few time ago , I encountered the same problem

    I don't know if you have solved your problem  but I  think like Kent_Wt4 that it's  better to work with LCD_NO_RW after you have grounded R/W pin.

    Moreover , your program seems also to have a mistake :

    Indeed , after
    <Print "World">
    you write
    <CLS>
    So , you cannot display "Hello World" , because you erase it immediately .
    Instead of CLS ,you must write
    <Wait 1 s>
    before
    <Goto main>
    to gives it at least 1s to be displayed
    before to be erased and immediately displayed .
    To blink the message every one second , you can also write
    <Wait 1 s>
    before
    <Print "Hello">

    Regards from France
    Gérard C

     
  • Paulo Marcio Silva

    Tanks for the tip!
    My program is running  well now.
    I could do everything using GCow. It was good because I didn't want to waste my time to make routines in C or in ASM to write in the LCD.

     
  • gcha44

    gcha44 - 2010-05-06

    Yes , GCBASIC is a very good software . It's very easy to use and programs can be writed in a few minutes.
    But we must be carefull because it's often in the simplest programs we  find the most silly mistakes . Lol !
    Have a nice day .

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.