PDA

View Full Version : LCD Display, Linking



IronPenguin
- 18th November 2005, 15:47
Hi,

I'm working on a model railroad project for my layout. It's common to use a "fast clock" for operations, which speeds up time relative to your layout. In other words, though it may take only 1 minute for a train to actually go from one town to another on the layout, if you use a fast clock, the "time" traveling is 15 minutes.

The clock part is straightforward Basic, but I'd like to display this fast time on several LCD displays around the room, which leads to my questions:

a) Are there hidden problems I need to know about driving more than one LCD display from a single PIC. (Any suggestions?)

b) Is there a practical distance limitation, ie how far apart can they be and still work?

Thanks,

Mike Tennent

keithdoxey
- 18th November 2005, 16:14
I would be inclined to add a PIC to each display to convert them into Serial LCD's. You would then only need to feed +5V, 0V and Serial Data to each display. That way there shouldnt be any worry about distance or having multiple displays as they would just be dumb terminals.

Dont forget that if you are trying to emulate a real railway display then at least one of them need to be showing the wrong infomation or total garbage :)

Melanie
- 18th November 2005, 18:12
You need a dot-matrix display telling you that there are three trains arriving all one minute away (obviosuly fighting to get onto the same single line track through a tunnel). This display is 'fixed' ie never changes. Tell me... how come model railway layouts always omit little scale-model Buskers (complete with bad music - playing at 15x speed!), Muggers, Tramps, Drunks, Graffiti and tiny painted born-again-pizza splats on the platforms? Also, how come nobody stops the trains to scale? They roar into the stations doing the equivellent of an emergecy stop at the platform hurtling their passengers into a mangled heap in the front of each carriage... Real-life trains aren't fitted with inertial dampers!... Oh, before I digress, the serial LCD suggestion is best.

jmgelba
- 18th November 2005, 20:58
What about buffer/line drivers? Something from Toshiba.

keithdoxey
- 18th November 2005, 21:00
Tell me... how come model railway layouts always omit little scale-model Buskers (complete with bad music - playing at 15x speed!), Muggers, Tramps, Drunks, Graffiti and tiny painted born-again-pizza splats on the platforms?

LOL :)

Probably because they are all undesirable things and you have the opportunity to create a perfect, albeit tiny, world :)

DynamoBen
- 19th November 2005, 06:55
If you really want to ensure data integrity at a distance, you could at RS-485 transceivers. It’s still serial but extends the overall range.

Melanie
- 19th November 2005, 08:34
Proper RS-232 is good for at least 1km of cable (and it's simple and cheap)... special line drivers can extend this to 5km... so unless you want a network of multiple master transcievers, RS-485 isn't nescessary.

IronPenguin
- 21st November 2005, 14:21
Muggers, Tramps, Drunks, Graffiti and tiny painted born-again-pizza splats on the platforms? Also, how come nobody stops the trains to scale? They roar into the stations doing the equivellent of an emergecy stop at the platform hurtling their passengers into a mangled heap in the front of each carriage... Real-life trains aren't fitted with inertial dampers!... Oh, before I digress, the serial LCD suggestion is best.

LOL.

Sorry about the late reply, I had to go off for the weekend unexpectedly.

A serious reply to your humor... Many layouts have begun to show the grittier side of railroading - several manufacturers offer graffitti decals, etc. But by and large, most folks model what they'd like the world to be, rather than what it is.

One quick further question about using a PIC as a serial driver - can someone point me to some code that does that? I have a LAbX-4 board that does that with a PIC onboard, so I understand the theory. I assume the PIC receives the string via SERIN, then sends it out over four pins to the display?

I did a quick search of the melab site, but nothing pops out immediately.

Thanks again,

Mike Tennent

Melanie
- 22nd November 2005, 08:19
Just use any of the Serial Output commands for the Master PIC... SEROUT, SEROUT2, DEBUG, HSEROUT, your choice. In it's simplest form, send the Data as if you were going to send it to your LCD... eg...

SEROUT2 0,16780,[$FE,$01,"Stand Clear",$FE,$C0,"Train Arriving"]

The value of 16780 is dependant on your chosen baud rate (see PICBasic manual).

At the receiving end every character received by the receiving PIC is passed straight to it's LCD. Easy Peasy....

Finally, if you're running long lengths of cable (ie greater than say 5 metres), use a proper RS-232 driver chip (like the MAX232), don't rely on the PICs measly 5v output to drive long distances reliably.

Oh, and a finally, finally... it's serial comms, so use a Resonator or Xtal.

IronPenguin
- 22nd November 2005, 15:03
Thanks, Melanie.

This is the first time I've fooled with a stand-alone LCD, but I think it'll be fun to play around with.

Mike T.