PDA

View Full Version : 3-wire LCD interface?



atomski
- 13th May 2004, 07:41
Hello everyone,

here's yet another question, I couldn't
find info about in the forum archives. How
would one go about connecting an alpha
numerical LCD (e.g. 1X16 HD44780) via
74HC595, 74HC154, CD4094 or similar?
I'm short of pins and I'd like to build a
cheap serial LCD using 12C508/509 w/
3-wire interface to the LCD. Sample source
code would be appreciated. I'd prefer to
use 74HC595 as I have an abundance of
these ;) Serial comm. on 12C508/509 is
something I've never tried out, but I have
2 or 3 laying around and I'd like to give it
a try. Thanks very much in advance...

--
Sincerest regards,

YZ7REA Vladimir M Skrbic
4N7ATV Repeater Administrator
YU7GHZ Radio Club President

NavMicroSystems
- 13th May 2004, 10:22
Have you tried the attached ?

Dwayne
- 13th May 2004, 14:52
here's yet another question, I couldn't
find info about in the forum archives. How
would one go about connecting an alpha
numerical LCD (e.g. 1X16 HD44780) via
74HC595, 74HC154, CD4094 or similar?
I'm short of pins and I'd like to build a
cheap serial LCD using 12C508/509 w/
3-wire interface to the LCD. Sample source
code would be appreciated. I'd prefer to
use 74HC595 as I have an abundance of
these Serial comm. on 12C508/509 is
something I've never tried out, but I have
2 or 3 laying around and I'd like to give it
a try. Thanks very much in advance...


