
The trend of import substitution pushed to test the character LCD indicator from the company MELT. We took the
MT-16S2S on ST7070. In some ways, this is an analogue of the well-known WH-1602 at 44780. And it also supports SPI mode.
MELT also collects displays on the domestic controller KB1013VG6 from Integral. It has a difference in operation in 4-bit mode from the already standard 44780.
On the manufacturer's website there is an example of code for working in different modes. But it is written in assembler and under an abstract platform in a vacuum. Redoing it on the STM - anyway, what to write again. The experience of using ready-made libraries even for the common 44780 I, too, cannot be called positive. They have to edit for a long time under the desired platform and controller model. And most of them use the delay function under AVR, which “for some reason” is not provided for STM. And even what started up, works very badly, then deducing it, then hanging. Therefore, it was decided to write your own library.
')
In addition, the MT-16S2S has another feature: the SPI interface, which reduces the number of controller legs used to 4. So, the output will be organized through SPI.
The command system is described in some detail. In general, in the whole present situation, when there is almost no domestic electronics in life, I am very pleased, although it is unusual, to read the description of microchips and other products in Russian (not translated from English or Chinese like “Balsam tiger white drops death construction protein”). True, sometimes there are such pearls that you think “it would be better in English”. But here it is all right.
Connection is almost standard. VCC, E, D0-D4 on plus power, A0, GND, R / W and PSB to ground; Connect to the controller: D5– to CS, D6– to SCK, D7 – to MOSI, XRES– to any GPIO. I connected to MISO, because I still manage it programmatically. On the website in the description, by the way, the wrong scheme is shown. It is indicated that the D5 pulls up to the power plus, but this is CS. The forum wrote that they know about it, but so far nothing has been fixed.
The outputs for the backlight can be left free, but it is better, of course, to work with the backlight, and to do this, connect the anode through a 10-30 ohm resistor to the power supply and the cathode to the ground. The output for contrast control, oddly enough, on the 5-volt indicator does not control anything. I just left him hanging in the air.
Another interesting feature is the presence of two pages of character generator. Because of this, you can display on the display a huge amount of
unknown garbage a wide variety of characters.
But if you chose the "domestic" display to work with the Cyrillic alphabet, a surprise awaits you. Russian letters that do not have analogues in Latin, located on the first page. And the numbers and Latin - at zero. And to bring them together, you have to switch between pages. So no whole line output will work.
In this respect, the display from Winstar is more convenient. Let him not so many characters, but they are on the same page.
But 90% of the MT-16S2S character generator will not be needed by the Russian person. Another trouble for the programmer is the designation in the datasheet of the coordinates of the characters in the table with ones and zeros by nibbles. It is even more fun to designate them as H and L. That is, the symbol number will be, for example, 1111 + 1101 or HHHH + HHLH.
Why not use a developer-friendly hexadecimal code 0xFD? And after all on some displays such tables are. Is it really so difficult to make a convenient grid?
Now about the library. The following requirements were for functionality:
1. Output a symbol from the table to an arbitrary position;
2. Displaying a line of text in an arbitrary position;
3. Write to the memory of your own character;
4. Cleaning the display, turning the cursor on and off, its shift, shift of the display area and other indicator settings.
All this managed to be implemented fairly quickly. But still straining the need to constantly switch between the pages of character generator when using Cyrillic. I do not post the library itself, because it is made “for myself”. With all the flaws and crutches and for a specific chip: with wired ports and frequencies (since the goal was not to create a commercial version with card games and women, the port settings, SPI and delays are spelled out directly in the functions themselves, depending on which controller and to which SPI the display is connected). In the future, its finalization is planned.
Now about the operating experience of the display. It has been tested and works stably in the temperature range from -20 ° C to + 60 ° C. True, at -20 ° C begins to slow down when changing images. But there's nothing you can do. Just switch to another type of indicator.
In general, the impression is positive. Some minor bugs in the description of the display and the absence of normal code examples interfere. The rest is not bad. Even the price is not higher than the Winstar equivalent of WH-1602.