Menu

16F628A & LCD

Help
2008-02-16
2013-05-30
  • Nobody/Anonymous

    I want to print to an LCD with a 16F628A using the internal oscillator and 4 bit mode due to the limited pins.

    I believe the 2 lines following th #config disable to comparators. All I get is 1 line of black squares on the 2 line LCD. I have it working on a 16F877A, so I know the LCD works. Adjusting the contrast only gives me lighter squares on line 1.

    Am I missing disabling something else on the pins that I want to use for the LCD?

    'Hardware settings
    #chip 16F628A, 4
    #config MCLRE_OFF, INTOSC_OSC_NOCLKOUT
    MOVLW 0x07
    MOVWF CMCON

    'LCD connection settings
    #define LCD_IO 4
    #define LCD_DB4 PORTB.4
    #define LCD_DB5 PORTB.5
    #define LCD_DB6 PORTB.6
    #define LCD_DB7 PORTB.7
    #define LCD_RS PORTB.0
    #define LCD_RW PORTB.1
    #define LCD_Enable PORTB.2

    'Show opening message
    PRINT "Line 1"
    locate 1,0
    PRINT "Line 2"

    Thanks,

    ...Dave

     
    • Nobody/Anonymous

      Seems I had a band ground connection. It is working now.

       

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.