Problem with 16F886 and LCD on PortC


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2013
    Posts
    4

    Default Problem with 16F886 and LCD on PortC

    Hi, I write a program to test LCD and I see on first line black squares.
    What's wrong ?
    The LCD is OK, i have test with 16F690 on PortC and work.
    This is my code:
    @ __config _CONFIG1,_WDT_OFF & _MCLRE_OFF & _LVP_OFF & _CP_OFF
    @ __config _CONFIG2, _WRT_OFF


    DEFINE OSC 4
    ANSEL=0 'toate porturile sunt digitale
    ANSELH=0

    ;******** legaturi display 2x16 caractere *******
    DEFINE LCD_DREG PORTC ;PortC folosit pentru date
    DEFINE LCD_DBIT 0 ;pinul 0 este primul pin de date conectat
    DEFINE LCD_RSREG PORTC ;portC folosit pt. pinul RS
    DEFINE LCD_RSBIT 5 ;Register select pin
    DEFINE LCD_EREG PORTC ;foloseste PortC pentru pinul E
    DEFINE LCD_EBIT 4 ;Enable pin
    DEFINE LCD_BITS 4 ;bus pe 4 biti
    DEFINE LCD_LINES 2 ;LCD cu doua randuri de caractere

    Pause 500
    Bucla:

    Lcdout $FE,1 ;clear display

    Lcdout $FE,2 ;return home

    Lcdout "TEST TEST"
    pause 3000
    goto Bucla

    end

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Problem with 16F886 and LCD on PortC

    Have you searched the forum for similar problem?

    Look at this from similar chip:
    http://melabs.com/samples/LABX1-16F887/lcdx.htm

    Came from: http://www.picbasic.co.uk/forum/show...87+lcd+digital

    Robert

  3. #3
    Join Date
    Sep 2013
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Problem with 16F886 and LCD on PortC

    I try these and... nothing. The program run (I put a LED who blink). Any advise, please ?

  4. #4
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Problem with 16F886 and LCD on PortC

    Is it possible that the CONTRAST on the LCD is set too high?
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  5. #5
    Join Date
    Sep 2013
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Problem with 16F886 and LCD on PortC

    Solved. DB4 from LCD not conected Thanks.

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: Problem with 16F886 and LCD on PortC

    What about analog, pwm or some pther feature enabled on selected ports?

    Robert

  7. #7
    Join Date
    Sep 2013
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Problem with 16F886 and LCD on PortC

    Quote Originally Posted by Demon View Post
    What about analog, pwm or some pther feature enabled on selected ports?

    Robert
    I use this
    ANSEL=0 ;porturile A si B sunt digitale
    ANSELH=0
    ADCON0.0=0
    SSPCON.5=0 ;dezactiveaza portC serial
    RCSTA.7=0

Similar Threads

  1. Problem proramming PIC 16F886 with PICKIT2?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 11th January 2012, 23:23
  2. Problem with porta for 16F886(PIC 28X1)
    By Anghel Cosmin in forum Off Topic
    Replies: 2
    Last Post: - 26th February 2009, 13:07
  3. 18f4550 portc.4 and portc.5 problem
    By pcaccia in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th October 2008, 20:52
  4. 16f886 interrupt on portB problem
    By antonjan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th October 2008, 20:06
  5. LCD problem on portC
    By BobSpencerr in forum mel PIC BASIC
    Replies: 5
    Last Post: - 28th February 2007, 05:14

Members who have read this thread : 1

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