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.

74LS174 2-wire LCD interface

Status
Not open for further replies.
I use the 74HC595 or the 4094, both work quite well. I tend to use 3 wires though, and the 4-bit mode interface. D7-D4, RS, and backlight. E tied to the strobe line.

I've also used shift registers for T6963C based LCD's. With a couple of NAND gates you can have a 'busy line'. I'll post if people want it..handy for getting a lil F88 hooked up to a 240x128 LCD as well as EEPROM/FLASH for bitmap storage.

Blueteeth
 
I use the 74HC595 or the 4094, both work quite well. I tend to use 3 wires though, and the 4-bit mode interface. D7-D4, RS, and backlight. E tied to the strobe line.

I've also used shift registers for T6963C based LCD's. With a couple of NAND gates you can have a 'busy line'. I'll post if people want it..handy for getting a lil F88 hooked up to a 240x128 LCD as well as EEPROM/FLASH for bitmap storage.

Blueteeth
Please do. I have been using the 74HC595 but it never dawned on me to tie the strobe and E together. Makes sense. I would like to see what you are doing with the busy.
 
Please do. I have been using the 74HC595 but it never dawned on me to tie the strobe and E together. Makes sense. I would like to see what you are doing with the busy.

Hey. The 'busy check' was only for the T6963C controller...although I guess it could be adapted for the character LCD's....I usually just wait the maximum time, using a spare timing interupt or something.
With the graphics controller....theres no minimum time given in the crappy datasheet, plus speed is at a premium when you're drawing bitmaps/updating info on a large LCD, so a busy line is handy.

When the strobe isn't clocking data into the LCD, the tristate output of the 595 is disabled and the LCD set to 'read'. Theres two bits which determine 'busy', so AND those together and you've got a 'busy line'. Its another I/O but still handy as its just a low/high.

For character LCD's I've just used 74HC595's, or 4094's. The 595 has a nice pinout for I/O expansion but for LCD's, the 4094 has much nicer layout. here's a couple of schems I did ages ago when I was fed up with prototyping with character LCDs and using so many I/O's.

Not worth posting both, as the 595 is pretty much identical in functionality to the 4094. Sorry for large schems, since I went with '4-bit mode', theres for spare SR outputs for controlling the backlight. You could use 8-bit mode and use the data or clock input to the RS line..but I can't be bothered disabling my SPI port's I/O's just to set/clear them. At least this way SPI handles it in a couple of simple routines.

I really need a website to put all this crap on....

Blueteeth
 

Attachments

  • 595LCD.png
    595LCD.png
    15.1 KB · Views: 2,974
  • T6369CSPI.png
    T6369CSPI.png
    24.9 KB · Views: 1,622
The Myke Predko 74LS174 design is what inspired me to design a miniature serial LCD interface using an 8 pin PIC. It was challenging trying to figure out how to drive 6 pins on a 44780 type display with only 5 outputs on the PIC. Basically, I connected the serial data line to the PIC and to the RS pin on the LCD. The LCD ignores serial data on that pin until I strobe the E pin. The host device sends a byte of data as two serial bytes with 4 bit nybble data in the b0..b3 bits and the RS bit in the b7 bit. The 12F635 samples and latches the b0..b3 data onto the LCD D4..D7 lines and sends the E strobe right in the middle of the RS serial data bit when it arrives.

I finally got around to building and testing the design a couple weeks ago and so far it's working flawlessly at 19200 and 57600 baud. I plan to try 115200 baud soon.

**broken link removed**

The host device driver is very simple and looks like this;

Code:
PutCmd                          ; entry point for "cmd" data
        clrc                    ; RS = 0 (command)                |B0
        skpnc                   ;                                 |B0
PutDat                          ; entry point for "dat" data
        setc                    ; RS = 1 (data)                   |B0
        movwf   Temp            ; save WREG data byte             |B0
        swapf   Temp,W          ; swap nybbles in W               |B0
        call    PutNyb          ; send left nybble                |B0
        movf    Temp,W          ;                                 |B0
        call    PutNyb          ; send right nybble               |B0
PutNyb
        andlw   0x0F            ; mask off left nybble            |B0
        skpnc                   ; RS = 0?  yes, skip, else        |B0
        iorlw   b'10000000'     ; set RS bit to '1'               |B0
        btfss   PIR1,TXIF       ; UART transmit buffer empty?     |B0
        goto    $-1             ; no, branch and wait, else       |B0
        movwf   TXREG           ; send it                         |B0
        return                  ;                                 |B0
Here's a picture of the 12F635 Serial LCD Interface being driven by a 16F690 host at 57600 baud.

