I would like to know why after E is printed in the 2nd line completely, after some time why it starts to print on first line too.
Simulation: Ive used the Proteus Version 8.16
Compiler: CCS Compiler 5.008
P.S Im a new joiner to this forum. So if there are any mistakes, please let me know. Ill try to follow the rules next time
You mean like 0x04(It used to change location of a cursor to left side) and 0x06(It changes the position of cursor to right side) right? Thanks a lot...
Typically, the LCD controller IC may have 80 (or more) bytes of RAM, with the first line starting at 0x00 and the second line staring at 0x40 for a two-line display.
That allow for wider displays and more lines of text with the sam IC, depending what the character layout of the glass LCD itself is.
To set the write address, the command is usually 0x80 plus the address, so eg. 0x80 sets address zero, start of the first line, & 0xC0 sets addess 0x40, start of the second line.
Four line displays may use out of sequence start addresses for the lines...
Can you please tell whats the correct order? This is how I've considered so far. Feel free to tell make what changes need to made.
1) 0x38 - 2 Rows 3x7/8 Matrix
2) 0x0E/F - Display ON, Cursor Blink/Not Blink
3) 0x80/0xC0- First Row or Second Row
rjenkinsgb Also, I have noticed this. When I use a big string and want to it keep displaying in the first row, some of the end part doesnt display. What is the reason this is occuring. And how to fix this type of situation?
When I say exact.. The LCD should automatically run in 8bit but proteus needs to see it for simulation
1 must always be function set with lines set to 0 or 1, then cursor... display on/off etc..
Are you scrolling the text? as that model only shows 16 digits in a row.
When I say exact.. The LCD should automatically run in 8bit but proteus needs to see it for simulation
1 must always be function set with lines set to 0 or 1, then cursor... display on/off etc..
Are you scrolling the text? as that model only shows 16 digits in a row.
Yes. I am scrolling the text and Only "LINE ONE OF THE LCD DISPL" seems to print. If you see the SS attached in this post, I've taken a simple example of a string with 26 characters which as "a-z" and the LCD seems to only print from "a-y". Cant understand what the issue is.
char a~z is 26 characters, BUT a string needs a terminator so use "char a[27] "
Also I see you are using CCS.. Its not good practice to declare variables in line.. That is a C++ trait and if you use any other compiler it will complain.. I'm surprized that CCS is letting that happen.
char a~z is 26 characters, BUT a string needs a terminator so use "char a[27] "
Also I see you are using CCS.. Its not good practice to declare variables in line.. That is a C++ trait and if you use any other compiler it will complain.. I'm surprized that CCS is letting that happen.
Okay looking at the arduino example they are printing the full string to the DD ram.
You need to write the whole string to the screen, only then can you send the autoscroll command.
If you write the character one by one AND autoscroll at the same time the result will no be what you want.
write a string to screen function. and write the data first
Okay looking at the arduino example they are printing the full string to the DD ram.
You need to write the whole string to the screen, only then can you send the autoscroll command.
If you write the character one by one AND autoscroll at the same time the result will no be what you want.
write a string to screen function. and write the data first
So to reconfirm. You're telling me that if I want to display a-z and scroll then like print 'a' on 0x8F(First Row Last Column) then move it to the left one column, then print 'b' on 0x8F and move it left one column, its not possible?
So to reconfirm. You're telling me that if I want to display a-z and scroll then like print 'a' on 0x8F(First Row Last Column) then move it to the left one column, then print 'b' on 0x8F and move it left one column, its not possible?
The basic structure of an Hitachi based LCD module is usually 2 rows of 40 characters - the actual visible part (such as 2x16) is a 'window' on to that 2x40 memory space - if you hardware scroll the display it simply moves that 'window' left or right along the buffer.
I would suggest you do a loop to print the entire character set from 32 (space) to 128 one character at a time after each other, where you will see the action of the memory buffer, by which character appears as the first character of the second row.
Four line displays though come in a number of different configurations, so you need to know exactly which type you have, often they use two separate display chips, the first does the odd number lines, and the second does the even lines.
I just made one using your hardware ( my labels are different )
Code:
char txt[] = {"hello world from the other side of mars"};
..
void LCDstring(char * str)
{
while(*str !=0)
LCDdata(*str++);
}
..
..
void main(void)
{
LCDinit();
LCDstring(txt);
while (1)
{
LCDcmd(0x18);
delayMs(300);
}
}
I just made one using your hardware ( my labels are different )
Code:
char txt[] = {"hello world from the other side of mars"};
..
void LCDstring(char * str)
{
while(*str !=0)
LCDdata(*str++);
}
..
..
void main(void)
{
LCDinit();
LCDstring(txt);
while (1)
{
LCDcmd(0x18);
delayMs(300);
}
}
The basic structure of an Hitachi based LCD module is usually 2 rows of 40 characters - the actual visible part (such as 2x16) is a 'window' on to that 2x40 memory space - if you hardware scroll the display it simply moves that 'window' left or right along the buffer.
I would suggest you do a loop to print the entire character set from 32 (space) to 128 one character at a time after each other, where you will see the action of the memory buffer, by which character appears as the first character of the second row.
Four line displays though come in a number of different configurations, so you need to know exactly which type you have, often they use two separate display chips, the first does the odd number lines, and the second does the even lines.
Thank you will try it out. Meanwhile, I feel Im still not very clear with LCD operation. I know the commands and etc but during execution I'm a bit unsure how its gonna execute. Can you recommend anything to get more info on LCDs. And what kind of programs if I make would help me grasp the full concepts on LCD.
Edit: So the program which you mentioned its starts to print Characters(32[Space]-47[Backward Slash]) then on the second Row it starts from Character 96.
96-47 gives 49 Characters.
So the 16 Characters + 49 Characters are in the first row? How does it exceed 40?
Thank you will try it out. Meanwhile, I feel Im still not very clear with LCD operation. I know the commands and etc but during execution I'm a bit unsure how its gonna execute. Can you recommend anything to get more info on LCDs. And what kind of programs if I make would help me grasp the full concepts on LCD.
Edit: So the program which you mentioned its starts to print Characters(32[Space]-47[Backward Slash]) then on the second Row it starts from Character 96.
96-47 gives 49 Characters.
So the 16 Characters + 49 Characters are in the first row? How does it exceed 40?