HD44780 Based LED Display: Scrolling Text False Start - Page 1
Forum section: electronics / general

author: EPAIII
author_rank: Super Contributor
timestamp: November 21, 2014, 07:29:04 pm
content: I have been experimenting with scrolling text on some HD44780 based LED displays of various sizes. The commands I talk about below are those for that device, not any particular PIC code.I first clear the display and home the cursor sending a 01 command to the display. Then I change to One Line mode with a 48 command. A long text message is then sent to the display using the data mode in a loop to send all the characters. This message is 72 bytes long and should be going into LCD RAM locations 128 through 199.At this point I have tried a number of commands to reliably reset the active window to the start of my message, but none of them seem to work for all the different displays I have tried this on. On some of the displays nothing works.Then the text is scrolled using the Pan Right command: 24 in a loop that repeats it 136 times to display the complete message two times. The scrolling does work, but some times it starts at the beginning of the message and other times it starts at the 41st character. This action seems to be random.As I stated above, I have tried inserting several different commands just before the scrolling routing but none of them have worked. These commands include repositioning the cursor to position 128, the start of the first line, homing the cursor (2), and adding a cursor right and a cursor left command after that. None of these measures seems to have any effect.Does anybody know of a reliable way to have this scrolling message always start at it's beginning? If possible, I need a solution that works on all HD44780 based displays. I know that is a tall task and may need to use different approaches for different displays.I know some are concerned about questions that are posted to multiple forums so I will state that I am posting this to several boards as I feel that it is a difficult problem and the more exposure it has, the better the chances of getting a good answer. I will post any working solution that I find to all the boards.

author: dannyf
author_rank: Super Contributor
timestamp: November 21, 2014, 08:49:38 pm
content: It may help you if you can state clearly what effect you are trying to achieve.

author: EPAIII
author_rank: Super Contributor
timestamp: November 25, 2014, 08:47:32 am
content: What effect am I trying to achieve? I am trying to scroll a message that is too long to be displayed on the LCD's screen at once. In other words, a message that is longer than 16 or 20 or 24 characters, depending on the display size.I am writing a program the demonstrates all the capabilities of these displays. And ideally, it should work on displays of different sizes, that use the HD44780 control chip, perhaps from 16 X 2 up to 24 X 4.I wanted a section of my program to demonstrate scrolling. I guess I could have used two messages with a rapid scroll between them, but instead I choose a single long message that rolls across the screen at a speed that can be easily read. I was quite surprised to find that the message will start correctly at the beginning some times and not others. I have not been able to identify any reason for this behavior.

author: DJohn
author_rank: Regular Contributor
timestamp: November 25, 2014, 01:22:01 pm
content: I haven't used scrolling on these displays before, but from my reading of the datasheet you're doing everything right. Both clear and home should reset the scroll.Are you definitely switching to one line mode before you write the data? In two line mode only addresses 0x00 to 0x27 are valid for the first line. I've no idea what happens if you try to write past that, but it can't be a coincidence that the character you write to 0x28 is the 41st.Switching to 1 line is a fast command (37us). But it can't hurt to check that you're waiting on the busy signal.

author: EPAIII
author_rank: Super Contributor
timestamp: November 26, 2014, 09:34:05 am
content: DJohn,I am sending the following commands in this order:LCD Command 01 (Clear and Home Cursor)LCD Command 48 (8 Bit Mode/1 Line)LCD Data "Now we demonstrate scrolling a message that is too long for the display."LCD Command 24 (Pan Right)The Pan Right command is sent 136 times in a For/Next loop with a 250 ms Pause following each one to allow the message to be read as it scrolls. This scrolls it across the screen two times.I have tried adding delays both after the 01 command and after sending the data. Neither seemed to make any difference. I also tried sending several commands just before the Pan Right loop, including a 02 which should home the cursor, a 12 which should turn the display on and the cursor off, and a 128 which should send the cursor to the start of Line 1. As I understand it, the 128 should be the equivalent of the 02, but perhaps there are subtle differences.Is there any way of setting the viewing window other than the Pan commands? They only work in a relative sense and my message seems to start at one of two different positions in a random manner. I need a reset to a fixed position, not just relative motion.Oh, somewhere along the line I also tried both a 128 and a Cursor Right followed by a Cursor Left before using the Pan Right loop. It also made no difference.

author: f1rmb
author_rank: Regular Contributor
timestamp: November 26, 2014, 10:05:38 am
content: Hi,Quote from: EPAIII on November 26, 2014, 09:34:05 amHave you tried to read the arduino's LiquidCrystal (which supports the Hitachi chip) library code ? That could helps you.Cheers.---Daniel

author: DJohn
author_rank: Regular Contributor
timestamp: November 26, 2014, 02:33:04 pm
content: Quote from: EPAIII on November 26, 2014, 09:34:05 amNot that I've found, except for clear and home. But if they worked as documented, you wouldn't have a problem.

author: EPAIII
author_rank: Super Contributor
timestamp: November 27, 2014, 04:24:20 pm
content: QuoteThere has been an active discussion of this on the PICAXE forum and I have done a series of tests, all to no avail. Shorter message, fewer Pan Right commands, infinite loop of Pan Rights, stopping immediately after sending text data to confirm the location of the window, and more. All confirm the problem. The infinite loop of Pan Rights showed that there was no limit to that number.I am starting to suspect a defect in some of the HD44780s or perhaps their clones. It just does not work right. I am compiling a list of which, of the displays that I have, show this behavior.

author: lapm
author_rank: Frequent Contributor
timestamp: November 27, 2014, 10:02:45 pm
content: i believe HD44780 docent support scrolling in pixel level you are asking for.Most likely you need make your own control system with led matrix display to archieve this...