**broken link removed**
 
Futz,

Just noticed on your web site that you switched to an 'F88 and also hooked up to an LM35DZ temperature sensor to your test 74LS174 LCD test bed in just the last couple days. Incredibly nice demo and layout btw.

Anyway, you mentioned that you'd like a better (lower) Vref for the A2D module for the LM35 and I was wondering if you or anyone knew if the Comparator module voltage reference module in the 'F88 can be used for the A2D Vref signal?

Also, which C compiler are you using for 16F' devices? Is it a 'free' compiler, by any chance?

Mike
 
Last edited:
Incredibly nice demo and layout btw.
Thanks Mike :)

Anyway, you mentioned that you'd like a better (lower) Vref for the A2D module for the LM35 and I was wondering if you or anyone knew if the Comparator module voltage reference module in the 'F88 can be used for the A2D Vref signal?
I didn't know that. I'll look into it tonight (maybe this afternoon). Thanks for the tip.

Also, which C compiler are you using for 16F' devices? Is it a 'free' compiler, by any chance?
I've switched to BoostC. I hit the limit of the free demo on the GLCD project and bought it. You can do a lot with the demo, but it's only $75 to buy a full license. Cheap price for a pretty good compiler.
 
Futz,

You may have misunderstood me. I asked if anyone knew if you could use the comparator voltage reference for the A2D module. I don't know for sure that it can. Sorry.

Also wondering if we couldn't exploit the 74LS174 circuit by taking advantage of it as a six bit latch (without setting data = 1 for the 'E' strobe) to drive the column line on a set of switches or select columns on an LED display, etc.?

Bill (blueroom) showed us his 8 bit SPI latch on another thread which can be used for an LCD display (amoung other things) and I'm currently adding 4-bit latch capability to my 12F635 serial LCD driver (using a new control bit in each serial byte that will enable or disable the E strobe for that byte).

Mike
 

Attachments

  • 74LS174 thingy.PNG
    74LS174 thingy.PNG
    27.7 KB · Views: 1,674
Last edited:
You may have misunderstood me. I asked if anyone knew if you could use the comparator voltage reference for the A2D module. I don't know for sure that it can. Sorry.
Ah, I see that now. I read it fast and missed that. Just took a look and it appears that should work well. I would think you'd just set it for your desired voltage (out of the range available) and connect RA2 to RA3. Then I'd have to move my LM35DZ input to another pin and it should work. I'll try it tonight.

The datasheet isn't real clear on the details, but the mid-range reference has good info.
 
Last edited:
Cool. Let us know if it works out?
Works perfect! :D That makes a very convenient VREF without adding extra circuitry. Thermometer responds much more smoothly now. No jumps by three numbers anymore.

I'm using a 0.417 volt VREF. I figure (where I live) this thing will never exceed 40C, which would have the LM35DZ outputting 0.4V. I divide my 10-bit result by 24, rounding down from the proper 24.3. Makes the thing read a fraction too high. Close enough! :p

I don't care about negative. It's an indoor thermometer. The circuit could easily be redesigned to do negative temperatures though.

A good thing to know. :)
 
Last edited:
I always thought that VRef+ & VRef- had to be at least 2.5V apart. Not sure though.

Have you ever looked at the uber flexible comparator module on the 16F887.
 
I always thought that VRef+ & VRef- had to be at least 2.5V apart. Not sure though.
I just read thru datasheet, mid-range manual and AN546 and I see no mention of it. My circuit seems to work (so far). If you find a reference for that I'd really like to read it.

Have you ever looked at the uber flexible comparator module on the 16F887.
Nope. I don't have an 887. Until yesterday I didn't even know what a comparator was. :D (Well, I kind of had an idea. I just hadn't looked at them in any detail).
 
Last edited:
That wasn't very clear, but I found this:
The minimum range for Vref+ - Vref- is 2.5v.
in GPIO14

There's not much out there on it. Mine seems to work, but I should do much more testing. Bet I find that it only seems to work, or works only in a small range or something...

EDIT: I put a frozen hamburger against it and got it to go down to 10C before my thumb froze and I gave up. Then I put the soldering iron on the ground leg and it went up to 40C. Took it off and it gradually cooled to ambient 23C. Maybe it's inaccurate, but I have no way of checking easily right now.
 
Last edited:
According to Page 32-38 of the Midrange Reference Manual you need minimum 3V difference between VREFH and VREFL to guarantee 10-bit resolution. But minumum VREF+ is 0V.

What happens when you have less? The successive approximation thing doesn't work right, I guess?
 
Status
Not open for further replies.

Latest threads

Back
Top