I posted some code earlier, for a two wire interface.
You use 2 wires, one for data, and one for clock. It has
a extremely fast baud rate. (controllable to any speed, but in the 10's of thouasans uncontrolled) If you would like, I will repost
the code.... I also have designed a single wire interface, to
where a 12f675 can be used to control a LCD. with one wire.
I use a 16f648A for the receiver of the data, and controller of the
LCD. (for both cases). That way, a single 12f675 can control
5 LCD's at once...separately and the 6th pin of the 675 is the MCLR or input pin.


Dwayne

atomski
- 13th May 2004, 15:42
Guys, thanks for the reply. I have already
built a serial LCD using 16F628 & MAX232,
however I'd like to use a cheaper PIC like
508/509 and one of the mentioned IC's.
The schematics on the image looks ok, but
I still don't know how to drive the HC IC ;)
I've never used 3-wire bus before. As I
said earlier I would prefer using 74HC595
as I have tons of these in my drawer. Any
chance any of you guys could help me out
with 595 pbp code? Thanks!

--
Sincerest regards,

YZ7REA Vladimir M Skrbic
4N7ATV Repeater Administrator
YU7GHZ Radio Club President

NavMicroSystems
- 17th May 2004, 19:00
@ DWAYNE

---> Glass is 1/2 full, not 1/2 emty

Having thought about it I came to the conclusion:

The glass is neither ½ full nor ½ empty,
it is twice as big as it needs to be !

Dwayne
- 18th May 2004, 18:15
Hello NavMicoSystems,

NMS>>@ DWAYNE

---> Glass is 1/2 full, not 1/2 emty

Having thought about it I came to the conclusion:

The glass is neither ½ full nor ½ empty,
it is twice as big as it needs to be !<<

<chuckle> Good one. But I like having that little extra room, just in case I can come out a little more ahead than someone else <g>.


But, your response reminded me when I shot in the nationals in 2000. I shoot BareBow Olympic Style, and there is was a saying that us BareBow shooters used.

to explain how it works, a BareBow has no sights, no added mechanical devices to help you... It is just a bow with a string on it. The other bows have all these fancy "precision" sights and stablizers, and all the widgets that allow you to shoot bullseyes all day. (A bullseye is a 3 1/2 inch diameter circle at 20 yards away). The saying went something like....

A Recurve shooters attitude is "I hope I hit!, and is happy when he does hits" The other shooters attitude is "I hope I don't miss, and is embarrased if he does!" <g>


Dwayne

NavMicroSystems
- 18th May 2004, 19:44
@DWAYNE,

we are running a bit off topic, but here is one more:

That "blinky light" could be seen as something that...

works, doesn't work, works, doesn't work. . . .

and this is certainly something to be investigated in depht.

@atmoski

sorry, the last posts mgiht have been of no use on your way to solve the 3-wire LCD problem, but they probably have made you smile.

Dwayne
- 18th May 2004, 22:47
Hello NavMicroSystems,


NMS >>sorry, the last posts mgiht have been of no use on your way to solve the 3-wire LCD problem, but they probably have made you smile.<<

Well, in actuallity, I was helping another Gent on the 3 wire system. Unfortunately I have not had the experience with the chips that he wanted to use.

I have built a 2 wire system to control a LCD, and on the same principal, I built a single pin LCD controller. The baudrate is alarmingly fast, and you do not need any Serin or Serout rountines. That means any pin you want (that is a output) can control the LCD. I mainly did this, so that I could work with a bunch of 12f675's to control some LCD's and display data to it, when it reads the AD off of the 12f675.

And it gives me a little more knowledge on how the timing is on these little PIC chips. They are a whale of a lot different than the Philips chips! But fun to work with...


And by the way...Yes, I do enjoy good laughs, smiles, and conversations. Thanks!

Dwayne

atomski
- 19th May 2004, 06:36
Hey guys no prb,

I enjoy when people around me have a
positive attitude. I would like to find
out more about your 1 wire protocol,
though. Hope you can shine some light
on this subject for me please. Thanks!

--
Sincerest regards,

YZ7REA Vladimir M Skrbic
4N7ATV Repeater Administrator
YU7GHZ Radio Club President

Melanie
- 19th May 2004, 09:25
I do recall posting this sometime over the last year... it could have been to the email forum... it may be of interest...

atomski
- 19th May 2004, 12:12
Hey Mel,

Yes, it looks nice and I'd like to try it out.
However, as I said I have a whole pile of
74HC595's and I'd like to use them. BTW
I found a basicstamp source code for the
3-wire LCD interface, but the syntax is so
different I couldn't make it out :(

Vlad

Dwayne
- 19th May 2004, 16:10
Hello Folks,

I will post the receiver and transmitter part of the 1 pin Xcvr.

The principal lies upon the receivers timing, in connection with the transmitters timing. You only have two critical points to ponder.

1. The initial Rcvr *must* be slower than the transmitter until it receives the start bit.

2. The Rcver *must* be faster than the transmitter after receiving the start bit.

After #2 starts or begins, you control your Baud rate by the transmitter, *NOT* the receiver, or both.

I wanted the overhead of the transmitter to be almost zero. The receiver was a 16f648A, and its only job was to control the LCD, so instead of using a interupt (which you can), I left the receiver in a loop, waiting for data communication from the 12f675. When a full byte is received, the 648 checks to see if it is a LCD command byte or a LCD data byte. (x254) if it is a command byte, it tells the LCD to accept next byte as a command, and waits for the next byte.

Dwayne


It has been 100 percent reliable so far. When I get home, I will post the code.

shahidali55
- 5th June 2007, 09:26
Melanie could you please give me the code to interface your circuit?

phoenix_1
- 5th June 2007, 11:36
Pa de si bre Vlad puno pozdrava od Tanga.

skimask
- 5th June 2007, 14:07
Melanie could you please give me the code to interface your circuit?

That was over 3 years ago...you know that right?
And there is code around here...just needs a bit of searching...who knows, maybe you could even write code yourself!

T.Jackson
- 5th June 2007, 15:20
That's a good idea - using a Hex D Flip-Flop. So basically when Q6 is low the LCD's disabled, (the diode sinks current from the 4k7) then Q6 swings high allowing the data line to re-enable the LCD after clocking in the bits you want.

T.Jackson
- 5th June 2007, 15:43
That was over 3 years ago...you know that right?
And there is code around here...just needs a bit of searching...who knows, maybe you could even write code yourself!

Give him a break - writing code for this is a lot easier said than done.

shahidali55
- 5th June 2007, 16:59
Couldn't find anything using search.

shahidali55
- 5th June 2007, 17:00
I didn't know what PBP was before 3 years.
I don't think any code in PBP was posted for 3 or 2 wire interface till now.
I tried to understand the code given on http://www.rentron.com/Myke1.htm.
But couldn't really understand the command sequence. I didn't really get how the RS and E lines of the LCD are being handled.

skimask
- 5th June 2007, 20:37
I didn't know what PBP was before 3 years.
I don't think any code in PBP was posted for 3 or 2 wire interface till now.
I tried to understand the code given on http://www.rentron.com/Myke1.htm.
But couldn't really understand the command sequence. I didn't really get how the RS and E lines of the LCD are being handled.

That's the same book/code/idea I was talking about. I picked up that book back in '01 (give or take a few months). Basically you manually preload a shift register with all the data bits, then the rest of the control bits and the last thing to get 'tripped' is the Enable, all done by a shift register.
Not a new idea by any stretch, but a handy one...

Archangel
- 10th June 2007, 03:08
I didn't know what PBP was before 3 years.
I don't think any code in PBP was posted for 3 or 2 wire interface till now.
I tried to understand the code given on http://www.rentron.com/Myke1.htm.
But couldn't really understand the command sequence. I didn't really get how the RS and E lines of the LCD are being handled.
Look at this thread:
http://www.picbasic.co.uk/forum/showthread.php?t=4972
HTH
JS