Adapter hardware

M66271FP

The M66271FP controller communicates information to the LCD via 4 data and 3 control lines.

Data is written out line by line, 4 bits (pixels) at a time, starting in the top left corner, working its way to the bottom right hand corner.

The updating of the LCD is continuous and not dependent on content change. Each line is transferred as a 40µs data burst consisting of 60, four bit nibbles, which makes up the 240 pixels each row consists of. There is a 84µs period of inactivity between the end of one line and the data burst of the next line. The LP line goes high at the end of the burst to mark the end of the line and the start of the period of inactivity. The start of the next row is indicated by LP going low.

This process is repeated 64 times to complete one frame, before it starts all over again.

A First Line Marker pulse goes high at the end of the first line, until the start of the second, to mark the start of a frame. This ensures vertical sync between the LCD and controller.


Adapter

The Surenoo 24064COG-40 replacement display uses an integrated ST75256 controller. An adapter is required to interface the ST75256 with the M66271FP.

The main tasks the adapter has to perform are:

  1. Monitor control lines and read data from the M66271FP and write it into an in-memory representation of the old LCD's display area.
  2. Read and process data from the in-memory representation, and write it to the ST75256.

Of the two processes, the first is the more time critical as any data or control information missed will result in an unstable display. The periods of inactivity following a data burst at the end of each row, simplifies design as it means the adapter can take turns between monitoring and reading incoming data, and processing and writing outgoing data.

Hardware

The timing requirements to reliably monitor control lines and read data from the M66271FP is beyond the capability of most Arduinos, but can be met by one of the STM32F103C8 based Arduino-like clones. For this project, an inexpensive (less than US$2) micro controller from AliExpress, commonly know as a "Blue Pill"., was used.

The diminutive on-board 3.3V voltage regulator of the "Blue Pill" is incapable of powering the LCD as well. The problem was resolved by adding an external voltage regulator which connects through the power pins of the programming port.

LCD Contrast

The Surenoo 24064COG-40 lacks an analog contrast control. The ST75256 instead manages contrast adjustments through software. By connecting the analog contrast line to one of the "Blue Pill"'s analog input pins, an indication the current contrast setting could be obtained. This value could in turn be used to control the contrast software setting. The need for contrast adjustment appears to be less of a necessity on the replacement display, so probably not really required.

The only additional component required to read the contrast value, is a resister, shown as R2 in the diagram below. It is a pull-up resistor to keep the voltage fed to the ADC from going negative.

The adapter is mounted conveniently close to the main board's LCD connector. The connection between the adapter and Z1 is via the old connector cable, cut to length and with an appropriate plug attached. The connection to the LCD is via a custom ribbon cable. Note that though the LCD provides for a 20 pin connector, a 16 pin connector was used instead, skipping the first 4 pins. Pins 1 through 4 have to do with font selection and is not relevant in this application.

The image above shows the ribbon cable connecting to the replacement LCD module.

The black ferrite suppression choke on the ribbon cable is not really required. It was just a handy way to keep the fraying cables together.