RA8875_Demo SPI LCD ER-TFTM070-5 K64F

26 Apr 2016

I have just tried to render the 778x458 file that works on the first layer to render on the second layer. No difference in result.

28 Apr 2016

Hi Peter, I sent you a private email to try to make more effective progress - with the intent to then report back here when we have the root cause and a solution.

01 May 2016

David,

Is it possible to communicate over mail? If you could let the second layer work then my problem is solved. I made a array with my numbers ( in compressed format) and that's fine on the screen but you still can see it run over the screen. Here the biggest part of the code. Can we speed up the process to write from flash to the panel? If we write a red block it is there in 1 instant, you don't see it scrolling down like the writing of the array.

static const uint8_t PETER1 [] = { 0x00,0x00,0x00,0x80,0x80,0xc0,0xc0,0xc0, 0x0160 0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf8,0xf8, 0x0168 0xfc,0xfc,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe, 0x0170 0xfc,0xfc,0x00,0x00,0x00,0x00,0x00,0x00, 0x0178 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x0180 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x0188 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x0190 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x0198 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x01a0 };

int16_t Set_Width=136; int16_t Loc_x=100; start location x bitmap int16_t Loc_y=100; start location y bitmap int16_t Total_Char=sizeof(PETER1); int16_t Actual_Char=0; int16_t Act_Width;

int main() { RetCode_t r; pc.baud(115200); lcd.init(800,480,8); init for 7" panel lcd.cls(); lcd.cls(0) clears layer 0 lcd.cls(1) clears layer 1

while(Actual_Char<Total_Char) { for (Act_Width=0; Act_Width<Set_Width; Act_Width++) { pc.printf ( "\n\r%x : ",PETER1[z]); for (int Set_Bit=0; Set_Bit<=7;Set_Bit++) { bool bit= (PETER1[Actual_Char]>>Set_Bit)&1; shift right and add with 1 bit is value first one is the LSB bit last one is the 80 MSB if (bit==true) lcd.pixel(Loc_x+Act_Width,Loc_y+Set_Bit,White);

if (bit==false) lcd.pixel(Loc_x+Act_Width,Loc_y+Set_Bit,Black); } Actual_Char++; } Loc_y=Loc_y+8; out of the first 8 writing on the x as

} }

01 May 2016

Hi Peter,

I tried sending you a private email. You can click on my name here, then look for the private email feature.

I added <<code>> on the line above your code, and <</code>> one line below your code, then tried to reconstruct it between.

static const uint8_t PETER1 [] = { 
0x00,0x00,0x00,0x80,0x80,0xc0,0xc0,0xc0,  // 0x0160 
0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf8,0xf8,  // 0x0168 
0xfc,0xfc,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,  // 0x0170 
0xfc,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,  // 0x0178 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  // 0x0180 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  // 0x0188 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  // 0x0190 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  // 0x0198 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  // 0x01a0 
};

int16_t Set_Width=136; 
int16_t Loc_x=100;  // start location x bitmap 
int16_t Loc_y=100;  // start location y bitmap 
int16_t Total_Char=sizeof(PETER1); 
int16_t Actual_Char=0;
int16_t Act_Width;

int main() { 
    RetCode_t r; 
    pc.baud(115200); 
    lcd.init(800,480,8);  // init for 7" panel 
    lcd.cls();  
    lcd.cls(0);  // clears layer 0 
    lcd.cls(1);  // clears layer 1

    while (Actual_Char<Total_Char) { 
        for (Act_Width=0; Act_Width<Set_Width; Act_Width++) { 
            pc.printf ( "\n\r%x : ",PETER1[z]); 
            for (int Set_Bit=0; Set_Bit<=7;Set_Bit++) { 
                bool bit= (PETER1[Actual_Char]>>Set_Bit)&1; // shift right and add with 1 bit is value first one is the LSB bit last one is the 80 MSB 
                if (bit==true) 
                    lcd.pixel(Loc_x+Act_Width,Loc_y+Set_Bit,White);
                if (bit==false) 
                    lcd.pixel(Loc_x+Act_Width,Loc_y+Set_Bit,Black); 
            } 
            Actual_Char++; 
        } 
        Loc_y=Loc_y+8;  // out of the first 8 writing on the x as
    }
}

OK, now I can add some comments.

Calling the .pixel( ) incurs a lot of overhead. It is the best solution when the pixels of interest are not adjacent, but in your case, you want to simply "stream" into a rectangular section.

I might suggest you look at this sequence:

update screen

  • window( )
  • SetGraphicsCursor( )
  • pixelStream (or booleanStream)

This works best if your graphic is an even multiple of 8 bits wide.

Alternately, if you create a Soft Font, following the technique I present, you could limit the overall font memory required by generating the minimal range of characters that include '0' - '9', ':' and whatever else you need. Then just put the character at the right location.

setup

  • foreground( )
  • background( )
  • SelectUserFont( )

update screen

  • SetTextCursor( )
  • printf( )
05 May 2016

Solution!

Peter was inadvertently using an old version of the library. Following an update the issues he was facing were resolved.

09 May 2016

Thanks David for your help. If you click right on the mouse on the RA8875 project , there you find the update option. I just erased the complete RA8875 structure and re downloaded it from the server. I still have 1 question. I did continue with my 7" panel and the soft fonts are working however he is ignoring the white parts in the font I have created. The font is for all characters 161x245 wide but writing them on the screen results in problems. I mean that not all characters are as big as the other one. If you make a eight or a one, the size is different however the overall size remains 161x245. The rest is filled with a blank one. See characters in attachment. It looks as if he ignores the blank parts beneath the characters. That means that some parts of the previous characters is still on the screen. The lcd.cls(1) does not work . See part of the code below. If I do a lcd.cls(1) then it doesn't do anything. I do have to do a lcd.cls() and then the screen is blanked every time and is correct but I assume this is for all layers. Is there a way to clear only the layer 1 that works? Is it normal that the soft font is ignoring the blank parts in the character? If I make them all 161x245 then I assume that every part of the previous character is overwritten.

/media/uploads/Peter%20[[/media/uploads/Peterbarco/characters161x245.docx]]%20barco/soft.jpg

12 May 2016

Hi Peter,

I don't have the big panel, so the code in the docx won't do me much good. And the soft.jpg is a picture of code, so that is helpful, but could have been between the <<code>> and <</code>> tags.

Do you have a picture of the effect?

The fonts are probably proportional fonts, and the font engine renders them in that same manner. so a wider 8 compared to a 1 is normal.

I guess the font tool should be able to generate the code for fixed-width fonts, but I haven't tried to do that.

The font height is the same for them all - with possibly generous white-space for descenders, but the width is back to the proportional nature. A picture would probably help with understanding the issue.

Maybe the issue is something like this:

show 'W'

     *         *
      *   *   *
       * * * *
        *   *

draw 'I' over the same top-left coordinate.

     *         *
     *    *   *
     * * * * *
     *  *   *

If this is the case, then it is based on the proportional font. Go back to the font tool, and load a fixed width font, and if the font tool has a setting for fixed-width I'm not sure.

For the cls(1), my API is unfortunately a bit confusing. The parameter list is documented as follows:

@param[in] layers is optional. If not provided, the active layer / is cleared. If bit 0 is set, layer 0 is cleared, if bit / 1 is set, layer 1 is cleared. If both are set, both layers / are cleared. Any other value does not cause an action.

So, the cls(1) actually clears layer zero, and a cls(2) clears layer 1. I think your code was on the assumption that the parameter 1 cleared layer 1, which is the sensible behavior, but as you see I bit-packed the parameter.