Most Hackaday readers are likely to be familiar with character LCDs driven by the extremely common Hitachi HD44780 controller chip. If you’re looking for a cheap and easy way for your microcontroller project to display some data, they’re pretty much the go-to solution. But as popular as these displays are, there’s no denying that they’re starting to look a bit dated in 2020. Which is why the tweaks [Joseph Rautenbach] is working on are so interesting.
With one of these displays, the controller puts a single character on each 5×8 block of pixels. There’s also support for creating custom characters, which can be used for rudimentary icons. You’re pretty limited by the per-block resolution, but with a little imagination, you can usually get the point across. With a bit of dead space between each block of the display there’s little point in trying to make icons that “bridge” multiple blocks, as they’ll always be segmented.
But as [Joseph] realized, that’s less of a problem for scrolling text. So he wrote some code that takes an ASCII string and breaks it down into partial letters and numbers which can be displayed as custom characters. The controller only has space for 8 of these characters though, so the code needs to continually step through the string and generate the appropriate offset characters as the position of the text changes.
While the effect looks pretty good in the video after the break, [Joseph] has found that real-world utilization is a bit finicky. He tried the same code on one of the displays that uses white text on a blue background, and the scrolling text ended up ghosting together so it looked like gibberish. So while he’s released the source code for others to experiment with this trick, your mileage may vary.
This certainly isn’t the first time we’ve seen somebody make clever use of custom characters on the HD44780. We’ve seen it used for an exceptionally tiny game of Tetris, a rendition of Conway’s Game of Life, and even a horizontal space-shooter.
So the window of text is determined by the number of custom characters the display supports?
Yes
Yes, and no. Google “LCD megademo Hedelmae” and you’ll see that demo-coders have never let pesky HW limitations get in their way :-)
BTW this is a better demo scrolling graphics instead of blocks.
https://www.youtube.com/watch?v=pqv48FtHm0E
Demo Checklist…
Spinning Cubes: X
Starfield: X
Squelchy bass: X
Plasma fields: ?
Zooming fractals: ?
Landscape flyover: ?
Jumping letters in the longass credits and greets scroller that nobody sits through at the end: X
That video was quite inspirational in me thinking up this project. Quite amazing what they were able to do with eight custom characters :)
Well, the message length can be arbitrarily long (at least, as long as the Arduino has RAM to allocate via calloc.. there certainly are more efficient ways to do it :)), but only 40 vertical pixels (eight characters) can be displayed at any time.
You can get a bit “funny” by doing some smart stuff…. For example: The normal characters are 5×7, so have about a 6 pixel pitch. Now define a scrolling area of 9 characters. Now for the scrolling text, don’t put it at a 6 pixel pitch but at 7 pixels….. Now at least one of the characters in your scrolling text is a standard character, you don’t need a custom character! So you can still get by with just 8 custom characters.
Similarly, if you scroll the individual words across the screen instead of the whole text at once, you can scroll “Hello” across the whole screen and by the time the first characters are reaching the left side, you can start scrolling “world” in at the right.
Both the demo in the article and the “better demo” above, simply use 8 characters as a “graphical display” and do nothing fancy with the original text part of the chip.
Anyway, in modern times, just get a graphical display.
Nice post, takes me back, used heaps of those LCD modules on all sorts of microprocessors; Z8, 68705, 68HC705C8, 68HC11 & especially few type Atmel 8051 series. Worth doing some on the silabs series too in near future great experience.
Thanks for post :-)
Cheers
I had attached (Optrex) LCD modules directly onto embedded PC/XT ISA bus and 68HC11 2MHz bus while watching for the datasheet timing parameters. The BUSY flag is polled instead of timing loop and the LCD can be updated very quickly.
Nicely done. I tried this many years back (on a blue/white display as it happens) and junked it as unworkable. It’s nice to see that it works on others – it didn’t occur to me that different displays would vary (and I guess back then, they may all have been too slow).
Don’t forget the EPIC “LCD Megademo” & “Megademo 2” by Hedelmae. These are collections of nice, oldskool demo effects, rendered on HD44780 displays. They were released in 2003 and 2013, respectively. And they still look great! (YT video-links are available on the respective pouet pages)
[1] http://www.pouet.net/prod.php?which=10533
[2] http://www.pouet.net/prod.php?which=61643
I like the smoothness of the smooth scrolling text, but I don’t like that it’s scrolling at half the speed of the non-smooth text. I find it quite irritating to have to wait for some huge string of text to scroll slowly character by character past my eyes to get to the salient information often right at the very end. You’d expect the situation to be better these days with high resolution screens in nearly everything, but some companies are still doing it.
The upcoming QSX transceiver from qrp-labs.com uses the 1602 programmable characters to show a simple spectrum analyser that tunes the internal band-pass filter, as shown in the video below at about 6:30.
https://m.youtube.com/watch?v=_bMoR3Q6gzM