Go Down

Topic: LCD3Wire: a 3-wire driver for HD44780-based LCDs (Read 5 times) previous topic - next topic

dhenry

Yes.

In the code I wrote earlier, I forced a particular connection (Q0 -> D0, Q1 -> D1, etc.) With a little modification, you can remap those pin connections to your own liking, providing additional flexibility for your layout guy.

BTW, what's the capture tool you used there? Pretty refreshing.

Mike McLaren, K8LH

#36
Jan 14, 2013, 10:42 am Last Edit: Jan 14, 2013, 06:16 pm by Mike McLaren, K8LH Reason: 1
The drawings were done using the drawing tools in MS Excel.

Hey, I added an RC integrator and tested a 2-pin 8-bit design but I'm a PIC guy (sorry).  Anyway, if you're interested, I've attached a shot of the board just moments after it came up (first try!) and another couple shots of the board before I added the RC parts.  The host is a PIC18F14K22 (16 MHz) with an assembly language program. The low level LCD driver uses 28 words of program memory and is isochronous.  With delays for the RC tau of 3.3 microseconds, it takes precisely 83.75 microseconds to send each byte to the LCD.

Cheerful regards, Mike

bperrybap

#37
Jan 14, 2013, 06:58 pm Last Edit: Jan 14, 2013, 07:05 pm by bperrybap Reason: 1
Mike,
If you are wanting a 2 pin design, you can get significantly better throughput using an and gate instead of an RC
network to multiplex the pins. The and gate can be created using a resistor and a diode.
When doing that, I was able to get 76us per byte transfer on a 16 mhz AVR.
And that 76 us is the full overhead from an Arduino sketch going through the Print class then down through the library
sending the byte to the display and returning back to the sketch.
The library is also using 4 bit mode which requires sending 2 nibbles and because of the and gate you have
clear the SR before each nibble transfer.
The code I used the SR2W code in this library:
https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
(I am the author of the SR2W interface code)
You can see a diagram of how the SR is wired up in LiquidCrystal_SR2W.h

Since you are a PIC guys here is a link to a page that is doing essentially the same thing
for PIC:
http://www.rentron.com/Myke1.htm

From an overall design perspective I think the AND gate multiplexor is better
than the RC network multiplexor even though it requires 4 times the number of shifts to the SR
since it is faster and allows backlight control.
It also has not timing critical sections so interrupts won't ever have to be masked
while doing the transfers.
Cost wise, it should be nearly the same resistor & diode vs resistor and cap.
Then for a few additional pennies you can add backlight control.
The backlight control does require some dampening on the transistor input to remove
the flicker because of live output bits on the SR during shifting.

You can see a sample backlight circuit in the SR2W header file.

--- bill

Mike McLaren, K8LH

#38
Jan 14, 2013, 07:40 pm Last Edit: Jan 17, 2013, 12:59 am by Mike McLaren, K8LH Reason: 1
Thanks for all the great info', Bill...  I'm not really interested in 2-pin designs, per se, or simply driving an LCD, per se.  I think there may be more possible applications for an 8-bit shift register + latch than just simply duplicating Myke Predko's old 74HC174 2-wire LCD interface (grin).  Anyway, I'm having fun discovering different clever, creative, and elegant design solutions...  

dhenry

Quote
The low level LCD driver uses 28 words of program memory and is isochronous. 


Excellent. The advantage of coding in assembly.

Quote
With delays for the RC tau of 3.3 microseconds, it takes precisely 83.75 microseconds to send each byte to the LCD.


As long as your refresh time for a line is within 5 - 6 ms, you are fine.

A word of caution: the r/c approach is of no use in a noisy environment. As a matter of fact, I would recommend that you perform periodic software reset of the display, in case it goes out of sync.

Go Up