• Pic® Basic


  • How to connect two LCD's to one PIC®

    Should the need arise to connect two LCD's at one to one PIC®, it can be accommodated easily without having to duplicate pinouts or code.

    Simply wire the two LCD’s onto the same IO pins with the exception of the Enable lines which are wired through an AND gate. Each display can be activated by toggling the other input on the AND gate.



    It is wise though to use the AT modifier as things can get a little confusing as you swap between the two LCD's.

    Note: This has only been tested using a 4-line LCD device where the 2 drivers are on the one board. Care should be taken to ensure there are no clashes with dormant data lines.

    Example Code
    Code:
    SYMBOL TOPDISPLAY = PORTB.0
    SYMBOL BOTTOMDISPLAY = PORTB.2
    
    Sets up the bits to control the two halves of the display 
    
    HIGH TOPDISPLAY
    HIGH BOTTOMDISPLAY
    delayms 20
    
    DECLARE LCD_TYPE 0
    DECLARE LCD_DTPIN PORTB.4
    DECLARE LCD_ENPIN PORTB.1
    DECLARE LCD_RSPIN PORTB.3
    DECLARE LCD_INTERFACE 4
    DECLARE LCD_LINES 4
    
    'standard LCD set up
    
    CLS
    LOW BOTTOMDISPLAY
    PRINT AT 1,1,"HELLO WORLD"
    Thanks to Carrotts for supplying this article.
  • Recent Activity

    Les-15

    Pulse counter memory problem

    Thread Starter: amod

    Please tell me my faults.My pulse counter memory does not store.When i switch on device after 5 second ,memory exist by after 30 seconds it is washed...

    Les Today, 18:18 Go to last post