LCD 16 characters inline: only first 8 work


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2006
    Location
    Germany: Coal Area
    Posts
    6

    Default LCD 16 characters inline: only first 8 work

    Hi You all!
    read this forum a couple of times and was very interested.

    I´m kinda novice but WANT to work with this great picbasic pro.

    So my simple problem ist this:

    my LCD Display 1x16 works only on the first 8 Characters. I guess I did anything wrong with my Defines.

    '
    ' DEFINITIONS
    DEFINE LCD_DREG PORTA
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTA
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EBIT 3
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2


    ' START OF MAIN PROGRAM
    TRISB.0= 0

    PAUSE 500 ' Wait 0.5 second to initialize LCD
    LCDOUT $FE,1 ' Clear LCD

    LCDOUT $FE,2 ' Home cursor
    LCDOUT "Hello World"


    END ' End of program

    It Shows only Hello Wor wich fills the first 8 characters.
    Got the book PICBASIC PROJECTS by Dogan Ibrahim and didn´t find the right Define command

    "BWAAAHAAAA........" and so on...
    Anybody like to give me the hint?

    thanks in advance, ey

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    you need to treat it as a 2X8 display.
    Code:
          LCDOUT $FE,1,"12345678",$FE,$C0,"ABCDEFGH"
    Spin: Goto Spin
    about now?

    pssst! read carefully the LCDOUT section of the manual.
    Last edited by mister_e; - 17th October 2006 at 23:15.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Aug 2006
    Location
    Iran
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Hi,
    please try this:

    ' Set LCD Data port
    DEFINE LCD_DREG PORTB
    ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_DBIT 4
    ' Set LCD Register Select port
    DEFINE LCD_RSREG PORTB
    ' Set LCD Register Select bit
    DEFINE LCD_RSBIT 1
    ' Set LCD Enable port
    DEFINE LCD_EREG PORTB
    ' Set LCD Enable bit
    DEFINE LCD_EBIT 0
    ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_BITS 4
    ' Set number of lines on LCD
    DEFINE LCD_LINES 1
    pause 100
    lcdout $fe,1,"Hello"
    end


    LCD Connection
    Pin1=Vss: connect to ground
    Pin2=Vdd: connect to Vcc=5V
    Pin3=Vo: connect to middle pin of the POT(20K) to control brightness
    Pin4=RS(register select): connect to micro pins that specify in the software(RB1)
    Pin5=RW(Read/Write): connect to ground because we want to only write
    Pin6=E(Enable): connect to micro pin that specify in the software(RB0)
    Pin7 to 10: No connection
    Pin 11 to 14: connect to RB4 to RB7
    Pin15: connect to Vcc with a resistor(100 or 200 ohm resistor is good)
    Pin16: connect to ground.
    pin 16 and pin 16 are for backlights

    the other two pins of pot should connect to VCC and ground and you should connect the MCLR with a 4.7K or 10K resistor to the VCC.

    in your program you define the 2*16 lcd but you should do this:
    DEFINE LCD_LINES 1
    Last edited by amindzo; - 18th October 2006 at 10:31.

  4. #4
    Join Date
    Oct 2006
    Location
    Germany: Coal Area
    Posts
    6


    Did you find this post helpful? Yes | No

    Wink LCD 10 Characters

    First things first:

    thanks for the help..I had the manual not in my vicinity.

    Now the LCD works...and I can scribble on my LCD impressing one of my kids, hihi!
    Will test your example Amindzo!

    Hasta la vista companeros!

  5. #5
    Join Date
    Oct 2006
    Location
    Germany: Coal Area
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Hi Amindzo,

    the change to "Lines 1" instead of Lines 2 doesent work,the LCD overwrites its own charaters.
    But man I´m glad it works !

    Next i´m into is the command "Pulsin" or "count"

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Those are nice, if you want my opinion, use PIC internal Timer in counter mode. Sure you're limited to use dedicated pin but it's much accurate.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  2. Only the first 8 characters.
    By timseven in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd September 2009, 01:43
  3. cant get my Lcd to work using Pic18f452
    By civicgundam in forum General
    Replies: 13
    Last Post: - 7th October 2007, 00:13
  4. How to work with LCD in a mode of 8 bits?
    By MCU Destroyer in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 1st July 2005, 21:10
  5. Can't get LCD to work with 16F88
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 10th September 2004, 11:05

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