1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

XLCD with PIC18f452

Discussion in 'Microcontrollers' started by afnan.bashir, Apr 23, 2013.

  1. Quintino

    Quintino New Member

    Joined:
    May 1, 2014
    Messages:
    4
    Likes:
    0
    Well, the problem is that I can only write on the first line. The second line is missing.
    Even when I change the contrast to maximum, only the first row shows black rectangles, the second line is missing.
    Initially I thought the problem should be the display but it works fine with an Arduino Uno, and I also tried other display and no luck.
    Any ideas what could be the problem?
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,169
    Likes:
    910
    Location:
    Rochdale UK
    ONLINE
    The problem is with this line

    OpenXLCD(FOUR_BIT & LINES_5X7);

    The defines are not correct, and you cannot include the cursor defines... You are using no function set as the parameters equate to 0x08... which isn't correct....
     
  3. rsatchel

    rsatchel New Member

    Joined:
    Jul 3, 2013
    Messages:
    5
    Likes:
    0
    Location:
    USA
    Hi,
    I don't mean to hijack this thread...
    I used this thread to get Oshonsoft PIC18 simulator to run the code posted and it worked well, thank you!

    How do I send data (eg. output of analog pin ADC conversion 0-1023) to the LCD to be displayed?
    I can display strings, but not other data types (eg. unsigned int)

    I have tried using itoa(), snprintf() with no luck. I can't seem to find the function prototypes in order to figure out what arguments I need to provide them.
     
    Last edited: May 8, 2014
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,169
    Likes:
    910
    Location:
    Rochdale UK
    ONLINE

    You just did!!! The code on here was in C, not basic!!! did you convert it? Oshonsoft has the ability to print values to the LCD screen..

    If you are using C however! Look into the sprintf() function...
     

Share This Page