Hi All,
Full disclosure, I'm not actually connecting one of these displays to an Arduino, but to a TEC-1G, a Z80 based computer that talks to the LCD in Parallel mode. I hope you guys will allow me describe my problem here, as I don't have any other community to turn to.
We designed a carrier board for the 128x64 and with boards marked as "12864B-V2.0" everything works perfectly well. But if we try a display marked as "12864-20M" or "12864-21M", the display is scrambled and we suspect the display is in Serial mode. When we try to tie the BSP Pin#15 high, to put it into parallel mode, it makes no difference. We even try putting a little blob of solder on the P jumper that is connected to that BSP pin. No difference.
What are we missing? Is the -20M and -21M versions of this display able to be used in Parallel mode? If so, what is the secret sauce?
Just a SWAG, but I imagine if the display were in its "SPI-ish but not really SPI" mode, you wouldn't even be getting a garbled display. You'd get nothing. My totally evidence free suspicion would be that your code is violating some timing parameter on the new display. Data not being set up far enough in advance of some clock pulse, that kind of thing. I ran into an analogous situation with the character displays once upon a time. One display took almost twice as long to execute commands; turned out its clock was almost half as fast as every other display of its type.
OK, I'll have a chat to the developer of the code and see if can slow things down in terms of setting up the data, but wouldn't you expect the new boards to be even faster than the old ones? Also, the garbled display is EXACTLY the same, to the pixel, every time. If it was purely a "close but no cigar" timing issue, wouldn't you expect it to be a little randomised, a tad?
It depends. If you look at the ST7920 instruction set, it bears a remarkable resemblance to those of the HD44780 that's used in innumerable character LCD displays. And the vast majority of the commands execute in tens of microseconds - and generally the code waits more than long enough for those commands to complete. No harm, no foul. But the clear display and home commands take orders of magnitude longer - and if they get interrupted at exactly the same time each time... it's possible.
Anyhow, speculation is fun and all, but I've had all the fun I can handle today. Good luck figuring it out - I'm outta here!
PS And yeah, I'm with @Rintin: when slower equals cheaper equals more $$$... that's what you get.
Looks like these two sheets cover the two different sorts... Well, it's all I could find on the interwebs. QC12864B.pdf (511.4 KB) HTG12864-20.pdf (298.2 KB)
I've now tried 3 different displays that end in -20M or -21M... All three display exactly the same results. So not a loose connection or bad luck. It's either a timing problem (although I would expect to see the occasional difference in the bit pattern if so) or it is the display stuck in Serial mode. Still investigating.
But what I would like to know if ANYONE has ever been able to get the -20M or -21M versions working in Parallel mode. If someone can assure me that it is actually possible, then we can look into the timing issue or just stick to v2.0 displays.