Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I need code for this circuit for 2-Wire LCD

Status
Not open for further replies.
Joined
Dec 4, 2012
Messages
4,280
Helped
822
Reputation
1,654
Reaction score
791
Trophy points
1,393
Location
Bangalore, India
Activity points
0
I need code or algorithm for this 2-Wire LCD Circuit. LCD used will be HD44780 or Compatible. I need an explanation of how data is transferred in 74HC174.

90098d1366990093-74ls174-thingy.png
 

Attachments

  • 74LS174 thingy.PNG
    74LS174 thingy.PNG
    27.7 KB · Views: 124

Did you already figure out the circuit it's intended to work? I fear, the design has serious difficulties to comply with the HD44780 timing requirements, particularly data setup time for D4 = '1'.
 


  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
If two-wires is a must, I would refer to the "Two Wire" circuit linked by tpetar. By using a 8-bit SR it has all options to provide a correct timing.

The explanation of operation is already using C-snippets.

Another option is to use a standard 8-bit I2C port expander like PCF8574 to control the display.
 

@FvM

Are you referring to this link https://www.circuitvalley.com/2011/12/two-wire-serial-lcd-16x2-graphics.html

I has timing issue.

Can you give example for using PCF8574 and also for 1 wire Serial LCD using Serial Communication.

Should I use some cheap PIC12F which as 4 pins for LCD data and 3 pins for LCD control and USART. I think it will be better to use such PIC12F between LCD 4-bit and microcontroller. I can use Soft_UART and with just 1 pin from mcu I will send serial data to PIC12F and it will receive data and send it to LCD in 4-bit mode.

Will it work? Something like this
download.axd
 
Last edited:

Tpetar has linked (in this order)
1. a two wire
2. a one wire (RS232)
3. a three wire circuit

So why you are asking which "two wire" circuit I mean? And which problems do you see with this circuit?

I didn't yet use an I2C port expander for HD44780, but the operation is more or less obvious, I think. You simpy reproduce the signal sequence of a parallel interface through I2C because the port expander sets all 8 outputs simultaneously. It's particularly reasonable if you already have an I2C interface in your design and want to add a display at no pin costs.
 

@FvM

See here. https://www.edaboard.com/threads/287040/
There was delay problem but it was fixed so that it works in Proteus. I still have to test it in Hardware at 20 MHz. I know there are I2C and Serial (Rx) LCD available. I will try 1-wire using Soft_UART or 2-wire but also want to try 74HC595 3-Wire LCD.
 

I reviewed the thread. There's nothing that has to do with "timing problems", I think. Serial data transmissions isn't done in no time, but in the circuits I have implemented in the past (mostly 3-wire SPI variants), it has been always sufficient for a character display. Means: Menus are updated without perceptible delay. CPU speed plays a certain role, of course.

Comparing different serial interface methods, the present two wire method doesn't perform bad, it's faster than 100 kHz I2C or RS232.

So I have to assume that performance problems of the present interface are brought up by non-optimal coding.
 
  • Like
Reactions: tpetar

    tpetar

    Points: 2
    Helpful Answer Positive Rating

I have seen the romanblack link earlier but the code is not easy to understand. The code is lengthy. I just want 74HC595 based 3-Wire LCD working code.
 

What about this
Why it is not working?
I'm not so familiar with Proteus debugging, but you can see that the initialization sequence isn't correct, by tracing the simulation with LCD display diagnosis enabled.
 

I changed the initialization like below but it is still not working.

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void Initialize_LCD(){
 Write_LCD_Nibble(0x03);
 Delay_ms(5);
 Write_LCD_Nibble(0x03);
 Delay_ms(5);
 Write_LCD_Nibble(0x03);
 Delay_ms(2);
 Write_LCD_Nibble(0x02);
 Delay_ms(1);
 Delay_50ms();
 Write_LCD_Cmd(0x28); // 4-bits, 2 lines, 5x7 font
 Delay_50ms();
 Write_LCD_Cmd(0x0C); // Display ON, No cursors
 Delay_50ms();
 Write_LCD_Cmd(0x06); // Entry mode- Auto-increment, No Display shifting
 Delay_50ms();
 Write_LCD_Cmd(0x01);
 Delay_50ms();
 Write_LCD_Cmd(0x80);
 Delay_50ms();
}

 

You might want to ask the original author of that circuit. He hangs out at electro-tech-online.com and allaboutcircuits.com
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top