Closed GJakobsche closed 8 years ago
Looks like another RA8875 hardware bug, I have solved many during develop. The code affected with or without layers it's the same, I will try to solve this for the b11.
Ok, started to look sort this issue, with 480x272 this not happenen for 16bit (at this resolution it's possible have 2 layers) but as soon I run at 8 bit the problem comes out. Looks like a RA8875 bug in 8pixel mode. I can confirm it's an 8bit bug, even comment out the two lines mentioned and initializing screen at 8 bit by using tft.begin(RA8875_800x480,8); the color bug happen again. The datasheet it's not illuminating but I've tried an undocumented attempt and now colors looks almost same. Since you are working in 8bit mode when switch layers at 800x480 I have tried to send a 8bit color to RA. Please download the 0.70b11p2 and try.
Definetively it's isolated to drawPixel, RA8875 has hardware routine that convert internally 16bit colors in 8 Bit but it try to simulate 16 bit, this works for setColor function but drawPixel write directly in RA8875 DRAM so it expect an 8 bit color when you are in 8 bit color mode! So it's not a real bug, it's an hardware limitation. I'm writed a seamless workaround to fix this, it's not optimized but compact 16bit color data into a single 8bit as requested by RAiO datasheet pg.75 and write a single byte instead a word, this just in 8bit mode. The code it's in 0.70b11p2
Looks ok to me now. Just one note about your example, you don't really need displayOn, backlight, brightness and clearScreen just after begin since the library performs all these commands inside begin (and also set the cursor at 0,0 and lot's more), in brief, just after begin the library it's fully initialized.
Great! Thanks for compensating for the hardware limitation! I will try the new library in the coming days.
Thanks for your comments on no need call to "displayOn," etc. I may streamline my code. Best regards, George
When I turn on layers and use drawPixel to draw a row of adjacent pixels, i.e., I increment the x coordinate by 1, as drawPixel draws each pixel, it seems to also draw on top of the previous pixel with a different color, often black. The net effect is as each pixel is drawn, the previous pixel is erased, at least when the pixel being drawn is red, green or blue. However, if I increment the x coordinate by 2, i.e., I skip a pixel between each drawn pixel, no pixels are erased or overwritten.
If I turn off layers, this problem does not occur, i.e., I can increment the x coordinate by 1 and drawPixel draws adjacent pixels as expected.
I wrote a small program to demonstrate this problem on a 7-inch EastRising display.
I understand that when layers are turned on, the color space is cut in half, so colors need to be 8 bits, rather than 16 bits. However, that does not explain why skipping a pixel causes a different result than drawing adjacent pixels, while layers are turned on. Am I doing something wrong?
-George