Clarifications on LCD display

Thread Starter

Vihaan@123

Joined Oct 7, 2025
222
I have few clarifications on the LCD display programming.
a. I have seen instructions to write to LCD instruction register 0- single line 1 - 2 lines, but i am using 4-line display (20*4), so the command basically is not applicable?
b. The meaning of scrolling message - I have 20 characters the purpose is to scroll only these 20 characters? But i have more than 20 characters can i display them by using scrolling by writing all the characters once? I am bit confused with meaning of scrolling.
c. In LCD we require very small delays, what is the recommendation to obtain these delays in PIC controllers, using timers or for loops? I always heard of recommendation of not to use for loops.
 

Irving

Joined Jan 30, 2016
5,014
I have few clarifications on the LCD display programming.
a. I have seen instructions to write to LCD instruction register 0- single line 1 - 2 lines, but i am using 4-line display (20*4), so the command basically is not applicable?
b. The meaning of scrolling message - I have 20 characters the purpose is to scroll only these 20 characters? But i have more than 20 characters can i display them by using scrolling by writing all the characters once? I am bit confused with meaning of scrolling.
c. In LCD we require very small delays, what is the recommendation to obtain these delays in PIC controllers, using timers or for loops? I always heard of recommendation of not to use for loops.
Hi Vihaan,

What display are you using, sounds like the 4-line variant of the venerable 1602 20ch x 2line LED/LCD display, rather than a more modern TFT/OLED I2C or SPI 320 x 240 pixel (or bigger) display.

This, along with everything else in your project, would benefit from a separate display task instead of trying to put everything in a huge 'main' loop which will become a nightmare to debug.

scrolling on these displays can be set up to happen automatically when you send another character, either overall or on 1 line. Everything moves one character left on one line or like a snake across the whole display - add new character bottom right, lose one top left.
 

Reloadron

Joined Jan 15, 2015
7,866
I have few clarifications on the LCD display programming.
a. I have seen instructions to write to LCD instruction register 0- single line 1 - 2 lines, but i am using 4-line display (20*4), so the command basically is not applicable?
b. The meaning of scrolling message - I have 20 characters the purpose is to scroll only these 20 characters? But i have more than 20 characters can i display them by using scrolling by writing all the characters once? I am bit confused with meaning of scrolling.
c. In LCD we require very small delays, what is the recommendation to obtain these delays in PIC controllers, using timers or for loops? I always heard of recommendation of not to use for loops.
What are you driving the display with? Many of these displays now include an I2C interface, does yours? Depending on what you have writing the code is not that difficult. Tell me how you are driving it. If using an Arduino or similar I can give you code samples. Not that much different be it 2 line or 4 line.

Ron
 
Top