Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Is it even possible to use more than 1 LCD module on a Microcontroller?

Status
Not open for further replies.

bigal_scorpio

Active Member
Hi to all,

I was just wondering about a project I have in mind which requires 2 or 3 LCD displays.

Since I write in PicBasic Pro it would be no problem to use one LCD but is it even possible to have two or more displays on the same microcontroller? They would all need to display different data and I thought about using a PIC16F877 or 887, plenty of IOs for the LCDs. Then it struck me that I don't know how I would discriminate between the LCD units as the commands in PBP all seem to relate to a single LCD.

Maybe there is a way to alter the LCD library and resave it as LCD2 library or something along those lines?

Can anyone clear up this thought for me and if it by some chance is possible, give me a clue how to do it?

Thanks Al
 
Hi Al,

From a hardware standpoint it's relatively easy to parallel multiple displays, that is, you connect the RS and the D4..D7 lines in parallel and use a unique E line for each LCD. Unfortunately, I have no idea how you would modify the built-in PBP LCD functions. Maybe someone on the PBP forum can help?

Good luck...
 
It's absolutely possible! With hardware gating you won't even need to use a different pin for the E line.

On an 8051 you have a streaming parallel port with a time multiplexed address/data buss which makes it quite a bit easier but it can also be implemented on a PIC as well.
 
Another idea, one which I discarded long ago, was to build LCD address capability into my serial LCD backpack firmware. That is, each serial LCD backpack (with hard coded address 1..4) could share the single serial pin from the host PIC and you would select the active LCD backpack by writing to one of the unused LCD DDRAM locations (which the backpack firmware would trap). For example, the following PBP code would select LCD #1 as the active LCD;

Code:
    DEBUG $FE, 252      ' use 252..255 to select LCD 1..4

You can't use the LCDOUT command. Instead, you would use DEBUG, SEROUT2, or HSEROUT command, all of which support the same data formatting capability as the LCDOUT command, but using a serial interface.

Food for thought.

Regards, Mike

**broken link removed**
 
Last edited:
Gentlemen,

Here's firmware for the 12F683 version of the serial LCD backpack. Default baud rate is 57600 and since the firmware automatically initializes the LCD on power up, you need to wait about 50 msecs before sending serial data to it. Send a 0xFE character in front of any "command" character and the firmware will set RS = 0 when it writes the "command" character. Users familiar with the PICBASICPRO "LCDOUT" command are already familiar with this mechanism for setting the LCD RS line to 0.

The circuit makes a very small "backpack" but you can also fit it into a very small space on a project board (see the 8-14-20 proto board below).

I'll try to write up a proper project description, schematic, parts list, etc., and post it in the Projects section in a Forum somewhere in the near future and then post a link to it here on ETO.

Any questions, please ask...

Cheerful regards, Mike
 

Attachments

  • Proto LCD.jpg
    Proto LCD.jpg
    122.1 KB · Views: 205
  • K8LH LCD-III.png
    0 bytes · Views: 26
  • K8LH ezLCD v3 (12F683).zip
    0 bytes · Views: 22
  • Breadboard Buddy Concept.png
    0 bytes · Views: 23
Last edited:
thats a realy nice lcd mike, infact i can think of several places i could make use of it :D i will let you know how it goes and many thanks again for posting it
 
Hi Mike,

I am just getting around to using serial devices and built your backpack LCD but I am stumped by the baud rate you quote. The manual shows baud rates above say 2400 as needing an osc faster than 4 and since the 683 has internal osc I am at a loss as to how its done.

As I said this is all new to me and I don't know for sure that the 57600 baud you quote actually means that speed? Once again baffled I'm affraid.

Al
 
hi Al,

If you assume that an RS232 transmission Byte has 1 start bit , 8 data bits and 1 stop bit [ ie10]

Just divide the clock rate 57600 by 10 to give 5760 characters per second

Like wise 9600 Baud /10 = 960 Char/sec

Eric
 
Evening Eric,

So why is Mikes speed well above what the PBP manual shows? Really can't get this to stick mate.

So anything I build that needs to communicate with the Backpack needs to be the same baud rate? If so how would I actually state that in basic?

Stumped.

Al
 
Evening Eric,

So why is Mikes speed well above what the PBP manual shows? Really can't get this to stick mate.

So anything I build that needs to communicate with the Backpack needs to be the same baud rate? If so how would I actually state that in basic?

Stumped.

Al

hi Al, I will unzip Mike's file and try to find out, I dont use 12F PIC's

Eric

EDIT:

He is doing using PIC clock cycles [ counting]

; bit time (cycles) used to sample a serial bit stream
;
; 19200 baud, 104 (104.2) cycles, 0.16% bit rate error
; 57600 baud, 35 ( 34.7) cycles, 0.80% bit rate error
; 115200 baud, 17 ( 17.4) cycles, 2.08% bit rate error
; 250000 baud, 8 ( 8.0) cycles, 0.00% bit rate error
;
clock equ 8 ; 8 MHz clock
usecs equ clock/4 ; cycles/usec multiplier
msecs equ clock/4*1000 ; cycles/msec multiplier
bRate equ 57600 ; baudrate 19200, 57600 or 115200
bTime equ (usecs*10000000/bRate+5)/10
OT: Yorkshire is the 11th in the Gold medals!
 
Last edited:
Hi Eric,

OT yes I know! We have done better than most Countries never mind Counties.

Back to the serial. So if I build something with a baud rate of 57600, 115200 or 19200 it will communicate with the Backpack?

BTW wish I did have a serial port mate. It would be much easier to get the idea by example using the PC instead of something I can't actually see working.

Wonder what the USB to serial converters work like? If they are any use I will buy or build one.

Al
 
hi Al,.
Mikes 12F only receives data , no transmission.

Do you have a 16F628 on the shelf?

E.
 
Hi Eric,

Yes mate I have a few 628's. What do you have in mind? Something to try the Backpack with?

If I had a known working program to try I could use it on my dev board (easypic5) to talk to the Backpack, that would be good.

Al

EDIT. Just looked and they are all 628A's. Is that OK?
 
Last edited:
hi Al,

The 628A is OK, 4MHZ internal osc and UART

Whats the spec on the backpack?

E
 
Hi Eric,

The specs on the backpack are maybe the problem. I am not at all sure that I understand the specs. It is from post 10 of this thread mate.

Al
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top