16F84A and Optrex LCD


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Las Vegas, Nevada, USA
    Posts
    27

    Default 16F84A and Optrex LCD

    I found similar problems here with an Optrex but not an Optrex with a 16F84A. I don't have the experience to transfer the advice to my PIC (believe me I tried many times). I cannot get the LCD to display text. It only displays solid lines on line 1 and 3 or all 4 lines. Here is my set-up and code. Any comments are welcome and thanks in advance.

    'LCD connections (Optrex DMC-20481NY-LY-AGE), to 16F84A pins, to power
    'Vdd, Pin 14, +5V
    'Vss, Pin 5, Gnd
    'Ve (VO), +5V
    'RS, Pin 3 (RA4), 5k pull-up Resistor to +5V
    'RW, None, Gnd
    'E, Pin 9 (RB3)
    'DB0 to DB3, No connections
    'DB4, Pin 17 (RA0)
    'DB5, Pin 18 (RA1)
    'DB6, Pin 1 (RA2)
    'DB7, Pin 2 (RA3)
    'LED Anode, switched to +5V
    'LED Cathode, Gnd

    'Additional 16F84A connections
    'Pin 4 (MCLR), 10k Resistor to +5V
    'Pins 15 and 16, 4 MHz with 22pf, Gnd

    'Code
    DEFINE LCD_BITS 4 ' Set 4-bit data bus width
    DEFINE LCD_LINES 4 ' LCD is a 4 line display
    DEFINE LCD_DREG PORTA ' LCD RA to LCD data port
    DEFINE LCD_DBIT 0 ' Starting data bit on A0 & last on A3
    DEFINE LCD_RSREG PORTA ' Set LCD register select port to A
    DEFINE LCD_RSBIT 4 ' Set A4 to register select pin
    DEFINE LCD_EREG PORTB ' Set LCD enable to port B
    DEFINE LCD_EBIT 3 ' Set B3 to LCD enable pin
    DEFINE OSC 4
    DEFINE LCD_COMMANDUS 2000 ' Set LCD command delay time in uS
    DEFINE LCD_DATAUS 50 ' Set LCD data delay time in uS
    Pause 2000
    Start:
    LCDOUT 254, 1 ' Clear screen
    Pause 1000
    LCDOUT " Hello"
    LCDOUT 254, 192, " World"
    LCDOUT 254, 148, " Isn't"
    LCDOUT 254, 212, " Displaying"
    Pause 1000
    Goto Start
    End

  2. #2
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default try this

    define lcd_bits 4
    define lcd_lines 4
    PAUSE 500
    start:
    lcdout $FE,$80,"LINE 1 "
    lcdout $FE,$C0,"LINE 2 "
    lcdout $FE,$94,"LINE 3 "
    lcdout $FE,$D4,"LINE 4 "
    pause 1000
    goto start:

    The only thing I dont see is a varable resistor for contrast adjustment on V0.
    You have it tied to +5v, the voltage may be to high that is why you are only seeing squares insted of text.

    Hope it helps Sphere...

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink Datasheet ?

    Hi, coyote

    May be you have it, ... but if not :

    http://pdf.alldatasheet.com/datashee...NY-LY-AGE.html

    Note also Vee must be set BETWEEN +5v and GND ... with a pot !!!

    Alain
    Last edited by Acetronics2; - 16th October 2005 at 10:08.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Oct 2005
    Location
    Las Vegas, Nevada, USA
    Posts
    27


    Did you find this post helpful? Yes | No

    Default

    I needed the pot between Vee and Gnd. It measures at 455R. I was using a 10K pot according to the schematic set at 5K, but never turned it down to such a low value before thinking I must have something wrong. Another thread had a working Optrex with Vee at 5+. Duh . . .

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