I have a project in which I wish to write a simple message to a standard 2 line by 16 character LCD. The initialization is ok, however, when I instruct my micro to print the characters with pauses in-between, it does so, however instead of the cursor advancing to the next position, it stays in the same position (first top-left position) and the next character overwrites the old character.
These are the commands and timings being issued to the LCD:
First I set LCD RS to 0 (command mode)
I issued command 38h three times with 40ms delay each time.
I add command 01h (to clear display) with 2ms delay.
I add command 0Fh (to show cursor, block cursor and turn display on) with 2ms delay.
I add command 06h with 2ms delay.
I set LCD RS mode to 1
Then I instruct the micro to print each letter of the test message with a 1ms delay then micro stalls until a key is pressed. After key press, the next character should be in position 2, not in position 1 (which overwrites first character).
Is there an LCD command I'm using that's incorrect or missing?
These are the commands and timings being issued to the LCD:
First I set LCD RS to 0 (command mode)
I issued command 38h three times with 40ms delay each time.
I add command 01h (to clear display) with 2ms delay.
I add command 0Fh (to show cursor, block cursor and turn display on) with 2ms delay.
I add command 06h with 2ms delay.
I set LCD RS mode to 1
Then I instruct the micro to print each letter of the test message with a 1ms delay then micro stalls until a key is pressed. After key press, the next character should be in position 2, not in position 1 (which overwrites first character).
Is there an LCD command I'm using that's incorrect or missing?