16x1 LCD GENERIC 8 First Character..next 8 Character
Posted: Thu Apr 03, 2014 11:42 am
Hi,
i am now working at the LCD side.
I have found a little thing that have me make at begin with the work confuse.
For my Board I have setup a Generic 16x1 LCD at PortB0 ( 8 Databit ) with Register Select PortA.1 and Enable PortA.2
In First time i simple make a initialise at start by call the macro "Start"
Then i PrintString("Hello World") and wounder me why only the first 8 character was showing.
So i have seen the Macro Call "Cursor"... i think by myself that must i do to go on to the 9 Character pos and make two sending strings..
PrintString("Hello Wo")
Cursor(9,0)
PrintString("rld!")
This was running in Simulation but the string was "Hello Wo rld!"
i change it to
PrintString("Hello Wo")
Cursor(8,0)
PrintString("rld!")
This runs in Simulation well..but
this don't do the job in Hardware..
so i test the Macro Command...
PrintString("Hello Wo")
Command(0x0c0) ..........// This is a command usually go on at 9. Char...for me at this LCD i have this run for me... pls check it in your hardware description before you use it....
PrintString("rld!")
and..
vola..
Hello World!
^^^^^^^^^^^
If someone has a Tip for this to make the strings comfortable as i do please let me know..
i am new in this ...
Thank You!
Best wishes
Rudi
Edit1:
Ok...
I have test a other way at this..
the appropriate memory addresses for the 16 characters are 00h - 0Fh. This should be initialized as a 1-line device. First 8 characters are at 00h - 07h and the others are at 40h - 47h.
This can be initialized as a 2-line device.... After writing the first 8 characters, the cursor is moving at the location 40h (9th charachter) using my command: 0C0H for my LCD...
many LCD are compatibel but... is not so practikabel because all manufactory are not allways the same...so i have set the 16x1 in first example as a 1 Row - 16 Columns LCD...
...now i have set the 16x1 LCD as a 2 Row - 8 Columns LCD
so i can write the first 8 Character in "line1" ... this are the Character 1-8
and write in seconde line the next 8 Charcter in "line2" .. this are the Character 9-16
by simple calling the macro Cursor(x,y) and i do not remember me for calling commands by hex like Assembler..
..
MOV A,#0C0H
ACALL COMMAND
..
so simple..
PrintString("Hello Wo")
Cursor(0,1) // <- ................................// this make the cursor to the secon "line" .. i configured the character 9-16 as a second line in LCD Properties..
PrintString("rld!")
..vola...
Hello World!
^^^^^^^^^^
i am now working at the LCD side.
I have found a little thing that have me make at begin with the work confuse.
For my Board I have setup a Generic 16x1 LCD at PortB0 ( 8 Databit ) with Register Select PortA.1 and Enable PortA.2
In First time i simple make a initialise at start by call the macro "Start"
Then i PrintString("Hello World") and wounder me why only the first 8 character was showing.
So i have seen the Macro Call "Cursor"... i think by myself that must i do to go on to the 9 Character pos and make two sending strings..
PrintString("Hello Wo")
Cursor(9,0)
PrintString("rld!")
This was running in Simulation but the string was "Hello Wo rld!"
i change it to
PrintString("Hello Wo")
Cursor(8,0)
PrintString("rld!")
This runs in Simulation well..but
this don't do the job in Hardware..
so i test the Macro Command...
PrintString("Hello Wo")
Command(0x0c0) ..........// This is a command usually go on at 9. Char...for me at this LCD i have this run for me... pls check it in your hardware description before you use it....
PrintString("rld!")
and..
vola..
Hello World!
^^^^^^^^^^^
If someone has a Tip for this to make the strings comfortable as i do please let me know..
i am new in this ...
Thank You!
Best wishes
Rudi
Edit1:
Ok...
I have test a other way at this..
the appropriate memory addresses for the 16 characters are 00h - 0Fh. This should be initialized as a 1-line device. First 8 characters are at 00h - 07h and the others are at 40h - 47h.
This can be initialized as a 2-line device.... After writing the first 8 characters, the cursor is moving at the location 40h (9th charachter) using my command: 0C0H for my LCD...
many LCD are compatibel but... is not so practikabel because all manufactory are not allways the same...so i have set the 16x1 in first example as a 1 Row - 16 Columns LCD...
...now i have set the 16x1 LCD as a 2 Row - 8 Columns LCD
so i can write the first 8 Character in "line1" ... this are the Character 1-8
and write in seconde line the next 8 Charcter in "line2" .. this are the Character 9-16
by simple calling the macro Cursor(x,y) and i do not remember me for calling commands by hex like Assembler..
..
MOV A,#0C0H
ACALL COMMAND
..
so simple..
PrintString("Hello Wo")
Cursor(0,1) // <- ................................// this make the cursor to the secon "line" .. i configured the character 9-16 as a second line in LCD Properties..
PrintString("rld!")
..vola...
Hello World!
^^^^^^^^^^