Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?


Closed Thread
Results 1 to 37 of 37

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Code:
         ' LCD DEFINES FOR USING 2x16 LCD with PortA in EASYPIC6
               DEFINE LCD_DREG PORTA    ' Use PORTA for LCD Data
               DEFINE LCD_DBIT 0        ' Use lower(4) 4 bits of PORTA
                                          ' PORTA.0 thru PORTA.3 connect to
                                          ' LCD DB4 thru LCD DB-7 respectively
               DEFINE LCD_RSREG PORTA   ' PORTA for RegisterSelect (RS) bit
               DEFINE LCD_RSBIT 4       ' PORTA.4 pin for LCD's RS line
               DEFINE LCD_RWREG PORTC   ' LCD read/write port
               DEFINE LCD_RWBIT 2       ' LCD read/write bit
               DEFINE LCD_EREG PORTA    ' PORTA for Enable (E) bit
               DEFINE LCD_EBIT 5        ' PORTA.5 pin for LCD's E line
    Are you doing something different?

    The EASYPIC6 schematic says the LCD is on PORTB.
    <br>
    DT

  2. #2
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default LCD interface is PortA and DEFINES the same for both LCDs.

    Quote Originally Posted by Darrel Taylor View Post
    Are you doing something different?

    The EASYPIC6 schematic says the LCD is on PORTB.
    <br>
    Yes, Darrel, I have the LCD hooked up to PortA in my development setup on the EasyPic6 via a Port expander with a ProtoBoard.
    I also have the prototype PCB board laid out so that the LCD is connected to PortA in the same way as I have it working on the EasyPic. So my LCD DEFINES are correct (at least for the WINSTAR) and work on the EasyPic configuration with the WINSTAR LCD, but they don't on the prototype PCB with the NEWHAVEN display. Hope this makes it more clear.
    NEWHAVEN tech support told me that as long as I saw the character dot matrix blocks on Line 1 of the display whenever it is powered up but with contrast to a minimum, it means the module is alive. That is my situation, but still can't get characters to display. I have sent this posting to NEWHAVEN to see if they can tell me why my PBP initialization isn't working, but doubt they will since their examples for their module are all in C.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jellis00 View Post
    Yes, Darrel, I have the LCD hooked up to PortA in my development setup on the EasyPic6 via a Port expander with a ProtoBoard.
    Another silly question ...

    Do you have a pull-up resistor on RA4?
    <br>
    DT

  4. #4
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default No pull-up resistor

    Quote Originally Posted by Darrel Taylor View Post
    Another silly question ...

    Do you have a pull-up resistor on RA4?
    <br>
    RA4 is connected in both my EasyPic6 development configuration and in my PCB prototype to the RS pin of the LCD. No Pull-up resistor is used in either case, and why do you ask?....from LCD data sheet the Register-Select is either 0 for command or 1 for data and therefore I didn't think it should have a pull-up resistor but should float free....am I wrong?

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    On many chips, RA4 is Open-Collector and won't drive the pin high on it's own.

    I'm assuming you're still using an 18F4550.

    The datasheet doesn't specify, but in ISIS with an 18F4550, the LCD won't initialize without a pull-up.

    It could just be a simulator thing.

    Try it.
    Stick a pull-up in there.
    <br>
    DT

  6. #6
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Pull-up didn't help

    Quote Originally Posted by Darrel Taylor View Post
    On many chips, RA4 is Open-Collector and won't drive the pin high on it's own.

    I'm assuming you're still using an 18F4550.

    The datasheet doesn't specify, but in ISIS with an 18F4550, the LCD won't initialize without a pull-up.

    It could just be a simulator thing.

    Try it.
    Stick a pull-up in there.
    <br>
    Tried a 10K pull-iup on RA4 and still no characters appearing on LCD. Going to hook up oscilloscope next to the various LCD interfaces to see if I can figure out what is going on.

    I don't know what ISIS is or what you mean by it could be just a simulator thing. Is ISIS a simulator?

    For your info I asked Microchip tech support about whether RA4 on 18F2550/4550 is open-collector or not and whether there should be any problem of it driving RA4 high with an LCD interface and here is their response:
    ----
    Hi,
    Thank you for contacting Microchip Technical Support.
    RA4 can drive the pin High, please configure all the Port pin of PortA to digital by setting the bit in PCFG0-PCFG3 in ADCON1 Register.
    For further assistance, do write to us with the following details.
    1) Please attach your code along with MPLAB IDE workspace.(MCP and MCW files)
    2) C18 -Version?
    3) MPLAB version?
    4) Screen shot of the disassembly listing in the view tab.
    Awaiting for your reply
    Thanks & Regards,
    Microchip Technical Support

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Also could be as simple as a contrast voltage issue (Vo). Do you have a pot on the Vo pin?

    Also noticed pin 15 and 16 of the New Haven display are listed as NC in the data sheet, but the example schematic shows them as A+ and K- and shows then both grounded. So maybe you need some clarification from New Haven on how to connect up the display.
    Tim Barr

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