View previous topic :: View next topic |
Author |
Message |
wh1sp3r
Joined: 15 Jul 2006 Posts: 22
|
how to speed up |
Posted: Mon Jul 17, 2006 1:54 am |
|
|
Hi, lpease, how to speed up a pixel command for glcd ? |
|
|
wh1sp3r
Joined: 15 Jul 2006 Posts: 22
|
|
Posted: Mon Jul 17, 2006 2:15 am |
|
|
Iam plaing with this ,, is good way ? :D
Code: | #include <16F877A>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#include <HDM64GS12>
#include <graphics>
#include <math>
void Main()
{
int a,i,c;
//glcd_init(ON);
output_low(GLCD_DI); // Set for instruction
glcd_writeByte(GLCD_LEFT, 0x40); // Set horizontal address to 0
glcd_writeByte(GLCD_RIGHT, 0x40);
for(c = 0; c < 5;c++)
{
output_low(GLCD_DI);
glcd_writeByte(GLCD_LEFT, c | 0xB8); // Set page address
glcd_writeByte(GLCD_RIGHT, c | 0xB8);
output_high(GLCD_DI); // Set for data
for(a = 0; a < 65;a++)
{
glcd_writeByte(GLCD_LEFT, 255);
}
}
} |
|
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Jul 17, 2006 3:54 am |
|
|
The pixel command is slow because it has to read a whole byte from the LCD memory, modify a single pixel and then write back the whole byte.
What I understand from your other thread is that you don't want to modify a single pixel but you want to update the whole screen. I was going to recommend you have a look at glcd_update() in HDM64GS12.c but I can see from your posted code you already did so.
I didn't look into your program in detail, but the idea should work.
Code: | for(a = 0; a < 65;a++) | Change this to
Code: | for(a = 0; a < 64;a++) |
|
|
|
wh1sp3r
Joined: 15 Jul 2006 Posts: 22
|
|
Posted: Mon Jul 17, 2006 2:47 pm |
|
|
please, is there some way, how to speed up pixel command ? please |
|
|
Guest Guest
|
|
Posted: Mon Jul 17, 2006 5:14 pm |
|
|
LOL
I love the non english posters |
|
|
wh1sp3r
Joined: 15 Jul 2006 Posts: 22
|
|
Posted: Mon Jul 17, 2006 5:21 pm |
|
|
and i Dont LOVE people, who laugh to me. Shame on you :-P |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Jul 18, 2006 6:11 am |
|
|
Our Guest poster was not being very nice, but what he meant to say was that just repeating the same question is not likely to give you a better response. In general the quality and number of responses in a forum like this depends on the quality of the question...
You gave us a sample program to which I responded by giving you a direction for faster screen redrawing. Ignoring my answer wasn't very nice and doesn't give us a hint as to what you really meant to say.
I guess I misunderstood you and you do really mean to speed up the pixel drawing? If yes, then be more specific. Tell us why you want it faster. Given that you want the pixel drawing to be faster I conclude you want to update multiple pixels. What do you want to draw? I ask this because it might be possible that for your drawing requirements a faster algorithm exists.
Give us as much details as you can: How fast is it now? How much faster do you need it to be? The exact type number of your display(driver), your compiler version, the processor you are using, etc., etc. |
|
|
wh1sp3r
Joined: 15 Jul 2006 Posts: 22
|
|
Posted: Tue Jul 18, 2006 12:22 pm |
|
|
I have own algoritm for drawing image and animation (image per 8 ms) viz thread "GLCD image and animation maker", but i want draw some small images on different X,Y positions .. no 128x64, but for example 10x10 glcd_pixel is really slow. when i draw small image, it takes about 70 ms .. its long time.. |
|
|
|