[SOLVED] [moved] problem in using st7565 glad

Status
Not open for further replies.

samic45mit1

Member level 3
Joined
Dec 11, 2009
Messages
62
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
indore
Activity points
1,815
[moved] probleum in using st7565 glcd

I am using st7565 lib posted on link https://www.edaboard.com/threads/210640/ . I am trying to use function given below, and it is working fine. But when I try to use with font of diffrent size then lcd show garbage data. i USE FONT_WIDTH=24 and FONT_OFFSET=32. I think some think is wrong with FONT_OFFSET. So can you tell how to find FONT_OFFSET ?? how to select this, and relation or algo??


Thankyou


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
void GLCD_WriteChar(char charCode)                                 //function display font
{
unsigned char fontCollumn;
 
LCD_PAGE_COL_CHECK_FONT1();
 
for(fontCollumn = 0; fontCollumn < FONT_WIDTH; fontCollumn++)
LCD_WRITE_DATA(font5x7[((charCode- FONT_OFFSET) * FONT_WIDTH) + fontCollumn]);
LCD_WRITE_DATA(0);
}
 
 
#define FONT12X16_WIDTH 12
#define FONT12X16_HEIGHT 16
                                                               //font table, I give table of 3 but actual size is 96
static uint8_t __attribute__ ((progmem)) Font12x16[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // "(space)"
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0xFF, 0x33, 0xFF, 0x33, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // "!"
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // """
}

 
Last edited by a moderator:

Re: probleum in using st7565 glcd

Offset isn't the problem, but did you consider that a 12x16 font consists of 2*12 bytes per character and must write two bytes of data per pixel column?
 
Re: [moved] probleum in using st7565 glcd

Can you give some example code how i can do this??.

Thank's
 
Last edited:

Re: [moved] probleum in using st7565 glcd

The answer depends on the organization of your font table. I didn't yet figure out how your example font is designed. Writing characters higher than 8 pixel also involves cursor repositioning. It's usually preferred to prepare the GLCD output in a buffer and copy the buffer to the display.
 

Re: [moved] probleum in using st7565 glcd

Thanks for replay, I already attach link of lib and only difference in font size and I using ST7565 in SPI mode.
If you can suggest good lib or reference. Many time I face this problem and I have to use different font like 8X8, 5X7 etc. for my application.
 

Re: [moved] probleum in using st7565 glcd

I don't see a reference to fonts with > 8 pixel height in the previous thread. 5x7 or 8x8 is simple.

You posted a snippet of a 12x16 font, thus I presume you have an idea how the pixel are arranged in it.
 

Re: [moved] probleum in using st7565 glcd

Can you tell how to display 8x8 in this code? I only know the basic operation of glcd and most of time I dependent on lib like this.
 

Re: [moved] probleum in using st7565 glcd

I believe the code in post #1 will basically work. Question is however how you want to position the 8x8 character on the GLCD window of e.g. 128x64 pixels, if the 8-pixel (byte) alignment assumed in post #1 is appropriate.
 

Re: [moved] probleum in using st7565 glcd

This is the change I made in this function but glcd showing garbage value.

Code:
void GLCD_WriteChar(char charCode)
 {
 unsigned char fontCollumn;

 for(fontCollumn = 0; fontCollumn < 8; fontCollumn++)
      LCD_WRITE_DATA(Font8x8[((charCode- 32) * 8) + fontCollumn]);
      LCD_WRITE_DATA(0);
 }
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…