how to connect 2 LCDs on a PIC


Closed Thread
Results 1 to 9 of 9
  1. #1
    f1fco's Avatar
    f1fco Guest

    Default how to connect 2 LCDs on a PIC

    hello
    I am a french ham radio
    it is my first connection to this forum
    and my english is very poor...

    I am using PBP 2.4.2 and several pics (16F628, 876, 877 and alson 18F252 and 452...) and bootloader from Mecanique.co.uk

    my first question :

    is it possible to control 2 LCDs (each of 4x20characters) with 1 PIC

    by example 1 LCD on 6 pins of PORTB (4 datas, RS and En) and the second LCD on 6 pins of PORTD (4dats, RS and En) of a 16F877

    my application need to display 8 lines of informations
    and LCD have only 4 lines !


    thank you for answer

    F1FCO, Pierre

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    The answer in NO. You cannot have two different LCD's connected that way since you use DEFINE's to tell PBP where is connected the LCD.

    But you can use serial LCD's and connect more than 1 (2,3,...) since you would need 1 or 2 wires (and a ground of course).

    And many pins would be left free also...!

    Ioannis
    Last edited by Ioannis; - 8th April 2010 at 12:31.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    For cheapness, you can of couse use two PIC's (eg 16F628) one for each LCD, and have those in turn connected to your main application PIC. It would work out a lot less expense than buying ready-made Serial LCD's (in effect you're creating your own 'local' serial LCD network).

  4. #4
    ivancho's Avatar
    ivancho Guest


    Did you find this post helpful? Yes | No

    Lightbulb

    You could also use a data buffer and enable the one with the one LCD you want to send the data to. And you can use the same data pins for all of them, and just "buffer" the Enable for the LCD need to send the data to.

  5. #5
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello F1FCO,

    Long time since I talked to someone in France...Maybe on 15 meters, or 20 meters <g>

    What you could do, is connect two LCD's up to the exact same PIC (in 8 bit mode), but the Enable pin will of one LCD will go to Port a.0. the Enable Pin of LCD 2 will go to Port a.1, and the LCD control pin (for LCD command/Write) will go on Port a.2. That way you can just "Toggle" Porta.0 if you want that command to go to the 1st LCD. If you want to send the data/command to the second LCD, toggle the porta.1. The other LCD should egnore the data, because you are not "Toggling" it to accept anything.

    Thus, with PortB (8pins) and 3 pins of Porta you can control 2 LCD's. If you want to control 3 LCD's it will take 4 pins on Porta. etc.

    I used to do EME for quite some time Used KLM 32 element running 1/2 of a Kilo on 2 mtrs. Ran CW for many years. Did a lot of Sat communication... Was able to do Packet, SSTV, RTTY, and standard communication when AO 10 was up

    Dwayne

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I have doubts that two LCD's with just an enable toggling between them will function. Most LCD's require an initialisation sequence following power-up which is accomplished by PBP transparantly to you. Therefore only the currently enabled LCD will be initialised, thereafter PBP will sit back safe in the knowedge it's done it's housekeeping. The second LCD will never be initialised and may well fail to respond correctly if at all.

    You can of course bypass PBP's LCD routines and write to your two LCD's directly, but first you must acquire the Datasheet for your LCD controller to determine the command sequences required.

    Melanie

  7. #7
    anj's Avatar
    anj Guest


    Did you find this post helpful? Yes | No

    Default

    Gday Mel
    I was having trouble with a 4Line LCD on a 16F88, but a 2line worked no probs. ( Fixed when i forcibly set RB6 and RB7 to digital outputs. )
    However as part of my playing i was trying to run 2 LCDs in parallel. As part of this testing i was also playing with the FLAGS = 0 definition ( as per the book ) to force the LCDs to reinitialise.
    If they were to say set LCD1 as default and start the prog, then switch to LCD, set Flags = 0, and write data, wouldnt both LCDs then be initialised, and stay initialised???

    Just thought re this, the pic will still default to use the defs for RW and E.
    However, if the RW and E pin was connnected to say a 4066 switch, and this switch toggled the lines to the LCDs, then the above process may work, just write to one LCD, toggle the SW, set FLAGS=0, write to LCD, both initialised??

    Andrew
    Last edited by anj; - 14th April 2004 at 21:49.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    It's really got to be a case of try it and see...

  9. #9
    Original's Avatar
    Original Guest


    Did you find this post helpful? Yes | No

Similar Threads

  1. how to connect ac sensor to PIC ?
    By iugmoh in forum Schematics
    Replies: 3
    Last Post: - 1st June 2008, 18:35
  2. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  3. connect microphone to pic?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th January 2008, 08:33
  4. PIC to PIC cooms using PICDEM 2 Plus
    By blake in forum General
    Replies: 0
    Last Post: - 28th March 2006, 23:50
  5. Help LCD with 2 wire Connect (Idea)
    By jetpr in forum Schematics
    Replies: 10
    Last Post: - 18th August 2005, 06:46

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