I have 132×65 dot matrix LCD. I am using STM32f303 controller in my application. I got success in displaying the normal 5×7 fonts on LCD.
Now I what I want to do is to display 13×16 custom sized fonts on the LCD. I generated the appropriate hex code for all 95 characters for the 13×16 size.
In 5×7 i was able to send all the bytes using following routine.
void Display(uint8_t Display_Row, uint8_t Display_Column, unsigned char)
{
uint16_t String_Pointer_Offset;
String_Pointer_Offset = 0;
while( '\0' != *(String_Pointer + String_Pointer_Offset) )
{
#if (defined(DISPLAY_WRAP_TEXT_STRINGS) && (DISPLAY_WRAP_TEXT_STRINGS == YEP ))
if(Display_Column > SHADOW_LAST_COLUMN) /* Check if it's the appropriate to wrap the row printing the exceeding character on the next line. */
{
Display_Column = 0;
Display_Row ++;
};
if (Display_Row > SHADOW_LAST_LINE)
{
return; /* Ran out of space :( */
};
#else /* if (not defined(DISPLAY_WRAP_TEXT_STRINGS) || (DISPLAY_WRAP_TEXT_STRINGS == NOPE )) */
if( (Display_Column > SHADOW_LAST_COLUMN)
|| (Display_Row > SHADOW_LAST_LINE ) )
{
return; /* Ran out of space :( */
};
#endif
Display.Row[Display_Row].Column [Display_Column] = *(String_Pointer + String_Pointer_Offset);
Display.Row[Display_Row].Touched[Display_Column] = TRUE;
Display_Column ++;
String_Pointer_Offset++;
};
return;
}
And using Display_Print(1,1,"ABC \0");
function in the main file i was able to display the string on my LCD.
But here number of bytes 26 instead of 8 so which can not be sent simultaneously on parallely interfaced LCD. Can anyone help me how to achieve this big 13×16 pixel font display task?
Best Answer
I just simulated the character you added to your question, and it looks OK to me. For reference, I wrote this code:
and it prints out:
So it seems that your font data for the character "A" seems ok and to write this to the LCD's row 0, you'd write bytes 0,2,4,6,8,... (0x00, 0x00, 0xc0, 0x30...) to row 0 and bytes 1,3,5,7,9... (0x0C, 0x03, 0x01, 0x01,...) to row 1.
I have only worked with LCDs on a direct hardware level. In case it's useful to you or someone else familiar with this platform, I can explain how to write byte B to row R, column C using the LCD display you seem to be using (NT75451):
First give the command SET PAGE (R), which in c language is (0xB0 | R). Then SET HIGH COLUMN ADDRESS, command (0x10 | (C >> 4)) and SET LOW COLUMN ADDRESS (0x00 | (C & 0xf)). Finally send the data byte (B).
Commands are sent with the LCD display's pin A0 pulled low and data is sent with A0 pulled high, but I suspect you already know this.
Hope this is helpful to you or someone else.
[EDIT]: Based on the draw function added to the question, you might try something like this to draw the big character: