Author Topic: Large custom fonts in 8080 parallel mode  (Read 2494 times)

bluedog54

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Large custom fonts in 8080 parallel mode
« on: July 16, 2015, 04:53:39 PM »
I made some custom numeric characters that are 7 bytes wide and 92 pixels tall.  In serial mode, they all display perfectly, but are too slow to keep up with my volume control operation. So I switched to 8080 parallel mode. Using your routines for custom characters (1 or 2 bytes wide and 11 pixels tall), I have my giant characters displaying perfectly for about 35 lines, then for no reason, the character starts at the top again and shifted to the left by a bunch of pixes, then after about another 35 pixes, it starts again at the top of the character, but the x is lined up again.  Also, it doesnt matter if I shift the y axis up or down, it still resets the y after the same number of rows are displayed.

Is there a limitation or something I should now about the OLED_WriteMemoryStart_160128RGB() command that you cant use it for over a maximum size area? 

 I have only 1 character loaded in ram (after the icon data)...its a 6. (I get the same results with other characters). 

// Large Font Start
const unsigned char chr_f7s_30[] =         // 7 bytes per row 53 pixels wide
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF,
0x80, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFE, 0x00,
0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00,
0x07, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x1F, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x3F, 0xFF, 0x01, 0xFF, 0xF8, 0x00, 0x00, 0x7F, 0xF8, 0x00, 0x7F,
0xF8, 0x00, 0x00, 0x7F,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x00, 0x1F,
0xFE, 0x00, 0x00, 0x03, 0xFF, 0x00, 0x1F, 0xFC, 0x00, 0x00, 0x03, 0xFF, 0x00, 0x1F, 0xF8, 0x00,
0x00, 0x01, 0xFF, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x01,
0xFF, 0x80, 0x1F, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x1F, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0x80,
0x1F, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x1F, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x0F, 0xF0,
0x00, 0x00, 0x00, 0xFF, 0x80, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x0F, 0xF0, 0x00, 0x00,
0x00, 0xFF, 0x80, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x0F, 0xF8, 0x00, 0x00, 0x00, 0xFF,
0x80, 0x07, 0xF8, 0x00, 0x00, 0x01, 0xFF, 0x80, 0x07, 0xF8, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x07,
0xFC, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x07, 0xFC, 0x00, 0x00, 0x03, 0xFF, 0x00, 0x03, 0xFE, 0x00,
0x00, 0x03, 0xFE, 0x00, 0x03, 0xFE, 0x00, 0x00, 0x07, 0xFE, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x07,
0xFE, 0x00, 0x01, 0xFF, 0x80, 0x00, 0x0F, 0xFC, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x1F, 0xFC, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x7F, 0xF8, 0x00, 0x00, 0x7F, 0xFC, 0x03, 0xFF, 0xF0, 0x00, 0x00, 0x3F,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xC0, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFE, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xE0, 0x00, 0x00, 0x00,
0x00, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
//Large Font End

My routine:

 void OLED_LargeFont_160128RGB(unsigned long textColor, unsigned long backgroundColor)    // function to show Large font character
{
    int i;
    int count;
    unsigned char index = 0;
    unsigned char y_pos = 118;  //was 118
    unsigned char mask = 0x80;
       
   for(i=0;i<92;i++)     // display large font character
    {
        OLED_SetPosition_160128RGB(51,y_pos);
        OLED_WriteMemoryStart_160128RGB();
        for (count=0;count<8;count++)
        {
            if((chr_f7s_30[index] & mask) == mask)
                OLED_Pixel_160128RGB(textColor);
            else
                OLED_Pixel_160128RGB(backgroundColor);
            mask = mask >> 1;
        }
        index++;
        mask = 0x80;
        for (count=0;count<8;count++)
        {
            if((chr_f7s_30[index] & mask) == mask)
                OLED_Pixel_160128RGB(textColor);
            else
                OLED_Pixel_160128RGB(backgroundColor);
            mask = mask >> 1;
        }
        index++;
        mask = 0x80;
                for (count=0;count<8;count++)
        {
            if((chr_f7s_30[index] & mask) == mask)
                OLED_Pixel_160128RGB(textColor);
            else
                OLED_Pixel_160128RGB(backgroundColor);
            mask = mask >> 1;
        }
        index++;
        mask = 0x80;
                for (count=0;count<8;count++)
        {
            if((chr_f7s_30[index] & mask) == mask)
                OLED_Pixel_160128RGB(textColor);
            else
                OLED_Pixel_160128RGB(backgroundColor);
            mask = mask >> 1;
        }
        index++;
        mask = 0x80;
               for (count=0;count<8;count++)
        {
            if((chr_f7s_30[index] & mask) == mask)
                OLED_Pixel_160128RGB(textColor);
            else
                OLED_Pixel_160128RGB(backgroundColor);
            mask = mask >> 1;
        }
        index++;
        mask = 0x80;
                for (count=0;count<8;count++)
        {
            if((chr_f7s_30[index] & mask) == mask)
                OLED_Pixel_160128RGB(textColor);
            else
                OLED_Pixel_160128RGB(backgroundColor);
            mask = mask >> 1;
        }
        index++;
        mask = 0x80;
                for (count=0;count<8;count++)
        {
            if((chr_f7s_30[index] & mask) == mask)
                OLED_Pixel_160128RGB(textColor);
            else
                OLED_Pixel_160128RGB(backgroundColor);
            mask = mask >> 1;
        }
        index++;
        mask = 0x80;
        y_pos--;
   }
//   index = 0;
//   y_pos = 118;
}


Thanks!!!

Also, the character seems still to paint slowly....do you have any suggestions for a faster giant character write?

Here is my

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 355
  • Karma: 10
    • View Profile
Re: Large custom fonts in 8080 parallel mode
« Reply #1 on: July 22, 2015, 03:12:47 PM »
This issue has been solved thanks to Michael L.

You have to change the variable for the index from an unsigned char to an unsigned int. The size of the array is too large to address with an unsigned char.

 

NHD‐3.5‐320240MF‐ATXL#‐CTP‐1 Problem with standby mode

Started by guenterBoard TFTs

Replies: 0
Views: 1940
Last post June 16, 2016, 12:14:36 PM
by guenter
NHD-0420H1Z-FL-GBW-33V3 pull-ups and pull-downs in 4 bit mode

Started by richardwrightBoard Character LCDs

Replies: 3
Views: 3003
Last post December 15, 2014, 05:12:27 PM
by Michael_L
NHD0420CW-A*3 tHREE LINE MODE, MIDDLE LINE DOUBLE HEIGHT

Started by wb2dybBoard OLEDs

Replies: 3
Views: 3110
Last post July 01, 2015, 09:49:46 AM
by Paul_B
NHD-2.4-240320CF-CSXN#-F works in 18 bits(262K colors) mode

Started by charlieBoard TFTs

Replies: 3
Views: 2164
Last post March 15, 2016, 10:39:50 AM
by Saurabh_B
Text orientation not changing with Extended Entry Mode Set Register

Started by tekknojoeBoard OLEDs

Replies: 5
Views: 1395
Last post January 27, 2017, 10:13:57 AM
by jmadsenee