LCD Troubles on 16F685


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    50

    Default LCD Troubles on 16F685

    I configured the code for a 16F628a and it worked fine.
    Now, I am trying to setup the same LCD for a 16F685.

    #CONFIG
    __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF
    #ENDCONFIG

    high PortC.0 'LED on Port to check to see if PIC boots

    DEFINE OSC 4

    define LCD_DREG PORTA ' Data on PORTA
    define LCD_DBIT 0 ' Data starts on PORTA.0
    DEFINE LCD_RSREG PORTA ' RS on PORTA
    DEFINE LCD_RSBIT 4 ' RS on A4
    DEFINE LCD_EREG PORTA ' E on PORTA
    DEFINE LCD_EBIT 5 ' E on A5
    DEFINE LCD_BITS 4 ' LCD 4 bit mode
    DEFINE LCD_LINES 2 ' 2 line LCD display
    Define LCD_COMMANDUS 2000 ' Command Delay (uS)
    Define LCD_DATAUS 50 ' Data Delay (uS)

    Pause 500 ' Wait for LCD to startup
    mainloop:
    LCDOut $fe, 1 ' Clear LCD screen
    LCDOut "Hello"
    toggle portc.0
    pause 1000
    GoTo mainloop
    End

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: LCD Troubles on 16F685

    I think that chip has ADC on PORTA. Turn ADC off.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2009
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: LCD Troubles on 16F685

    OK, how best to do that?

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: LCD Troubles on 16F685

    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jan 2009
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: LCD Troubles on 16F685

    Tried every bit of code to turn off ADC and CMC. Still the LCD just sits there and stares at me (!).

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: LCD Troubles on 16F685

    I just looked at the datasheet and RA3 is the MCLR pin. You need to move things around so RA3 is not used as an output.
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts