LCD Display for DOT Matrix emulation
For DMD screens
128 x 32
128 x 64
This project is directly derived from the DMD3264 project from which it takes the main features.
The main difference is that the screen is no longer driven by a "physical" DMD interface (2x7 connector), but through a serial interface (or an USB port). Thus, the screen can be used with an emulator like VPinMame, or controlled by an Arduino.
The idea here is to simply have a small LCD screen for testing or secondary viewing. It is in no way a question of replacing an original screen and even less of using it in a Pincab! Similarly, no colorization has been implemented, apart from the choice of a palette, this not being at all the desired objective.
On the other hand, in terms of compactness and low cost, this project fulfills its mission perfectly.
Even more "low-cost" version
As for the DMD3264 project, we use a SiPEED TANG NANO 1K module, integrating a GOWIN GW1NZ-LV1 FPGA.
But this time, nothing else is needed (except from a solder wire on the module!).
Serial and USB interface
So that the use of the assembly remains simple, we opted for a classic "VCP" (Virtual COM Port), in other words, a serial interface. The counterpart of this simplicity, however, requires connecting a wire between two pins of the module.
The SiPEED TANG NANO 1K module has a BL702 circuit connected to the USB port. This is programmed to provide both a JTAG interface and a serial interface. The JTAG interface is connected internally on the FPGA, while the serial interface exits on separate pins (23, 26 and 27 of the module). As far as we are concerned, the pin delivering the TX signal is the one marked 26 (BL_IO26).
On the FPGA, the pin that has been programmed for serial input is 39. It is therefore necessary to solder a wire to connect pins 26 and 39.
Be careful not to use a wire that is too big, which could block the entry of the FPC connector and prevent the connection of the LCD cable.
If you want to use an external serial interface (for example an Arduino), you just have to inject the signal on pin 39.
WARNING: the allowable voltage for the FPGA is 3.3 Volts. Often, "Arduino" type modules use 5 Volts and it is then necessary to insert a level adapter. This could for example be a simple CD4050, as used in the DMD3264 project.
We studied the possibility of using the internal JTAG connection between the BL702 and the FPGA, but this option was ultimately not retained. Indeed, if this solution has the advantage of not having a wire to solder, it effectively excludes the possibility of injecting an external signal. On the other hand, it requires the use of the D2XX API (FTDI) and the MPSSE protocol. It also involves the use of an additional DLL and more complex programming. All in all, the VCP solution is much more practical and open, even if you have to add a wire between pins 26 and 39.
They were made on a 5" screen (the defects and reflections come from the touch sensor and the protective sheet left in place) and the images are produced by the VPinMame emulator.
In 128 x 32 mode:
VPinMame not producing (yet!) an image in 128 x 64 format, we used a slightly modified version of our DLL, in order to send the module a double buffer. The 128 x 32 image therefore appears duplicate here, but the module does process a 128 x 64 image.
In 128 x 64 mode:
For more details on the installation, operation of the moduleand protocol used, refer to the documentation (multilingual):
Implementation and realization
The position of the FPC connector and the Kapton cable of the LCD are quite restrictive for the installation of the interface. It is indeed necessary to connect the screen to the module, while keeping access to the buttons and the visibility of the LED. The chosen solution is to fix everything to the back of the LCD, which has the advantage of being very compact. The Kapton cable is immobilized on the back of the LCD by adhesive tape, which protects and insulates it.
The TANG NANO 1K module can thus be plugged in the right way.
The easiest way to attach the module to the back of the screen is simply to glue it. Another equally effective solution is to use double-sided "foam" tape.
Files to program
The GOWIN FPGA programming software requires two files:
- An ".fs" file containing the component's synthesized architecture.
- A ".fi" file for initializing the FPGA flash memory.
For the curious, know that the two ".fs" and ".fi" files are of the "text" type and are perfectly readable with an editor. The ".fi" file contains the definition of the palettes as well as some parameters.
The two ".fs" and ".fi" files are delivered in an archive (.zip) to be unzipped.
128 x 32
800 x 480
128 x 64
800 x 480
DLL for VPinMame
When launching a game in VPinMame, you can specify the use of an external screen by checking the "Use external DMD (dll)" box. The emulator will then use a "DmdDevice.dll" (or "DmdDevice64.dll") DLL to communicate with the PinLCD screen.
Download and extract the zip archive below. It contains two ".dll" files which must be placed in the VPinMame directory.
A few comments :
- The DLL works regardless of the version (128x32 or 128x64) of the connected module.
- This is recognized automatically, there is nothing to configure.
- The resolution used by the game must match that of PinLCD (128x32 or 128x64). Games with numeric, alpha, dot 128x16, 192x64, or 256x64 displays are not supported.
- Brightness levels are four in 128x32 (0%, 33%, 66%, 100%) and three in 128x64 (0%, 50%, 100%). A transposition is performed when the game uses more levels.
- The 128x64 version is experimental (VPinMame does not support this resolution yet).
Simultaneous display on VPinMame and PinLCD:
Example of external control by an Arduino
The injection of a signal coming from an external source is not very complicated to implement. Here is an example using a small Arduino Nano (ATMega 328P) and displaying images stored in its internal memory.
The Arduino Nano using 5V signals, it is imperative to insert a voltage converter. A simple CD4050 will suffice, of which only one output will be used.
The SiPEED TANG NANO 1K module must be supplied with 5 Volts. For practical reasons, here, it will be directly powered by its USB-C socket. We will take the 3.3 Volts to power the CD4050, and we will inject the serial signal into pin 39. Of course, we must not forget to connect the masses.
The connections to the CD4050 are really minimal and on the Arduino Nano one will only need to connect ground and the TX serial output signal.
Demonstration on Arduino
in 128x32 and 128x64:
The demo program easily fits into the memory of the ATMega 328P. We take advantage of the large flash memory capacity of the circuit to place all the images there.
This achievement is available for free.