Newhaven Display Forum

Newhaven Products => OLEDs => Topic started by: bluedog54 on July 16, 2015, 04:53:39 PM

Title: Large custom fonts in 8080 parallel mode
Post by: bluedog54 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, 0xF0, 0x00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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
Title: Re: Large custom fonts in 8080 parallel mode
Post by: Saurabh_B 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.