Has anyone used a dot-matrix display? I have an LCD (128x64), model
no. HDG12864F-1.
I have previous source code but its so complex, i cannot understand
it. its poorly documented too. If anyone can share the algorithm
behind sending display characters to a dot matrix display.
What i want to do :
some_function( "Display this" ) -> On the LCD: Display this
What I can do:
I can make a single for loop which has pointers to an array of hex
files mapped out to be characters. Result? each character display
reqiures a for loop. :(
Not too efficient on the big O notation. (Random sense)
Anyways, help? :P
Using Hantronix Chip on glass technology LCD Modules
Started by ●May 24, 2006
Reply by ●May 24, 20062006-05-24
wickedmonster2002 schrieb:
> What i want to do :
> some_function( "Display this" ) -> On the LCD: Display this
If the display-chip has no character-rom you need to have a font
in the LPC.
In order to display a character you need to send all byte for it
to the LCD.
--
42Bastian
> What i want to do :
> some_function( "Display this" ) -> On the LCD: Display this
If the display-chip has no character-rom you need to have a font
in the LPC.
In order to display a character you need to send all byte for it
to the LCD.
--
42Bastian
Reply by ●May 24, 20062006-05-24
Quoting wickedmonster2002 :
> Has anyone used a dot-matrix display? I have an LCD (128x64), model
> no. HDG12864F-1.
>
> I have previous source code but its so complex, i cannot understand
> it. its poorly documented too. If anyone can share the algorithm
> behind sending display characters to a dot matrix display.
>
> What i want to do :
> some_function( "Display this" ) -> On the LCD: Display this
>
> What I can do:
> I can make a single for loop which has pointers to an array of hex
> files mapped out to be characters. Result? each character display
> reqiures a for loop. :(
>
> Not too efficient on the big O notation. (Random sense)
No matter what happens you have to copy N dots to the display for each
character. With intelligence on the display that could mean the
display itself
handles the copying but if all you have is a 'bunch o pixels' then you have to
set each one. Try looking up bitblt which is a generalized graphics copying
technique.
The only question is whether to store strokes or bits. And with the low
resolution you have I doubt a stroke based font will be very pretty, at least
w/o a lot of work.
Anyway O(n) is not bad. With a 8x8 font, n is at most 128. I rather
expect the
bandwidth to the diplay will limit you more than the for loop overhead. It
might even be possible to compress the font definition if space is tight and
not affect your runtime timing.
If you can do a string print routine better than O(n) I'd like to see
how. (No
sarcasm meant there, I don't see how it's possible but ....)
Robert
> Has anyone used a dot-matrix display? I have an LCD (128x64), model
> no. HDG12864F-1.
>
> I have previous source code but its so complex, i cannot understand
> it. its poorly documented too. If anyone can share the algorithm
> behind sending display characters to a dot matrix display.
>
> What i want to do :
> some_function( "Display this" ) -> On the LCD: Display this
>
> What I can do:
> I can make a single for loop which has pointers to an array of hex
> files mapped out to be characters. Result? each character display
> reqiures a for loop. :(
>
> Not too efficient on the big O notation. (Random sense)
No matter what happens you have to copy N dots to the display for each
character. With intelligence on the display that could mean the
display itself
handles the copying but if all you have is a 'bunch o pixels' then you have to
set each one. Try looking up bitblt which is a generalized graphics copying
technique.
The only question is whether to store strokes or bits. And with the low
resolution you have I doubt a stroke based font will be very pretty, at least
w/o a lot of work.
Anyway O(n) is not bad. With a 8x8 font, n is at most 128. I rather
expect the
bandwidth to the diplay will limit you more than the for loop overhead. It
might even be possible to compress the font definition if space is tight and
not affect your runtime timing.
If you can do a string print routine better than O(n) I'd like to see
how. (No
sarcasm meant there, I don't see how it's possible but ....)
Robert
Reply by ●May 24, 20062006-05-24
--- In l..., "wickedmonster2002" wrote:
>
> Has anyone used a dot-matrix display? I have an LCD (128x64), model
> no. HDG12864F-1.
>
> Anyways, help? :P
>
http://www.circuitcellar.com/library/details/0400/c0400cd4.htm
>
> Has anyone used a dot-matrix display? I have an LCD (128x64), model
> no. HDG12864F-1.
>
> Anyways, help? :P
>
http://www.circuitcellar.com/library/details/0400/c0400cd4.htm
Reply by ●May 24, 20062006-05-24
Since you said "Its soo complex and poorly documented" I'm going to
guess
that your using the glcd package which is nice and fully featured but its
hard to start using without experience or sitting down and following the
code. (If your code has #include its likely that you are using
glcd)
If you want the basics of using the Hantronix displays, like the
HDM12864F-1, which has a S6B0724 controller at its heart then search
google for "S6B0724 sample code". This one is the most helpful,
www.8052.com/users/mkaras/GraphLCD.phtml, and in looking at it and the
glcd package as sold by ramtex it looks like it was the starting point for
glcd.
If you have your code working and you just want to display strings (like
printf to your lcd) try:
ginit(); // Initialize the display hardware interface hardware
ghw_dispon(); // Command the display to turn on
gselfont(&mono5_8); // Select a soft font, look in your include directory
// to see what fonts your system has used
gsetcpos(0,0); // 0th line over from the left, 1st line down (no zero)
gputs("Line1");
gsetcpos(0,1); // 0th line over from the left, 1st line down (no zero)
gputs("Line2");
I hope this helps and if you have more questions just post them.
Richard Newman
Pittsburgh PA USA
that your using the glcd package which is nice and fully featured but its
hard to start using without experience or sitting down and following the
code. (If your code has #include its likely that you are using
glcd)
If you want the basics of using the Hantronix displays, like the
HDM12864F-1, which has a S6B0724 controller at its heart then search
google for "S6B0724 sample code". This one is the most helpful,
www.8052.com/users/mkaras/GraphLCD.phtml, and in looking at it and the
glcd package as sold by ramtex it looks like it was the starting point for
glcd.
If you have your code working and you just want to display strings (like
printf to your lcd) try:
ginit(); // Initialize the display hardware interface hardware
ghw_dispon(); // Command the display to turn on
gselfont(&mono5_8); // Select a soft font, look in your include directory
// to see what fonts your system has used
gsetcpos(0,0); // 0th line over from the left, 1st line down (no zero)
gputs("Line1");
gsetcpos(0,1); // 0th line over from the left, 1st line down (no zero)
gputs("Line2");
I hope this helps and if you have more questions just post them.
Richard Newman
Pittsburgh PA USA
Reply by ●May 24, 20062006-05-24
Hello People,
Thank you for your response and your algorithms and ideas.
Actually, I just came across glcd.c code. And yes, it is complex. But
I will try to utilize some of its techniques.
I have a font definition file ready in the previous source files. It
goes like this:
_font1def: ;address 0400
.DATA.B H'00, H'7e, H'11, H'11, H'11, H'7e ; A Asc 41
.DATA.B H'00, H'7f, H'49, H'49, H'49, H'36 ; B Asc 42
....so on and so forth.
This is in an asm file, and i was thinking if i could use this instead
of making my own.
Question is, how do i use it? Is this ARM compatible asm file? Can i
just access the data as an array, or do i change it to C format?
Thanks again,
M.
--- In l..., "wickedmonster2002" wrote:
>
> Has anyone used a dot-matrix display? I have an LCD (128x64), model
> no. HDG12864F-1.
>
> I have previous source code but its so complex, i cannot understand
> it. its poorly documented too. If anyone can share the algorithm
> behind sending display characters to a dot matrix display.
>
> What i want to do :
> some_function( "Display this" ) -> On the LCD: Display this
>
> What I can do:
> I can make a single for loop which has pointers to an array of hex
> files mapped out to be characters. Result? each character display
> reqiures a for loop. :(
>
> Not too efficient on the big O notation. (Random sense)
>
> Anyways, help? :P
>
Thank you for your response and your algorithms and ideas.
Actually, I just came across glcd.c code. And yes, it is complex. But
I will try to utilize some of its techniques.
I have a font definition file ready in the previous source files. It
goes like this:
_font1def: ;address 0400
.DATA.B H'00, H'7e, H'11, H'11, H'11, H'7e ; A Asc 41
.DATA.B H'00, H'7f, H'49, H'49, H'49, H'36 ; B Asc 42
....so on and so forth.
This is in an asm file, and i was thinking if i could use this instead
of making my own.
Question is, how do i use it? Is this ARM compatible asm file? Can i
just access the data as an array, or do i change it to C format?
Thanks again,
M.
--- In l..., "wickedmonster2002" wrote:
>
> Has anyone used a dot-matrix display? I have an LCD (128x64), model
> no. HDG12864F-1.
>
> I have previous source code but its so complex, i cannot understand
> it. its poorly documented too. If anyone can share the algorithm
> behind sending display characters to a dot matrix display.
>
> What i want to do :
> some_function( "Display this" ) -> On the LCD: Display this
>
> What I can do:
> I can make a single for loop which has pointers to an array of hex
> files mapped out to be characters. Result? each character display
> reqiures a for loop. :(
>
> Not too efficient on the big O notation. (Random sense)
>
> Anyways, help? :P
>
Reply by ●May 24, 20062006-05-24
BTW, I am using Keil Uvision tools.
--- In l..., "wickedmonster2002" wrote:
>
> Has anyone used a dot-matrix display? I have an LCD (128x64), model
> no. HDG12864F-1.
>
> I have previous source code but its so complex, i cannot understand
> it. its poorly documented too. If anyone can share the algorithm
> behind sending display characters to a dot matrix display.
>
> What i want to do :
> some_function( "Display this" ) -> On the LCD: Display this
>
> What I can do:
> I can make a single for loop which has pointers to an array of hex
> files mapped out to be characters. Result? each character display
> reqiures a for loop. :(
>
> Not too efficient on the big O notation. (Random sense)
>
> Anyways, help? :P
>
--- In l..., "wickedmonster2002" wrote:
>
> Has anyone used a dot-matrix display? I have an LCD (128x64), model
> no. HDG12864F-1.
>
> I have previous source code but its so complex, i cannot understand
> it. its poorly documented too. If anyone can share the algorithm
> behind sending display characters to a dot matrix display.
>
> What i want to do :
> some_function( "Display this" ) -> On the LCD: Display this
>
> What I can do:
> I can make a single for loop which has pointers to an array of hex
> files mapped out to be characters. Result? each character display
> reqiures a for loop. :(
>
> Not too efficient on the big O notation. (Random sense)
>
> Anyways, help? :P
>
Reply by ●May 24, 20062006-05-24
You have to tell us what you have to work with so that we can help you
with the shortest possible path. Since you did not I'm going to
interrogate you but eventually I'll get tired and abandon this thread. So
here goes:
1) You said you already had code working. Is that the glcd code? Does
your working code use the header gdisp.h? If you have gdisp.h then your
working code uses glcd from somewhere other than 8052.com. Tell us if your
code has gdisp.h in it.
2) If your using glcd code (the one with gdisp.h in it) then it already
has font files and they are available for you to use. I will wait to
demonstrate how to use them based on your answer to question 1.
3) If your NOT using glcd then the shortest path to success is the url
which I previously gave you. Here it is again:
http://www.8052.com/users/mkaras/GraphLCD.phtml
This gLCD code does what you want to do: Write text characters to the
display using a font which is already specified in the headers and he
shows you how to use them. In this scenario there is no reason to use your
existing font files or explain how to get your compiler to point to them
because the examples show you how.
Wait! Are you telling me the code from MKaras from 8052.com is complex?
Please say no. If you want complex and no documentation then buy gLCD
from Ramtex and write me back. The code is at least 30 times the size,
with lots of features like windowing, and harder to get started with.
There are at least 60 files in the Ramtex distribution of gLCD.
Finally- Are you telling us that what you really want is a example simpler
than the gLCD code from mkaras off the 8052 site? In my opinion that
would be what you started with, the example that displays a bitmap. Want
to display simple characters crt style? The answer, with this display, is
you have to use a font file and stuff it out rows at a time, 5 rows of 8
bytes for each character and then add some for intercharacter spacing. Its
not as simple as writing a character to a serial port or calling printf
but if you get the code working you can encapsulate all the non-trivial
stuff behind printf or debug_printf and your life is easy until you start
using another graphic display. Work like this takes work and the gLCD code
off of 8052.com is the shortest path to plugging and playing.
Again, I hope this helps and if you have more questions just continue
posting them.
Richard Newman
Pittsburgh PA USA
with the shortest possible path. Since you did not I'm going to
interrogate you but eventually I'll get tired and abandon this thread. So
here goes:
1) You said you already had code working. Is that the glcd code? Does
your working code use the header gdisp.h? If you have gdisp.h then your
working code uses glcd from somewhere other than 8052.com. Tell us if your
code has gdisp.h in it.
2) If your using glcd code (the one with gdisp.h in it) then it already
has font files and they are available for you to use. I will wait to
demonstrate how to use them based on your answer to question 1.
3) If your NOT using glcd then the shortest path to success is the url
which I previously gave you. Here it is again:
http://www.8052.com/users/mkaras/GraphLCD.phtml
This gLCD code does what you want to do: Write text characters to the
display using a font which is already specified in the headers and he
shows you how to use them. In this scenario there is no reason to use your
existing font files or explain how to get your compiler to point to them
because the examples show you how.
Wait! Are you telling me the code from MKaras from 8052.com is complex?
Please say no. If you want complex and no documentation then buy gLCD
from Ramtex and write me back. The code is at least 30 times the size,
with lots of features like windowing, and harder to get started with.
There are at least 60 files in the Ramtex distribution of gLCD.
Finally- Are you telling us that what you really want is a example simpler
than the gLCD code from mkaras off the 8052 site? In my opinion that
would be what you started with, the example that displays a bitmap. Want
to display simple characters crt style? The answer, with this display, is
you have to use a font file and stuff it out rows at a time, 5 rows of 8
bytes for each character and then add some for intercharacter spacing. Its
not as simple as writing a character to a serial port or calling printf
but if you get the code working you can encapsulate all the non-trivial
stuff behind printf or debug_printf and your life is easy until you start
using another graphic display. Work like this takes work and the gLCD code
off of 8052.com is the shortest path to plugging and playing.
Again, I hope this helps and if you have more questions just continue
posting them.
Richard Newman
Pittsburgh PA USA
Reply by ●May 24, 20062006-05-24
Wow, i feel like i m being grilled for murder.
--- In l..., newmanrf@... wrote:
> You have to tell us what you have to work with so that we can help you
> with the shortest possible path. Since you did not I'm going to
> interrogate you but eventually I'll get tired and abandon this
thread. So
> here goes:
>
> 1) You said you already had code working. Is that the glcd code? Does
> your working code use the header gdisp.h? If you have gdisp.h then your
> working code uses glcd from somewhere other than 8052.com. Tell us
if your
> code has gdisp.h in it.
No! It does not have gdisp.h in it.
>
> 2) If your using glcd code (the one with gdisp.h in it) then it already
> has font files and they are available for you to use. I will wait to
> demonstrate how to use them based on your answer to question 1.
See question 1.
>
> 3) If your NOT using glcd then the shortest path to success is the url
> which I previously gave you. Here it is again:
> http://www.8052.com/users/mkaras/GraphLCD.phtml
> This gLCD code does what you want to do: Write text characters to the
> display using a font which is already specified in the headers and he
> shows you how to use them. In this scenario there is no reason to
use your
> existing font files or explain how to get your compiler to point to them
> because the examples show you how.
Yes. I saw that. I will try doing that next.
>
> Wait! Are you telling me the code from MKaras from 8052.com is complex?
> Please say no.
Okay. No. I dont find the code complex. Its a bit easier on the eyes.
I said the glcd.c with the gdisp.h in it was complex. You must have
misunderstood. Sorry about that.
If you want complex and no documentation then buy gLCD
> from Ramtex and write me back. The code is at least 30 times the size,
> with lots of features like windowing, and harder to get started with.
> There are at least 60 files in the Ramtex distribution of gLCD.
>
> Finally- Are you telling us that what you really want is a example
simpler
> than the gLCD code from mkaras off the 8052 site?
I think its simple enough. I have zero experience in graphic displays.
I had no idea we had to use fonts. I even interpreted fonts as
something coming off the Windows operating system, a complete layman
view. Laugh at my intelligence but you know, I gotta start somewhere.
In my opinion that
> would be what you started with, the example that displays a bitmap. Want
> to display simple characters crt style? The answer, with this
display, is
> you have to use a font file and stuff it out rows at a time, 5 rows of 8
> bytes for each character and then add some for intercharacter
spacing. Its
> not as simple as writing a character to a serial port or calling printf
> but if you get the code working you can encapsulate all the non-trivial
> stuff behind printf or debug_printf and your life is easy until you
start
> using another graphic display. Work like this takes work and the
gLCD code
> off of 8052.com is the shortest path to plugging and playing.
>
> Again, I hope this helps and if you have more questions just continue
> posting them.
Thanks a lot. That site really helped.
M.
>
> Richard Newman
> Pittsburgh PA USA
>
--- In l..., newmanrf@... wrote:
> You have to tell us what you have to work with so that we can help you
> with the shortest possible path. Since you did not I'm going to
> interrogate you but eventually I'll get tired and abandon this
thread. So
> here goes:
>
> 1) You said you already had code working. Is that the glcd code? Does
> your working code use the header gdisp.h? If you have gdisp.h then your
> working code uses glcd from somewhere other than 8052.com. Tell us
if your
> code has gdisp.h in it.
No! It does not have gdisp.h in it.
>
> 2) If your using glcd code (the one with gdisp.h in it) then it already
> has font files and they are available for you to use. I will wait to
> demonstrate how to use them based on your answer to question 1.
See question 1.
>
> 3) If your NOT using glcd then the shortest path to success is the url
> which I previously gave you. Here it is again:
> http://www.8052.com/users/mkaras/GraphLCD.phtml
> This gLCD code does what you want to do: Write text characters to the
> display using a font which is already specified in the headers and he
> shows you how to use them. In this scenario there is no reason to
use your
> existing font files or explain how to get your compiler to point to them
> because the examples show you how.
Yes. I saw that. I will try doing that next.
>
> Wait! Are you telling me the code from MKaras from 8052.com is complex?
> Please say no.
Okay. No. I dont find the code complex. Its a bit easier on the eyes.
I said the glcd.c with the gdisp.h in it was complex. You must have
misunderstood. Sorry about that.
If you want complex and no documentation then buy gLCD
> from Ramtex and write me back. The code is at least 30 times the size,
> with lots of features like windowing, and harder to get started with.
> There are at least 60 files in the Ramtex distribution of gLCD.
>
> Finally- Are you telling us that what you really want is a example
simpler
> than the gLCD code from mkaras off the 8052 site?
I think its simple enough. I have zero experience in graphic displays.
I had no idea we had to use fonts. I even interpreted fonts as
something coming off the Windows operating system, a complete layman
view. Laugh at my intelligence but you know, I gotta start somewhere.
In my opinion that
> would be what you started with, the example that displays a bitmap. Want
> to display simple characters crt style? The answer, with this
display, is
> you have to use a font file and stuff it out rows at a time, 5 rows of 8
> bytes for each character and then add some for intercharacter
spacing. Its
> not as simple as writing a character to a serial port or calling printf
> but if you get the code working you can encapsulate all the non-trivial
> stuff behind printf or debug_printf and your life is easy until you
start
> using another graphic display. Work like this takes work and the
gLCD code
> off of 8052.com is the shortest path to plugging and playing.
>
> Again, I hope this helps and if you have more questions just continue
> posting them.
Thanks a lot. That site really helped.
M.
>
> Richard Newman
> Pittsburgh PA USA
>
Reply by ●May 24, 20062006-05-24
--- In l..., newmanrf@... wrote:
> 3) If your NOT using glcd then the shortest path to success is the url
> which I previously gave you. Here it is again:
> http://www.8052.com/users/mkaras/GraphLCD.phtml
Thanks for the link. I just started a project using a 640x480 LCD
panel http://tinyurl.com/lmcoh using the frame buffer logic design
from http://www.nyx.net/%7Ejpurbric/lcd See lcd.gif.
Sure, the panel is only $11. It's the odd bits to make it work that
add time and money.
Thanks again!
Rchard
> 3) If your NOT using glcd then the shortest path to success is the url
> which I previously gave you. Here it is again:
> http://www.8052.com/users/mkaras/GraphLCD.phtml
Thanks for the link. I just started a project using a 640x480 LCD
panel http://tinyurl.com/lmcoh using the frame buffer logic design
from http://www.nyx.net/%7Ejpurbric/lcd See lcd.gif.
Sure, the panel is only $11. It's the odd bits to make it work that
add time and money.
Thanks again!
Rchard