Hello all,
I got a bunch of parts from a friend and in it was an 2 LCD displays. The numbers on the back MTC-C204DPLY-1N.
I found the spec sheet for the unit.
http://www.mpja.com/download/14194op.pdf
Has anybody used this display before?
Seems a bit complicated to get it setup.
Thanks
Patrick
LCD Display
I took a quick look at the documentation and it looks like a standard 4/8 bit parallel interface. Using the 8-bit interface is slightly simpler but it does require more lines. In either case, you can reduce the number of ZX I/O lines by employing a shift register or other techniques.
My Reflow Toaster Oven project contains a module named LCD4P.bas that implements the 4-bit parallel interface. The code does not use all of the features of the display but it may serve as a good starting point for you. The schematic contained in the .zip file attached to that post shows the straightforward way to connect the LCD.
If you have additional questions, let me know.
My Reflow Toaster Oven project contains a module named LCD4P.bas that implements the 4-bit parallel interface. The code does not use all of the features of the display but it may serve as a good starting point for you. The schematic contained in the .zip file attached to that post shows the straightforward way to connect the LCD.
If you have additional questions, let me know.
- Don Kinzer
Don's suggestion is a good one.
Another alternative is to use a separate serial to parallel LCD Driver. Most 2 line text LCDs either use the HD44780 controller, or a compatible variant. It is, essentially, the de facto standard.
This only requires 1 port, (serial TTL output) to the driver chip, which then connects to the LCD. You then send print commands to the driver, which does the work for you. This saves ports on the ZX, and the trouble of doing the low level interfacing yourself.
Nuts & Volts Magazine, may/might/could possibly be running an article in the Sept issue on two serial to parallel LCD drivers. The article got bumped from the Aug issue.
The less expensive chip is about $6.95, and is a pic programmed in Basic. It has several extra ports available with "print" commands to turn on & off several LEDs, in addition to displaying data on the LCD.
Another, pre-programmed version of this same concept is also available from Kronos Robotics. A pre-programmed "Athena" chip LCD driver is available.
If you have the pins available, and want to tie the LCD directly to the ZX, then google HD44780 for a bunch of interface references.
I found these two helpful:
http://www.myke.com/lcd.htm
http://home.iae.nl/users/pouweha/lcd/lcd0.shtml
Good Luck
JC
Another alternative is to use a separate serial to parallel LCD Driver. Most 2 line text LCDs either use the HD44780 controller, or a compatible variant. It is, essentially, the de facto standard.
This only requires 1 port, (serial TTL output) to the driver chip, which then connects to the LCD. You then send print commands to the driver, which does the work for you. This saves ports on the ZX, and the trouble of doing the low level interfacing yourself.
Nuts & Volts Magazine, may/might/could possibly be running an article in the Sept issue on two serial to parallel LCD drivers. The article got bumped from the Aug issue.
The less expensive chip is about $6.95, and is a pic programmed in Basic. It has several extra ports available with "print" commands to turn on & off several LEDs, in addition to displaying data on the LCD.
Another, pre-programmed version of this same concept is also available from Kronos Robotics. A pre-programmed "Athena" chip LCD driver is available.
If you have the pins available, and want to tie the LCD directly to the ZX, then google HD44780 for a bunch of interface references.
I found these two helpful:
http://www.myke.com/lcd.htm
http://home.iae.nl/users/pouweha/lcd/lcd0.shtml
Good Luck
JC
I had not seen the Athena-based device.
One is $11, and the other is $20. It is not clear exactly what the difference is. Both are assembled and tested. I think the connectors are more complete on the more expensive one. It looks as if the back light is NOT controlled by the device, but it holds resistors for passive control.
I have successfully used the SparkFun serial backpack device ($15). It supports 2,4 lines and 16,20 characters, and is supposed to drive the backlight. The one I have is not on an LCD equipped with a back light, so I do not know how well it works. The last generation of its software apparently had a problem with the backlight. The new generation supposedly has this fixed up.
If you do get the SparkFun device, it can be bought built onto an LCD. But if you ever plan on moving it to a different LCD, buy them separately. The combo is soldered together and the controller ONLY supports the exact size of the display (in my case 4x16).
-Tony
One is $11, and the other is $20. It is not clear exactly what the difference is. Both are assembled and tested. I think the connectors are more complete on the more expensive one. It looks as if the back light is NOT controlled by the device, but it holds resistors for passive control.
I have successfully used the SparkFun serial backpack device ($15). It supports 2,4 lines and 16,20 characters, and is supposed to drive the backlight. The one I have is not on an LCD equipped with a back light, so I do not know how well it works. The last generation of its software apparently had a problem with the backlight. The new generation supposedly has this fixed up.
If you do get the SparkFun device, it can be bought built onto an LCD. But if you ever plan on moving it to a different LCD, buy them separately. The combo is soldered together and the controller ONLY supports the exact size of the display (in my case 4x16).
-Tony
4 line lcd display
I got a LCD serial display backpack from Scott Edwards Electronics, and it seems to work. Now my only problem is addressing the last 2 lines.
The code I am using is: (Provided by Don K) thanks
If I make any mods to this my display gets all messed up. I know I am missing something simple.
http://www.seetron.com/pdf/bpk_mnl.pdf
Thanks yet again
Patrick
The code I am using is: (Provided by Don K) thanks
Code: Select all
Call LCD_DisplayStrAt((fmt(OutCurrent,3)), 3, 13)'Display current row 2 Col 10
The line above overwrites my current label on line 2 of the display, it should display on line 3
Public Sub LCD_DisplayStrAt(ByVal str as String, ByVal row as Byte, ByVal col as Byte)
Call LCD_SetPos(row, col)
Call LCD_DisplayStr(str)
End Sub
Public Sub LCD_SetPos(ByVal row as Byte, ByVal col as Byte)
If ((row >= 1) And (row <= 4) And _
(col >= 1) And (col <= 20)) Then
Call sendCmd(IIF(row = 1, 128, 192) + col - 1)
End If
End Sub
http://www.seetron.com/pdf/bpk_mnl.pdf
Thanks yet again
Patrick
As originally written, the code only supported a two line display. Extending it for additional lines is fairly straightforward - just add the code to compute the starting address of the additional lines. Here's what I would suggest:Now my only problem is addressing the last 2 lines
Code: Select all
' modify these values to match your display
Private Const LCD_ROWS as Byte = 4
Private Const LCD_COLS as Byte = 20
Private rowStart as ByteVectorData({ 128, 192, 148, 212 })
'----------------------------------------------------------------------
'
'' DisplaySetPos
'
' Set the cursor position to the given row and column, both
' of which are 1-based.
'
Public Sub LCD_SetPos(ByVal row as Byte, ByVal col as Byte)
If ((row >= 1) And (row <= LCD_ROWS) And _
(CInt(LCD_ROWS) = UBound(rowStart)) And _
(col >= 1) And (col <= LCD_COLS)) Then
Call sendCmd(rowStart(row) + col - 1)
End If
End Sub
Note that the added condition in LCD_SetPos() isn't strictly necessary and the compiler will optimize it away if the number of entries in the rowStart array matches the number of rows. Including it has the benefit of making the routine not work at all if the data values don't match.
Last edited by dkinzer on 15 August 2006, 9:56 AM, edited 1 time in total.
- Don Kinzer
It just occurred to me that the code could be made slightly more efficient by changing the rowStart values to represent zero-based addresses. This eliminates the need to subtract 1 from the column number.
Code: Select all
' modify these values to match your display
Private Const LCD_ROWS as Byte = 4
Private Const LCD_COLS as Byte = 20
' zero-based addresses of the first column of each row
Private rowStart as ByteVectorData({ 127, 191, 147, 211 })
'----------------------------------------------------------------------
'
'' DisplaySetPos
'
' Set the cursor position to the given row and column, both
' of which are 1-based.
'
Public Sub LCD_SetPos(ByVal row as Byte, ByVal col as Byte)
If ((row >= 1) And (row <= LCD_ROWS) And _
(CInt(LCD_ROWS) = UBound(rowStart)) And _
(col >= 1) And (col <= LCD_COLS)) Then
Call sendCmd(rowStart(row) + col)
End If
End Sub
- Don Kinzer