4-line LCD Help - using PortA instead of B


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125

    Question 4-line LCD Help - using PortA instead of B

    I have a 4-line LCD with 16 pins, the pin-outs seem to match use of the LCDOUT command.

    I am using PortB, tho, and have to use PortA.. (0-3 for data lines, and 4,5 for the other two).. I have it setup as follows:

    Define LCD_DREG PORTA
    DEFINE LCD_DBIT 0
    Define LCD_RSREG PORTA
    Define LCD_RSBIT 4
    Define LCD_EREG PORTA
    Define LCD_EBIT 5
    Define LCD_BITS 4
    Define LCD_lines 4
    Define LCD_Commandus 2000
    Define LCD_Dataus 50

    However, when I write out using $fe, LCDOUT, - I get nothing.... Any thoughts?

    Thanks,
    Tom

  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Tom,

    see: here

    Let us know what brand and model of display you are using.

    If it is more than 20 chars per line it is a dual controller display.

    It could also be one of the "extended temperature range" models that require a negative voltage on Vee.

    What does your hardware setup look like in detail?

    You don't want us to guess, do you?
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  3. #3
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Exclamation Details about Crystalfontz 20x4

    Sorry!! ;-o

    The details - of course!

    Crystalfontz 20x4 display - CFAH2004L-YYB-JP. 16 pins LED backlight

    1 VSS 0V Ground - Vss
    2 VDD 5.0V Supply Voltage for logic -> 5v
    3 VO (Variable) Operating voltage for LCD -> I have this pinned to 5V
    4 RS H/L H: DATA, L: Instruction code -> to RA4
    5 R/W H/L H: Read(MPU→Module) L: Write(MPU→Module) -> to Vss
    6 E H,H→L Chip enable signal -> to RA5
    7 DB0 H/L Data bit 0 - NA
    8 DB1 H/L Data bit 1 - NA
    9 DB2 H/L Data bit 2 - NA
    10 DB3 H/L Data bit 3 - NA
    11 DB4 H/L Data bit 4 -> RA0
    12 DB5 H/L Data bit 5 -> RA1
    13 DB6 H/L Data bit 6 -> RA2
    14 DB7 H/L Data bit 7 -> RA3
    15 A - LED +
    16 K - LED -
    17 Vee
    18 NC

    I have this hooked to PORTA instead of PORTB because I am using some on PortB, but per earlier post, it seems everything is in place. I just get no data appearing on the screen.

    Maybe I have to turn off some register of PortA on the 16F876/A that I don't know about..

    --------------------------------------------------------------------------
    ' 16F876/A

    Include "modedefs.bas" ' Include serial modes

    ADCON1 = 7

    define LCD_DREG PORTA ' Set data pin of LCD to
    define LCD_DBIT 0 ' PORTB.0-PORTB.3

    define LCD_RSREG PORTA ' Set RS bit of LCD to
    define LCD_RSBIT 4 ' PORTA.4

    define LCD_EREG PORTA ' Set E bit of LCD to
    define LCD_EBIT 5 ' PORTA.5

    DEFINE LCD_LINES 4 ' 4 Lines LCD
    define LCD_COMMANDUS 2000 ' Command delay time in uSec
    DEFINE LCD_DATAUS 100 ' Data delay time in uSec


    lcdout $fe, 1
    lcdout $fe, 2
    LCDOUT "Hellow World"
    pause 2000

    I have seen others with this unit get success with PBP.. just not me yet..

    TG

  4. #4
    anj's Avatar
    anj Guest


    Did you find this post helpful? Yes | No

    Default

    You didnt mention it soooo, Do you have a pullup resistor on RA4?
    Read PICmicro MCU specific Issues in the manual ( sect 2.5.1 )

    Andrew

  5. #5
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default

    Yes, 4.7k ohm on R4..

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


    Did you find this post helpful? Yes | No

    Default

    i didn't have any of those LCDs in stock but, can you place a trim pot on Vo pin. or just tie it to ground to see if you get at least some black square on???

    Some LCD may need to place unused data pin to ground. Refer to your datasheet for that.

    try removing thos DATAUS COMMANDUS defines
    try a 2 secondes startup delay
    Steve

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

Similar Threads

  1. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  2. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 14:19
  3. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  4. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22
  5. 4 line LCD with 16F88
    By anj in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th February 2004, 09:06

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