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

sed1335

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

sed1335
PostPosted: Wed Dec 25, 2019 5:35 am     Reply with quote

I would like to add this function to the sed1335.c driver. But he keeps pressing the screen. And it covers the screen. What could be the problem?

GlcdGotoTextXY(1,1);printf(GlcdPutC,"AKIM GIR:");

I added what I wrote below. But it constantly increases side by side and covers the screen. I just want the line and column that I mentioned.

Code:

void GLCD_WriteCommand(int8 commandToWrite) 
{
   glcd_output_data(commandToWrite);
   output_low(GLCD_RD);
   TGLCD_COMMAND   
   
   output_low(GLCD_WR);
   output_low(GLCD_CS);

   delay_cycles(70);
   output_high(GLCD_RD);
   delay_cycles(78);
   output_low(GLCD_RD);

   output_high(GLCD_WR);
   output_high(GLCD_CS);
}

void GLCD_WriteData(int8 dataToWrite)         // Changes
{
   glcd_output_data(dataToWrite);

   output_low(GLCD_RD);

   TGLCD_DATA

   output_low(GLCD_WR);
   output_low(GLCD_CS);

   delay_cycles(70);
   output_high(GLCD_RD);
   delay_cycles(78);
   output_low(GLCD_RD);

   output_high(GLCD_WR);
   output_high(GLCD_CS);
}

void GlcdPutC(char c)
{
   GLCD_WriteCommand(0x42);
   GLCD_WriteData(c);
   }
   
//x and y : 1 to max   
void GlcdGotoTextXY(int16 x, int16 y)
{
   int16 adress = 0;
   adress = (y-1)*40;
   adress = adress+ x-1;
   setCursorAddress(adress);
   }


_________________
Es
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Dec 25, 2019 5:56 am     Reply with quote

I downloaded the datasheet, it's well written and 94 pages long ....

That LCD module requires 'setup' or 'initialization' code before you can send data and display.

Another concern is the actual interface. The LCD requires VDD of 5 volts. What PIC and VDD are you using ?
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Wed Dec 25, 2019 6:01 am     Reply with quote

PIC24EP512GP202 3.3V
Code:

   //system set
   GLCD_WriteCommand(0x40);
   GLCD_WriteData(0x30);
   GLCD_WriteData(0x87);
   GLCD_WriteData(0x07);
   GLCD_WriteData(0x27);
   GLCD_WriteData(0x2F);
   GLCD_WriteData(0xEF);
   GLCD_WriteData(0x28);
   GLCD_WriteData(0x00);
   
   //scroll
   GLCD_WriteCommand(0x44);
   GLCD_WriteData(0x00);
   GLCD_WriteData(0x00);
   GLCD_WriteData(0xF0);
   GLCD_WriteData(0x80);
   GLCD_WriteData(0x25);
   GLCD_WriteData(0xF0);
   GLCD_WriteData(0x00);
   GLCD_WriteData(0x4B);
   GLCD_WriteData(0x00);
   GLCD_WriteData(0x00);
   //HDOT SCR
   
   GLCD_WriteCommand(0x5A);
   GLCD_WriteData(0x00);
   
   //OVLAY
   GLCD_WriteCommand(0x5B);
   GLCD_WriteData(0x01);
   //DISP ON
   GLCD_WriteCommand(0x58);
   GLCD_WriteData(0x56);
   
   //CSRFORM
   GLCD_WriteCommand(0x5D);
   GLCD_WriteData(0x04);   
   GLCD_WriteData(0x86);
   
   //DISP ON
   GLCD_WriteCommand(0x59);
   
   //CSDIR
   GLCD_WriteCommand(0x4C);
   
   //CSRW
   setCursorAddress(0x0000);

_________________
Es
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Dec 25, 2019 6:38 am     Reply with quote

Hmm.. I looked at the Epson datasheet again... 1 page (6.2) says 5 volts, next page says 3 volts is OK....arrgh...
Are you using a 'chip' or a premade LCD module ? If a module is it a 3 volt device? Historically LCDs have been 5 volt devices, though newer ones may be 3 volt rated. I'm assuming a 'module' but you should post the maker/model or 'link' to it.

Also
you should add comments to all those lines of code ! They cost nothing is terms of codespace BUT help us see what you're sending to the LCD. Usually there's a sequence of commands to initalize an LCD to put it into the 'mode' you want. Without comments, I can't tell if it's correct or not.
Comments also tell you what configuration, like font, font size, etc. While you may know now, 3-4 days later you wonder, hmm, 5by7 or 5by10 pixels ??

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Thu Dec 26, 2019 4:01 am     Reply with quote

The point about the supply voltage, is that there are two sets of
specifications according to the supply range. Things like the strobe
pulse width have to increase if you are running at the lower voltage.
Maximum clock rate drops to just 8MHz at the lower supply.
To help make it really simple, at one part of the sheet, the low voltage
stuff is the left hand column, while in other parts it is the right.
On a scale of 0 to 10 for helping the user, about a -1....

Hope you all had a great Christmas.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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