Maker Pro
Maker Pro

320x240 LCD Display, SED1335 (RAiO RA8835) controller interfaced with ATmega32

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
The datasheet for the controller states in chapter 10 that for fonts other than the standard font you will have to add an external character generator ROM. I suppose that is not possible in your case.
You can use any font by rendering it as graphic on the µC.
 

jhankhana

Oct 18, 2021
5
Joined
Oct 18, 2021
Messages
5
Thank you so much for the reply.

char can be displayed by the below function but the problem is..... have to give 39 times 0 data {that is for(int j=0; j<((320-h)/8); j++} GLCD_WriteData(0);} . and that second or next char can not be displayed beside the first one. The next char goes to the next line.

and if I use for loop{for(int j=0;j<48;j++)} it displayed the same char in the whole line repeatedly. and the next char goes to the next line.


void GLCD_WriteChar( char charToWrite)
{
GLCD_WriteCommand(SED1335_MWRITE);

int h=8, w=16;
charToWrite -= 31;

for(int k = 0; k <16 ; k++)
{
//for(int j=0;j<48;j++)

GLCD_WriteData(GLCD_ReadByteFromROMMemory(( char *)((int) FONT8x16 + (((((w) * charToWrite) + (k)) )))));

for(int j=0; j<((320-h)/8); j++)
GLCD_WriteData(0);
}


It would be great if I can have help regarding the same.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
problem is..... have to give 39 times 0 data
Sorry, I don't understand what you mean by this?
Do you want to write a character into a new line?
Maybe a graphic example of what you want to do could help.
 

jhankhana

Oct 18, 2021
5
Joined
Oct 18, 2021
Messages
5
I want to write one string in a single line that is
hello

but what happens is ...
h
e
l
l
o
 

jhankhana

Oct 18, 2021
5
Joined
Oct 18, 2021
Messages
5
//function to write char :

void GLCD_WriteChar( char charToWrite)
{
GLCD_WriteCommand(SED1335_MWRITE);

int h=8, w=16;
charToWrite -= 31;

for(int k = 0; k <16 ; k++)
{
for(int j=0;j<48;j++)

GLCD_WriteData(GLCD_ReadByteFromROMMemory(( char *)((int) FONT8x16 + (((((w) * charToWrite) + (k)) )))));

//for(int j=0; j<((320-h)/8); j++)
//GLCD_WriteData(0);
}
//GLCD_GraphicGoTo(1,0);
}


//function to write string:
void GLCD_WriteString(char * stringToWrite)
{
while(*stringToWrite)
GLCD_WriteChar(*stringToWrite++);
}
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
1. Why this loop?
Code:
for(int j=0;j<48;j++)

GLCD_WriteData(GLCD_ReadByteFromROMMemory(( char *)((int) FONT8x16 + (((((w) * charToWrite) + (k)) )))));
Since the variable "j" isn't used within the loop, the compiler may as well optimize the loop by removing it completely.

2. Try void GLCD_WriteText(char * tekst) from the library
 

jhankhana

Oct 18, 2021
5
Joined
Oct 18, 2021
Messages
5
1. Why this loop?
Code:
for(int j=0;j<48;j++)

GLCD_WriteData(GLCD_ReadByteFromROMMemory(( char *)((int) FONT8x16 + (((((w) * charToWrite) + (k)) )))));
Since the variable "j" isn't used within the loop, the compiler may as well optimize the loop by removing it completely.

2. Try void GLCD_WriteText(char * tekst) from the library


Thank you so much for the reply.
It was solved with the help of command SED1335_CSRW.
and I also used GLCD_WriteText(char * tekst) from the library and ut works completely ok with 8x8 default font but again not able to use 8x16 default font of LCD.
 
Top