Smooth(er) Text Scrolling On HD44780 LCDs

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.

Hardware support is not guaranteed.

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.

14 thoughts on “Smooth(er) Text Scrolling On HD44780 LCDs

        1. 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

    1. 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.

      1. 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.

    1. 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.

  1. 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).

  2. 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.

Leave a Reply to Alphatek Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.