|
|
View previous topic :: View next topic |
Author |
Message |
on7nh
Joined: 05 Jun 2006 Posts: 41 Location: Belgium
|
Garbage on a GLCD dislplay |
Posted: Sun Oct 29, 2006 4:29 am |
|
|
hello Forum,
i have a strange problem with a Graphical LCD
i use the standard dricer from CCS
Code: | #include <HDM64GS12.c>
#include <graphics.c> |
i send data to the dislay
Code: | // clear display en reprint border
// glcd_rect(0, 0, 127, 63, YES, Off);
glcd_rect(0, 0, 127, 63, NO, ON); // Outline the display
glcd_text57(3, 5, voltText, 1, ON); // Display "Volts"
glcd_text57(3, 15, datumText, 1, ON); // Display "Datum"
glcd_text57(3, 25, satText, 1, ON); // Display "sats"
glcd_text57(3, 35, LinkQtext, 1, ON); // Display "link quality"
glcd_text57(3, 45, DAtext, 1, ON); // Display "sats"
// Print Time
// sprintf(lcddata,"%c%c : %c%c : %c%c",gps_hour1, gps_hour2, gps_min1, gps_min2, gps_sec1, gps_sec2);
glcd_rect(40, 5, 100, 15, YES, Off);
sprintf(lcddata,"%c",gps_hour1);
glcd_text57(40,5,lcddata,1,on);
sprintf(lcddata,"%c",gps_hour2);
glcd_text57(46,5,lcddata,1,on);
sprintf(lcddata,":");
glcd_text57(52,5,lcddata,1,on);
sprintf(lcddata,"%c",gps_min1);
glcd_text57(57,5,lcddata,1,on);
sprintf(lcddata,"%c",gps_min2);
glcd_text57(63,5,lcddata,1,on);
sprintf(lcddata,":");
glcd_text57(69,5,lcddata,1,on);
sprintf(lcddata,"%c",gps_sec1);
glcd_text57(75,5,lcddata,1,on);
sprintf(lcddata,"%c",gps_sec2);
glcd_text57(81,5,lcddata,1,on);
// print Datum
sprintf(lcddata,"%c%c%c%c%c%c\r\n",gps_year1, gps_year2,gps_month1, gps_month2,gps_day1, gps_day2);
sprintf(lcddata,"test");
glcd_text57(40,15,lcddata,1,on); |
after a few secondsn i see a lot of garbage on the display,
any sugestions?
Carl
|
|
|
Charlie U
Joined: 09 Sep 2003 Posts: 183 Location: Somewhere under water in the Great Lakes
|
|
Posted: Sun Oct 29, 2006 8:17 am |
|
|
Carl,
If I remember correctly, the driver that you are using only turns pixels on. It assumes that the field for the character is blank. It is writing a single pixel at a time by reading a byte out of the ram of the GLCD, setting the pixel that it is working on and writing the byte back to the GLCD ram. It does not turn any pixels off. You will need to clear the character field before updating it with a new character.
Charlie |
|
|
on7nh
Joined: 05 Jun 2006 Posts: 41 Location: Belgium
|
|
Posted: Sun Oct 29, 2006 8:40 am |
|
|
that's correct Charlie, i do that !
look in my listing :
Code: | glcd_rect(0, 0, 127, 63, YES, Off); for general clear |
and just before writing the time :
Code: | glcd_rect(40, 5, 100, 15, YES, Off); |
and still garbage..... |
|
|
Charlie U
Joined: 09 Sep 2003 Posts: 183 Location: Somewhere under water in the Great Lakes
|
|
Posted: Sun Oct 29, 2006 10:59 am |
|
|
Ok, I'll try another tack.
I don't use the c format in printf, so I am not too familiar with it's requirements. Are your variables already converted to ascii character values, like 0x30 for 0? If not, then you might try changing the %c to %1u, which will convert the data to an ascii decimal character. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|