Electronic – Sendingdata on display

dot-matrix-displaystm32f3

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:

    unsigned char cha[] = {0x00, 0x0C, 0x00, 0x03, 0xC0, 0x01, 0x30, 0x01, 0x0C, 0x01, 0x30, 0x01, 0xC0, 0x01, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
void main(void) {
    int i;
    int j;
    for (i=0; i<sizeof(cha); i++) {
        for (j=0; j<8; j++) {
            printf("%c",(cha[i]&(1<<j)) ? '#' : '.');
        }
        i++;
        for (j=0; j<8; j++) {
            printf("%c",(cha[i]&(1<<j)) ? '#' : '.');
        }
        printf("\n");
    }
}

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:

void LCD_Draw_Char(uint8_t Line, uint8_t Column, unsigned char Char) // Bypass shadow display characters matrix to directly draw one character.
{
  Task_S_T Task;
  uint8_t Index;

  LCD_Write_Command_SetPage(Line);          // Set the virtual line index.
  LCD_Write_Command_SetColumn(Column);      // Set the column index.
  Task.Command = TASK_WRITING;
  Task.Iter    = 0;
  for( Index = 0; Index < 13; Index++ )
  {
    if( (Column + Index > DISPLAY_LAST_COLUMN)
     || (Line           > DISPLAY_LAST_LINE  ) )
    {
      return; /* Ran out of space :( */
    };
    Task.Data = Combination_Of(ACTION_WRITE_DATA_TO_RAM, Font_13x16[Char - BIG_FONT_FIRST_CHAR_CODE][Index*2]);
    LCD_FIFO_Push(Task);
  };
  Task.Data = Combination_Of(ACTION_WRITE_DATA_TO_RAM, 0x00); /* The separator column of each char is set here to prevent dirty pixels being left unerased. */
  LCD_FIFO_Push(Task);                                        /* The separator column of each char is set here to prevent dirty pixels being left unerased. */


  LCD_Write_Command_SetPage(Line+1);          // Set the virtual line index.
  LCD_Write_Command_SetColumn(Column);      // Set the column index.
  Task.Command = TASK_WRITING;
  Task.Iter    = 0;
  for( Index = 0; Index < 13; Index++ )
  {
    if( (Column + Index > DISPLAY_LAST_COLUMN)
     || (Line           > DISPLAY_LAST_LINE  ) )
    {
      return; /* Ran out of space :( */
    };
    Task.Data = Combination_Of(ACTION_WRITE_DATA_TO_RAM, Font_13x16[Char - BIG_FONT_FIRST_CHAR_CODE][Index*2+1]);
    LCD_FIFO_Push(Task);
  };
  Task.Data = Combination_Of(ACTION_WRITE_DATA_TO_RAM, 0x00); /* The separator column of each char is set here to prevent dirty pixels being left unerased. */
  LCD_FIFO_Push(Task);                                        /* The separator column of each char is set here to prevent dirty pixels being left unerased. */


  return;
}