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.

HD44780 question

Status
Not open for further replies.

3v0

Coop Build Coordinator
Forum Supporter
If I put the HD44780 into a read mode its pins become outputs. If I do not tristate the 74HC595 driving it, will the pin pairs with 1's and 0's flow enough current to burn out either the LCD driver or the 595?

If so would putting current limiting resistors between the 595 and LCD prevent the problem?

FWIW the attached schematic shows how I would like to read the busy flag back through the 595's clock line. The LCD and the 595 will attempt to drive each other while I do the shifts to tristate the 595. While debugging it is possible that the program may be halted with both driving.
 

Attachments

  • question.png
    question.png
    9.5 KB · Views: 984
hi 3v0,
An alternative would be to tie the RW line on the LCD low and use delays in the program, rather than test the DB7 'BUSY' line.
 
Use a tri-state buffer with the Rd line as the control bit for the buffer.
 
Use a tri-state buffer with the Rd line as the control bit for the buffer.
My goal is to get more functionality without adding more chips.

The 74HC595 has tri-state outputs controlled by pin 13 OE aka G. I can not use the r/w line to control OE because the r/w pin will be tristated. The serial out pin is an output regardless of OE so it is the only candidate for controlling OE.
 
Oops, my bad, I should have looked more closely.
 
As it's currently connected how do you write a zero to D7 as /QH is connected to /OE? BTW, it is in not just D7 that becomes output, it is D4-D7.

Mike.
 
Questions are still unanswered.

BTW, it is in not just D7 that becomes output, it is D4-D7.

Mike.
You are right about needing current limiting resistors on D4-D7. I am fairly sure the current limiting resistor(s) should protect the parts when both are outputs but in different logic states. But I have not seen it done. I am still an not 100% sure they are needed. This is sort of similar to having two or more devices that can drive the same bus. As a rule only one is on and the others are tristated. What happends when more then one is turned on?
As it's currently connected how do you write a zero to D7 as /QH is connected to /OE?

I was speculating that 2.2K (or maybe 10K would be better) resistor between /OE and the D7 would work like a pullup/pulldown resistor and be overpowered by the 74HC595 QH output. This would allow one to write a zero on D7. Again I am unsure and thus the question.


This is a link back to the original image. I only have a copy of it as a png so I could not put the other resistors in. :D
question-png.19560
 
The problem is with all data bits, when D7 is zero then /Q7 is one and so ALL outputs are tristated.

Out of curiosity (and a vague memory) I had a look at my LCD code for the Unicorn and found that I only changed D7 to input when reading the busy flag. This means the other bits were contentious yet I had no problem.

Mike.
 
The problem is with all data bits, when D7 is zero then /Q7 is one and so ALL outputs are tristated.
Darn! I was thinking that the LCD would leave D0-D7 as outputs till they were changed by another command. Data is only on the outputs as long as E is held high.

Out of curiosity (and a vague memory) I had a look at my LCD code for the Unicorn and found that I only changed D7 to input when reading the busy flag. This means the other bits were contentious yet I had no problem.
I would think they are not needed.

Thanks.
 
Darn! I was thinking that the LCD would leave D0-D7 as outputs till they were changed by another command. Data is only on the outputs as long as E is held high.

I think you misunderstood what I was trying to say. With QH=0 then /QH=1 and therefore all the outputs from the 595 are tristated. This makes it impossible to write say 0001 to the 4 data pins of the LCD. Not to mention that RW and RS will also be floating. Even if you move the data lines along a bit the control lines will still be tristated when reading.

Have you considered Mike KL8H's 8 pin pic solution.

Mike.
 
I have done the typical 4/8/shift/uC ways of interfacing LCDs. I am not looking for a solution for a problem/project. School is over and I am tired of teaching the same old stuff. I started work on an interesting IR project and currently waiting for parts.

A few days ago someone (maybe futz) posted they had a LCD shift register interface that used gates to read the busy back. I was wondering if I could manage the same without the gates. Sounded fun. Like a puzzle.

Just to be clear. I am hooking the 595 tristate pin 13 to the serial out pin 9. The pin names vary between data sheets. I ahve seen the serial out refered to as SQH and QH*.

I understand that once the 595 is tristated the LCD will have no signals on its inputs.

Thanks for the help.

I think you misunderstood what I was trying to say. With QH=0 then /QH=1 and therefore all the outputs from the 595 are tristated. This makes it impossible to write say 0001 to the 4 data pins of the LCD. Not to mention that RW and RS will also be floating. Even if you move the data lines along a bit the control lines will still be tristated when reading.

Have you considered Mike KL8H's 8 pin pic solution.

Mike.
 
Hi 3v0,

How about this?

<> Tie the Latch/Strobe/RCK pin (12) and the Output Enable pin (13) together (driven by your "latch" signal).

<> Loose the resistor between the '595 QH output and the D7 pin on the LCD.

<> Put a pull-up resistor on the LCD RW pin so that it's a '1' (read mode) when the '595 outputs are tri-stated.

<> Put a pull-down resistor on the LCD RS pin so that it's a '0' (command mode) when the '595 outputs are tri-stated.

Here's what I suspect would be the LCD write procedure;

(1) The "Latch" signal is normally hi ('595 outputs off).
(2) Clock 8 bits into the '595 shift register.
(3) Set "Latch" signal lo ('595 outputs on).
(4) Toggle the 'E' line to send command or data.
(5) Set "latch" signal hi ('595 outputs off, RW = 1, RS = 0)
(6) change your CLK pin to an input
(7) Set the 'E' line hi, LCD outputs status byte
(8) Read D7 status on CLK pin
(9) Set the 'E' line lo, TRIS CLK back to an output

This means your "Latch" signal is normally hi and the '595 outputs are tri-stated between LCD write operations.

Mike McLaren

<added>

Just realized the procedure would be slightly different using LCD 4-bit mode but hopefully you get the idea...
 
Last edited:
I was thinking about a similar circuit yesterday :) In short use pull ups and downs to force a data read when the 595 is tristated. But I was using the serial-out (QH*) to drive the 595 OE pin. This is ugly because you need to clock the bits in twice. Once with E low and again with E high.

Mike said:
This means your "Latch" signal is normally hi and the '595 outputs are tri-stated between LCD write operations.
Which puts a read on the LCD's input. E is is high and as it goes low the next command will be showing up on the 595's output. The data is clocked into the LCD on E falling. I was a bit worried that the LCD would latch before the data on the 595's outputs had settled.

I tried to breadboard the circuit but could not get a LCD working on my 25 year old breadboards with or without the read hack. Time to chunk them in the trash and get new ones.

Next week I will do a PCB with jumpers to try it both way.
 
Last edited:
Now I think the LAT line (connected to output enable) should be low between write operations. New procedure below. I'm not sure when I can test this.

Regards, Mike
 

Attachments

  • 74HC595 LCD.PNG
    74HC595 LCD.PNG
    39.9 KB · Views: 220
3v0,

Did you notice the method in the '595 data sheet to combine the SRCLK ('CLK') and RCK ('LAT' or 'STB') signals for a 2 pin interface?

Mike
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top