4 x 20 LCD display with PB3 - Pin 5 High or Low?


Results 1 to 9 of 9

Threaded View

  1. #5
    Join Date
    Oct 2011
    Location
    East Coast USA
    Posts
    16


    Did you find this post helpful? Yes | No

    Default Re: 4 x 20 LCD display with PB3 - Pin 5 High or Low?

    leThanks for all the help, but I'm still stuck. I wired the LCD as shown on page 172 of the PB3 manual.

    After giving up with my code, I tried the example supplied with the compiler. The display still remains blank. I've adjusted the contrast, I proved that the display works by connecting it to a Midibox 8-bit core. I've tried RT(AT)FM (AT=All The) many times and the display remains as blank as my feeble brain.

    Here's the last code I compiled and burned. I've turned off the watchdog timer, set the oscillator to INTOSCIO. The 887 manual says the internal oscillator defaults to 4MHz, but the example assumes an 4MHz external crystal, so that should work, shouldn't it?

    The only differences I can see are 1) that Page 172 shows r/w on the LCD tied low, and the example seems to indicate that the R/W line is tied to port E.2 and is set low in the program. 2) I'm using the internal oscillator, 3) I'm using a 4x20 display rather than a 4-line display, but ignoring the extra two lines for now. 4) I'm using a breadboard, not the Lab-X1 board.

    I don't know what else to try.

    Help!


    The code:
    -------------------------------------------------------------
    ' Name : LCDX.pbp
    ' Compiler : PICBASIC PRO Compiler 3.0.6.4
    ' Assembler : PM or MPASM
    ' Target PIC : 40-pin 16F887
    ' Hardware : LAB-X1 Experimenter Board
    ' Oscillator : 4MHz external crystal
    ' Keywords : LCDOUT
    ' Description : PICBASIC PRO program to display "Hello World" on
    ' LAB-X1 LCD.
    '

    ' Define LCD registers and bits
    Define LCD_DREG PORTD
    Define LCD_DBIT 8
    Define LCD_RSREG PORTE
    Define LCD_RSBIT 0
    Define LCD_EREG PORTE
    Define LCD_EBIT 1

    ANSEL = %00000000 ' Make AN0-AN7 digital
    ANSELH= %00000000 ' Make AN8-AN13 digital
    Low PORTE.2 ' LCD R/W line low (W)
    Pause 100 ' Wait for LCD to start up

    mainloop:
    Lcdout $fe, 1 ' Clear screen
    Pause 500 ' Wait .5 second

    Lcdout "Hello" ' Display "Hello"
    Pause 500 ' Wait .5 second

    Lcdout $fe, $c0, "World" ' Move to line 2 and display "World"
    Pause 500 ' Wait .5 second
    Goto mainloop ' Do it forever

    End
    Last edited by xpa999; - 29th March 2014 at 18:23. Reason: left out info

Similar Threads

  1. 4x40 LCD Display Enable Pin
    By rsocor01 in forum General
    Replies: 2
    Last Post: - 10th August 2011, 02:50
  2. Use of HIGH and LOW for pin outputs
    By rnuke77 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th January 2011, 18:40
  3. Replies: 5
    Last Post: - 14th May 2010, 03:21
  4. Reading if Pin is High or Low?
    By Spindle in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 1st August 2005, 17:39
  5. Replies: 0
    Last Post: - 25th May 2005, 10:35

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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