View previous topic :: View next topic |
Author |
Message |
ertansuluagac
Joined: 13 Jul 2017 Posts: 135 Location: IZMIR
|
sed1335 |
Posted: Wed Dec 25, 2019 5:35 am |
|
|
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: 9243 Location: Greensville,Ontario
|
|
Posted: Wed Dec 25, 2019 5:56 am |
|
|
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
|
|
Posted: Wed Dec 25, 2019 6:01 am |
|
|
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: 9243 Location: Greensville,Ontario
|
|
Posted: Wed Dec 25, 2019 6:38 am |
|
|
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: 19539
|
|
Posted: Thu Dec 26, 2019 4:01 am |
|
|
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. |
|
|
|