PDA

View Full Version : driving multiple 16x2 LCDS



comwarrior
- 8th October 2010, 00:58
i can purchase 8 16x2 LCD displays for the cost of a 20x4 so that makes me think why can't i drive multiple displays from one chip...

so the idea is that all the data lines, RS and RW lines are all connected together for all displays. it's only the enable lines that have seperate IO lines...

I tried to compile a uber simple test program as follows;


DEFINE LCD_DREG PORTD ' LCD data port
DEFINE LCD_DBIT 0 ' LCD data starting bit 0 or 4
DEFINE LCD_RSREG PORTE ' LCD register select port
DEFINE LCD_RSBIT 0 ' LCD register select bit
DEFINE LCD_EREG PORTE ' LCD enable port
DEFINE LCD_EBIT 2 ' LCD enable bit
DEFINE LCD_RWREG PORTE ' LCD read/write port
DEFINE LCD_RWBIT 1 ' LCD read/write bit
DEFINE LCD_BITS 8 ' LCD bus size 4 or 8 data bits
DEFINE LCD_LINES 2 ' Number lines on LCD
DEFINE LCD_COMMANDUS 2000 ' LCD Command delay time in us
DEFINE LCD_DATAUS 50 ' LCD Data delay time in us

Main:
Pause 1000
DEFINE LCD_EREG PORTE ' LCD enable port
DEFINE LCD_EBIT 2 ' LCD enable bit
LCDOUT $FE, 1, 2, "LCD 1 line 1"
LCDOUT $FE, $C0, "LCD 1 line 2"
DEFINE LCD_EREG PORTE ' LCD enable port
DEFINE LCD_EBIT 3 ' LCD enable bit
LCDOUT $FE, 1, 2, "LCD 2 line 1"
LCDOUT $FE, $C0, "LCD 2 line 2"
goto main

It doesn't allow me to re-define a define... is their another method i could use to get LCDOUT to use a different enable line?

Thanks

Darrel Taylor
- 8th October 2010, 01:02
Try this ...

http://www.picbasic.co.uk/forum/showthread.php?t=631&p=6351#post6351

Mike, K8LH
- 8th October 2010, 11:12
Try this ...

http://www.picbasic.co.uk/forum/showthread.php?t=631&p=6351#post6351

Just curious why you use 3 pins instead of just 2 pins for the two Enable signals in that circuit?

Oops! Never mind. It allows you to use a single driver and a single pin for the E signal. Duh!

comwarrior
- 8th October 2010, 19:29
i thought today at work of using two 2 input AND gates on the enable lines and use a second enable line... but, disable works... lol

Thanks

aratti
- 9th October 2010, 16:27
You can use an 8 channels analog mux (74HCT4051), where you connect the pic enable pin to the input and the 8 outputs to 8 different LCDs (with a pulldown resistor). with three extra I/O pic pins you will select the proper LCD address using the selector line S0;S1;S2.


Cheers

Al.