CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

LCD Display with T6963c and PIC18F4520
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Izzy



Joined: 27 May 2007
Posts: 106

View user's profile Send private message

PostPosted: Thu Jan 01, 2009 4:45 pm     Reply with quote

Thanks PCM programmer, it solved the mystery.lol

After I added 'if(c >= 0x20) ' it started to give '@' after every word. But adding another condition helped.

if(c >= 0x20 && c!=0x40) //0x40 = @


Do you have any thoughts on the my second question?
I dont know why the graphics are shifted when I changed the font from 8x8 to 6x8. By saying graphics I mean lines and bars.(Please note I am using text address for graphics) i.e. glcd_gotoxy(6,1,1);


I know it has something to do with this:
Quote:
unsigned int16 TextHome = 0x0A00;//0x0780;
const int8 TextArea = 0x0028; // how many bytes before a new line // 0x28 = 40
const int16 GraphicsHome = 0x0000;
const int8 GraphicsArea = 0x0028; // how many bytes before a new line


But I am not getting good results.
Izzy



Joined: 27 May 2007
Posts: 106

View user's profile Send private message

PostPosted: Thu Jan 01, 2009 5:43 pm     Reply with quote

Oh well, looks like that was not the solution, because it sometime prints random character like numbers and alphabets which I cannot include in the if condition. I am not sure what I can do now.



PCM programmer wrote:
That's what I thought. You probably have this problem here:
https://www.ccsinfo.com/forum/viewtopic.php?t=24661&start=74

One possible work-around would be to change the glcd_putc() routine
so it only accepts printable characters. Example:
Changes are shown in bold below:
Quote:
void glcd_putc(char c) {
if(c >= 0x20)
glcd_WriteCmd1(c - 0x20, 0xc0);
}

Try that. See if it fixes the problem.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 01, 2009 6:05 pm     Reply with quote

I wasn't sure it would work. It's not a solution if it's printing a random character at the end.

Try another work-around. Copy the text to a temporary RAM array.
Then use the re-direction feature of printf to send it to lcd_putc().
Code:
char temp[41];

strcpy(temp, "G-Force");
printf(lcd_putc, "%s", temp);


Or just upgrade the compiler. I don't want to work on these bugs anymore.
Izzy



Joined: 27 May 2007
Posts: 106

View user's profile Send private message

PostPosted: Fri Jan 02, 2009 5:32 pm     Reply with quote

Any one know about this question?

Izzy wrote:
Thanks PCM programmer, it solved the mystery.lol

Do you have any thoughts on the my second question?
I dont know why the graphics are shifted when I changed the font from 8x8 to 6x8. By saying graphics I mean lines and bars that was drawn using the Line and Square function.(Please note I am using text address for graphics) i.e. glcd_gotoxy(6,1,1);


I know it has something to do with this:
Quote:
unsigned int16 TextHome = 0x0A00;
const int8 TextArea = 0x0028; // how many bytes before a new line // 0x28 = 40
const int16 GraphicsHome = 0x0000;
const int8 GraphicsArea = 0x0028; // how many bytes before a new line


But I am not getting good results.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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