My Projects

This is an old revision of the document!


Published 15 Jan 2019

Mx300 Driver Library


I have a few LCD display panels from Canon printers like the MX300 and MX310 that I wish to use in Arduino projects. These are 2 line by 20 character LCD status displays that have no horizontal gap between the two rows of characters. This suggests possibilities of creating double height characters that look natural. Some of the character sets/fonts implemented here could be used on other 2 line LCD displays, and some rely on the existing inbuilt character set. I have not determined which Hitachi HD44780 compatible LCD controller/driver chip that they use.


Overview

I looked for an Arduino library that would display double height characters and found quite a few, I have taken ideas from various fonts/character sets but re-implemented the actual driver code.

I based my library module for this on a standard Arduino library for the Hitachi HD44780 chip, LiquidCrystal.cpp. The programs included here are HelloWorld_mx300.ino, LiquidCrystal_mx300.cpp and LiquidCrystal_mx300.h.

The command set is compatible with the Hitachi HD44780, but I don't know the model of the chip, or even the manufacturer.

Hardware description

LCD pixel layoutThe controller is mounted directly on the LCD glass (CoG), and the LCD module has a 14 pin, 0.04” pitch, pcb flex cable. The displays are a two lines of twenty, 5 by 8 pixel, characters with no gap between lines.

I experimented a little, but could not get the modules to display a 5 by 11 character mode. I have no idea whether the modules have inbuilt double height characters, I have no idea of the controller chip they use. I do note that the Canon MX300 printers display double height numeric characters mixed with normal characters - I expect they are using the programmable character set to do this.



Arduino to LCD wiring

As used in the Canon MX300 printer these displays use 3.3V for command and data lines and have a separate 5V line for the LCD power. The interface control lines are standard Hitachi HD44780 compatible, with a choice of connecting either 8 or 4 data lines. For testing I used level converters to connect to a standard 5V Arduino, you could of course just use a 3.3V Arduino board.

There was no contrast adjustment on these modules (it may be a command programmable feature).

The control and data pins can be any available Arduino pins.

LCD Library

As mentioned earlier the library is based on a standard Arduino HD44780 LCD library. Most hardware commands, including programmable characters, seem to be compatible with the Hitachi HD44780. I did find commands for transforming the orientation of the display, you can reflect it horizontally, vertically or both at once (equivalent to a 180 degree rotation) , but I would need to do a lot of experimentation to find all the extended commands.

There are a number of different implementations here, reflecting different approaches :

  • A set of double height digits just using the programmable character set
  • A set of double height digits minimising the number of programmable characters used
  • A set of double height digits which are stretched versions of the normal digits, dynamically reprogramming the programmable characters as required. This produces more natural looking digits but limits us to displaying four double height digits at a time (two programmable characters per digit, this may be what the Canon MX300 printers do too). This could be extended to a full character set, but still limited to four double height characters at a time (you can display the same character repeatedly, but only four unique characters).
  • A complete set of double height characters, up to 4 normal character spaces wide. Created using a fixed set of programmable characters, plus some existing characters, as segments of each double height character.

The drivers still contain the standard Hitachi HD44780 functions, but some are not really applicable to the double height characters. The functions implemented that are specific to these modules and displaying double height characters are:

  • begin(col,row)
    • Initializes the display, usually done once in a sketch's setup() routine.
  • clear()
    • Clears the screen of all pixels and homes the cursor.
  • home()
    • Sets the location for next data output (cursor location) to 0,0 and clears any display shift.
  • display();
  • noDisplay();
    • Turns the display on or off.
  • setCursor(col, row)
    • Set location for next character to be displayed.
  • scrollDisplayLeft()
    • Scroll current line one character to the left.
  • scrollDisplayRight()
    • Scroll current line one character to the right.
  • autoScroll()
    • Automatically scroll when the cursor reaches the far edge of the display.
  • noAutoscroll()
    • Turns off autoscroll.
  • clearBigfont()
  • setBigfont()
    • Display the next characters as normal or double height characters.
  • noMirror();
  • mirrorHorz()
  • mirrorVert();
  • rotate180();
    • Set orientation to normal or transform the orientation without changing the contents of the display.

The autoscroll() function doesn't use the controllers autoscroll feature, but implements it using leftshift commands and will allow you to continue printing and scrolling 65365 characters in a ticker tape display before glitching. Or you can fill the 40 character buffer (about 10 double height alphanumeric characters) and scroll a banner using scrollDisplayLeft() or scrollDisplayRight() as long as you like.

The existing functions that are still there, but may have unwanted side effects when used with double height characters are:

  • blink();
  • noBlink();
    • Turns the blinking cursor on or off.
  • cursor()
    • Show cursor at location ready for next character.
  • noCursor()
    • Turn off cursor display.
  • leftToRight()
    • Normal Western language display mode where words are written starting at the left of the display.
  • rightToLeft()
    • Mode used for Japanese and other languages where characters are written starting at the right of the display.
  • createChar()
    • Programs one of the 8 user defined, 5×8 pixel characters.

The functions appear to be the same as for the HD44780 but have not been extensively tested for compatibility.

I finally realised why I sometimes had trouble setting the programmable characters (only 4 available on these chips) - after setting a programmable character future writes also go to the programmable character CGRAM (corrupting it) until you deliberately switch back to the display ram. This is a problem from the original LiquidCrystal.h library - the solution here is that I just reset the cursor to the home location after programming characters.

Font1 test

Font2 test
Two font versions displayed by the HelloWorld_mx300.ino program


The programs (v1.00):

References and Additional Resources

Other Arduino LCD drivers

  • METP0000, NEC µPD7225 based LCD display panel Arduino driver
  • NEC µPD7228 and μPD16434 LCD display panels Arduino driver
  • Toshiba T6A34 SPI, HD44780 compatible, LCD display panel Arduino driver

If any referenced page no longer exists, try looking for its URL on http://archive.org.