ST7565 LCD DISPLAY
ST7565 LCD DISPLAY
Hi, im playing with the ST7565 custom file, Problem is i cant seem to get it to do anything.
Just a blank screen, do you by any chance have the schematic you used when testing this file??
I have tried the c86 pin high and low and also the P/S pin high and low, but nothing.
I have set the custom file up for the correct data and control pinouts etc, and i belive that my voltage capacators are also correct, as per displaytechs instructions.
Can you be of any help??
ps, display tech say it could be timing issues, my lcd is the S64128M - RGB, could someone compare the timing in the custom file to the timing in the datasheet, im not sure where to look for this in the custom file.
Just a blank screen, do you by any chance have the schematic you used when testing this file??
I have tried the c86 pin high and low and also the P/S pin high and low, but nothing.
I have set the custom file up for the correct data and control pinouts etc, and i belive that my voltage capacators are also correct, as per displaytechs instructions.
Can you be of any help??
ps, display tech say it could be timing issues, my lcd is the S64128M - RGB, could someone compare the timing in the custom file to the timing in the datasheet, im not sure where to look for this in the custom file.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ST7565 LCD DISPLAY
Hello,
What speed are you running your chip at? The code will have been tested with a 19.6608MHz crystal in all likelihood.
The function that controls the speed is LCD_Enable, Try adding a few more nop instructions to slow down the speed the Enable line can be pulsed.
Also make sure your chip configuration has things like LVP disabled or this could mean all your I/O is not working as you think.
What speed are you running your chip at? The code will have been tested with a 19.6608MHz crystal in all likelihood.
The function that controls the speed is LCD_Enable, Try adding a few more nop instructions to slow down the speed the Enable line can be pulsed.
Also make sure your chip configuration has things like LVP disabled or this could mean all your I/O is not working as you think.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: ST7565 LCD DISPLAY
Hi Benj,
Im using a 19.6608Mhz crystal, i have also verified that the code is running with a blinking led.
I have LVP disabled and have checked I/O using leds on my lines, all seems in order.
I will try the nop instructions, is there anything else here that might come into play?
Im using a 19.6608Mhz crystal, i have also verified that the code is running with a blinking led.
I have LVP disabled and have checked I/O using leds on my lines, all seems in order.
I will try the nop instructions, is there anything else here that might come into play?
Re: ST7565 LCD DISPLAY
A quick update,
I have now got the LCD to initialise, i am using the speed test file.
There was a line missing to switch the lcd on,
I can see the X on the LCD corner to corner, but the lines look like \\\\\ they are not connected and are not in the right place, but i can see it flashing on and off as the code tells it to.
When printing strings or numbers i just get lines, but again there in the right sort of area and i can sort of make out how many digits etc.
I have been trying to figure out if the X,Y axis are correct, if i plot on the X axis i get the pixels where they should be, if i plot on the Y axis they are not where there supposed to be, i guess this is why my speed test file isnt displaying correctly
Which area of the code in the .c file is responsible for addressing like this.??
Can you see this being my problem??
I have now got the LCD to initialise, i am using the speed test file.
There was a line missing to switch the lcd on,
I can see the X on the LCD corner to corner, but the lines look like \\\\\ they are not connected and are not in the right place, but i can see it flashing on and off as the code tells it to.
When printing strings or numbers i just get lines, but again there in the right sort of area and i can sort of make out how many digits etc.
I have been trying to figure out if the X,Y axis are correct, if i plot on the X axis i get the pixels where they should be, if i plot on the Y axis they are not where there supposed to be, i guess this is why my speed test file isnt displaying correctly
Which area of the code in the .c file is responsible for addressing like this.??
Can you see this being my problem??
Last edited by cobra1 on Thu Apr 07, 2011 9:31 am, edited 1 time in total.
Re: ST7565 LCD DISPLAY
Hi, i have just noticed that my chipset it a "ST7565R-G"
will this cause a problem or should it work ok, i cant find a datasheet with the G extension
Dont suppose you know what lcd you used when testing this code??
will this cause a problem or should it work ok, i cant find a datasheet with the G extension
Dont suppose you know what lcd you used when testing this code??
Re: ST7565 LCD DISPLAY
Iv just been going through the forum looking for some inspiration when i came across this
http://www.matrixmultimedia.com/mmforum ... =29&t=8035
this is pretty much whats happening to me, was this ever figured out??
http://www.matrixmultimedia.com/mmforum ... =29&t=8035
this is pretty much whats happening to me, was this ever figured out??
Re: ST7565 LCD DISPLAY
ok, more problems,
when drawing a box to fill the screen my coordinates are 0,0,127,63 (this works as it should)
when putting a 1 pixel border around the box i use 1,1,125,61 (the 1,1 is correct, but the 125,61 should be 126,62) so its 1 pixel out
when putting a 2 pixel border around the box i use 2,2,123,59 (again the 2,2 is correct but the 123,59 should be 125,61) so its 2 pixels out
this happens for any number, so if i have my start point as 5,5, then the actual 127,63 becomes (127-5 = 122) and (63-5 = 58) so to create a 5 pixel border i need to move in another 5 which now makes the whole thing 5,5,117,53
I hope this makes sense
i think if i can sort this addressing problem then it will work as it should,
when drawing a box to fill the screen my coordinates are 0,0,127,63 (this works as it should)
when putting a 1 pixel border around the box i use 1,1,125,61 (the 1,1 is correct, but the 125,61 should be 126,62) so its 1 pixel out
when putting a 2 pixel border around the box i use 2,2,123,59 (again the 2,2 is correct but the 123,59 should be 125,61) so its 2 pixels out
this happens for any number, so if i have my start point as 5,5, then the actual 127,63 becomes (127-5 = 122) and (63-5 = 58) so to create a 5 pixel border i need to move in another 5 which now makes the whole thing 5,5,117,53
I hope this makes sense
i think if i can sort this addressing problem then it will work as it should,
Last edited by cobra1 on Thu Apr 07, 2011 1:01 pm, edited 1 time in total.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ST7565 LCD DISPLAY
Hello,
The section of code that controls this is the MX_GotoXY function.
You could try changing this section.
to this
The section of code that controls this is the MX_GotoXY function.
You could try changing this section.
Code: Select all
MX_Write_Command(0x40); //set display start line
MX_Write_Command(page); //set page address
MX_Write_Command(columnh); //set column address
MX_Write_Command(columnl);
Code: Select all
MX_Write_Command(0x40); //set display start line
MX_Write_Command(mx_page); //set page address
MX_Write_Command(columnh); //set column address
MX_Write_Command(columnl);
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ST7565 LCD DISPLAY
Ok I see,
Thats not the fix then,
I'll see if I can find some time to have a bit of a better look into it for you. Have had a dig through to find out where my test LCD came from but at the moment I have a pile of different displays with no markings. Ill see if I can route out which one uses the ST7565 controller.
Thats not the fix then,
I'll see if I can find some time to have a bit of a better look into it for you. Have had a dig through to find out where my test LCD came from but at the moment I have a pile of different displays with no markings. Ill see if I can route out which one uses the ST7565 controller.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: ST7565 LCD DISPLAY
Ok no problem,
If it helps the st7565 is a COG controller so the lcd will have a little chip under it surrounded in silicone
Is there anywhere else in the code i can look to solve this problem?
If it helps the st7565 is a COG controller so the lcd will have a little chip under it surrounded in silicone
Is there anywhere else in the code i can look to solve this problem?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ST7565 LCD DISPLAY
Here is a link to the G version of the datasheet.
http://www.displaytech-us.com/pdf/appli ... 960601.pdf
Column and row addressing are detailed on pages 41 and 42.
Looks to me like they have made things slightly different in the G version so the write of command 0x40 is no longer needed or combined with the page address.
Let me know if you get anywhere and I will look more into it if you are still struggling.
http://www.displaytech-us.com/pdf/appli ... 960601.pdf
Column and row addressing are detailed on pages 41 and 42.
Looks to me like they have made things slightly different in the G version so the write of command 0x40 is no longer needed or combined with the page address.
Let me know if you get anywhere and I will look more into it if you are still struggling.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: ST7565 LCD DISPLAY
OK,
I have gone through pages 41-42, and checked it against the code.
I cant see much else wrong, is this the only part of the code that controls addressing?
I have gone through pages 41-42, and checked it against the code.
Code: Select all
void MX_GotoXY(char x, char y)
{
char page, columnl, columnh;
page = (y / 8) | 0xB0; ****correct****
columnh = (x >> 4) | 0x10; ****correct****
columnl = x & 0x0F; ****In the datasheet this says it should be 0x00, when i put that in i get allsorts of junk on screen****
if(x > 127) x = 0; //Ensure that coordinates are legal
if(y > 63) y = 0;
mx_currentx = x;
mx_currenty = y;
mx_page = y / 8;
MX_Write_Command(0x40); ****this doesnt make a difference if removed**** //set display start line
MX_Write_Command(page); //set page address
MX_Write_Command(columnh); //set column address
MX_Write_Command(columnl);
}
void MX_WriteData(char data)
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ST7565 LCD DISPLAY
Hello,
It could perhaps be something in the draw_rect macro that is causing the issues.
What if you simply call the PlotPixel macro or the draw_line macro? this is basically just calling the GotoXY macro so you should hopefully be able to confirm where the problem is.
It could perhaps be something in the draw_rect macro that is causing the issues.
What if you simply call the PlotPixel macro or the draw_line macro? this is basically just calling the GotoXY macro so you should hopefully be able to confirm where the problem is.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: ST7565 LCD DISPLAY
hi,
It doesnt matter what i do to it, it doesnt display correctly
plotting a pixel only works on the top line, after that the pixel location is wrong,
when printing a number ot a string, i just get a line,
The box was the closest i had to doing something it should
It doesnt matter what i do to it, it doesnt display correctly
plotting a pixel only works on the top line, after that the pixel location is wrong,
when printing a number ot a string, i just get a line,
The box was the closest i had to doing something it should
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ST7565 LCD DISPLAY
Hello,
I noticed in the code you sent that the command to mod the Y value was after the gotoXY function.
So you could try changing the Plot Pixel function to look like this.
If this doesn't work then it may be worth asking for their version of the gotoXY function.
I noticed in the code you sent that the command to mod the Y value was after the gotoXY function.
So you could try changing the Plot Pixel function to look like this.
Code: Select all
char data, mod_y;
MX_GotoXY(x, y);
mod_y = y%8;
data = MX_ReadData(); //Read 8 pixels from display
if (colour)
data = data | (0x01 << mod_y); //Set Pixel
else
data = data & (~(0x01 << mod_y)); //Clear Pixel
MX_WriteData(data);
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: ST7565 LCD DISPLAY
I have tried modifying the code i was sent to go with the custom.c file.
I managed to get the code to compile and downloaded to the pic, the line was showing up but it was 8 pixels thick and still had gaps and random pixels around it.
I managed to get the code to compile and downloaded to the pic, the line was showing up but it was 8 pixels thick and still had gaps and random pixels around it.