Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

GLCD Driver Explanation Highlighting Text

Status
Not open for further replies.

w_bwr

Member level 3
Joined
Feb 4, 2010
Messages
66
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Karachi, Pakistan
Activity points
1,810
Controller: PIC-18f452
Compiler : CCS v 4.125
GLCD: 96*60 KS0713 Family Graphic LCDs


I want to make changes to GLCD Driver and I don't understand the following things:

Print Character Routine:
Code:
void dt_lcd_printchar(byte cvar)               // Write 1 character to LCD 
{ 
charsel=cvar; 
int i; 
for ( i = 0; i < 5; i++ ){ 
           if(charsel<0x50) dt_Lcd_Write_data(TABLE5[charsel - 0x20][i] << 1); 
           else if(charsel>0x4f) dt_Lcd_Write_data(TABLE6[charsel - 0x50][i] << 1); 
        }          // send data to nokia    
                              

  dt_lcd_write_data(0x00);               //    1 byte (always blank) 
}

TABLE5[48][5] contains the ASCII codes for characters.
dt_Lcd_Write_data() & dt_lcd_write_dorc routines are:

Code:
oid dt_lcd_write_data(char bytefor_data) 
{ 
dt_cs=0; 
//nop;nop;nop;nop; 

dt_rs=1; 
dt_lcd_write_dorc(bytefor_data);   // write display data 


dt_cs=1; 
} 
////////////////////////////////////////////////////////////////////////////////// 
void dt_lcd_write_dorc(char bytefor)         // serial write data or command subroutine 
{ 
char caa; 
for (caa=8;caa>0;caa--) { 
      dt_sclk=0; 
      // delay_us(2); 
      if ((bytefor&0x80)==0){dt_sid=0;} 
      else {dt_sid=1;} 
      //nop;nop; 
      dt_sclk=1; 
      bytefor=bytefor<<1; 
      //nop;nop; 
               } 
}

Q1: How to set a single pixel?

Q2: I am create a menu in GLCD and want to highlight the text. For that purpose, I have draw a rectangle of dark pixels and write text in white. How to do that?

Q3:
t_lcd_write_data(char bytefor) takes a character as input then,
what is this supposed to mean?

Code:
the " << 1 " in the following line: 

dt_Lcd_Write_data(TABLE5[charsel - 0x20][i] << 1);
 

Q1: How to set a single pixel?
From your code it seems that dt_sid variable defines if the sent pixel is black or white.

Q2: I am create a menu in GLCD and want to highlight the text. For that purpose, I have draw a rectangle of dark pixels and write text in white. How to do that?
There is an option to pass an extra argument inside dt_lcd_write_data(). If the argument tells to write negative, then you should invert the status of the dt_sid variable every time you send it to the lcd. I think you should invert the bits of bytefor argument for that purpose.
 

Still can't get it done.

Code:
void pixel(int x,int y)
{
dt_lcd_gotoxy(x,y);
dt_sclk=0;
dt_sid=0;
dt_sclk=1;
}

I tried this code but this doesn't work. I have to draw black bar first and my driver doesn't have any line drawing or rectangle drawing routines .
 

Could you perform a test?
In the code as you originally posted in post #1 substitute these lines:

Code:
if ((bytefor&0x80)==0){dt_sid=0;} 
  else {dt_sid=1;}

With those:

Code:
if ((bytefor&0x80)==0){dt_sid=1;} 
  else {dt_sid=0;}

Then come back with the results.
 

Could you perform a test?
In the code as you originally posted in post #1 substitute these lines:

Code:
if ((bytefor&0x80)==0){dt_sid=0;} 
  else {dt_sid=1;}

With those:

Code:
if ((bytefor&0x80)==0){dt_sid=1;} 
  else {dt_sid=0;}

Then come back with the results.

It doesn't display anything. May be, it is because it wrote the characters in White and I can't see it because the background is also white.



I don't think that it worked at all. if we assume that dt_sid=1 writes Black character and dt_sid=0 writes white. Then it should display all pixels dark except the characters, because of the following line:
Code:
 else {dt_sid=0;}
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top