Convert 16x2 chars display to big TFT display

I have a CPU board that interfaces to a standard 16x2 chars display, based on HD44780 controller.

I'd like to replace this display with a full-color big TFT display, maybe 10", but I can't change the firmware of the CPU (because I don't have the source code and I can't rewrite it, because of cost and time).

The simple idea is to create an interface between the current CPU board and the TFT display. This interface should be able to detect the signals from the CPU and that was directed to HD44780, interpret the instructions (write CGRAM/DDRAM and so on) and write the same things to the big TFT display.

Of course, exactly the same texts will be written on TFT display (of course with a bigger and visible font) and this is acceptable.

So the MCU on the interface should be able to read 8 data bits, RS and R/W signals syncronous to signal E.

I'm thinking to configure E signal as an external interrupt on the falling edge. In the interrupt, I read data bits, R/W and RS and decode the instruction or data.

Any suggestions? Maybe a similar code is already online.

Reply to
pozz
Loading thread data ...

I guess you don't need an interrupt. The signals to the 44780 are quite slow and well sequenced. So simple polling would do. Beware that the E signal is high when data is valid. So I would look for the rising edge.

--
Reinhardt
Reply to
Reinhardt Behm

Are you sure? Enable cycle time could be 500ns at 5V, look at page 52 of datasheet[1].

Are you sure? Look at Figure 25[1], data are valid at the falling edge of E signal.

[1]
formatting link
Reply to
pozz

An eternity.

Data should be valid for the whole E time. Look for the rising edge and

time of your signal source.

--
Reinhardt
Reply to
Reinhardt Behm

On 2021-09-21 pozz wrote in comp.arch.embedded:

Datasheet indeed says 500ns minimum. It ofcourse depends on the mcu what the actual timing is. 500ns is 'slow' for todays controllers, so I think you could do polling as long as you don't do too much else (depending on the speed of your mcu). But an interrupt may be a safer choice and makes other processing (outside irq) easier. But even with using an interrupt you have to make sure latency is small enough, especially if there are other interrupts.

Both is true: data is valid when E is high, but with a small delay (Tddr and Tdhr), so data is still valid on the falling edge. But you must be very fast in your response, minimum Tdhr is only 5 ns. This would require an awfully fast interrupt response. Setting an interrupt on the rising edge gives you another challenge: Tddr is 160ns max, so you may not actually read the data within 160ns of the rising edge of E. If you have a fast interrupt response, you may need to wait a little before reading.

Maybe an FPGA solution is easier for this problem. ;-)

have you already thought about the other end of the interface? How do you plan to get data to the TFT panel? And don't forget about the part in between, the frame buffer etc.

--
Stef 

Yow!  Those people look exactly like Donnie and Marie Osmond!!
Reply to
Stef

Il 21/09/2021 17:09, Stef ha scritto:

Immediately before the falling edge data must be valid, but they aren't valid immediately after the rising edge. So I don't think the sentence "data are valid when E is high" is correct.

So I think it's much more robust to read on the falling edge.

I got the point and indeed is critical. Maybe rising edge is better, because most probably MCU set data bits and after make a pulse on E.

Consider that the read operation for HD44780 will be a write operation for my interface. In other words, when a read operation is send from MCU, my interface should write on data bits.

Howevere your point is valid: my interface should write on data bits before Tddr, 160ns maximum, and this could be difficult.

Anyway read operations aren't usually used on this kind of applications.

I will send data to a serial port.

Reply to
pozz

[...]

It's not HD44780, but

formatting link

does exactly that for a 12864 LCD (which has a parallel interface with similar timing requirements). Look for "Marlin Mode" in the source code.

cu Michael

Reply to
Michael Schwingen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.