RA8875 800x480 5" display issues

econjack

Well-known member
I'm working on an SDR project using Win10 in the Arduino 1.8.19 IDE and the Teensy 4.1. There are two issues. First, I have a "block artifact" which can be seen in the upper-left corner of the display:
ScreenV012Small001.jpg
I have not been successful in removing it, including working with both layers of the display. Two other displays have the same problem, so I don't think it's the fault of the display hardware.

The second problem is that the "Split Active" message in the upper-right of the spectrum display is painted in red using the standard tft.print() method, but it is not responding to the setFontScale() method (e.g., tft.setFontScale( (enum RA8875tsize) 0);). That method works in the ino file, but there are 22 other cpp project files and trying to change in the support files, which is what I'm trying to do, seems to be ignored. That is, the code does display the message, but uses the (larger) default size. The work around I used to get the image photo was to use setFont() with another font size.

Both of these are probably flat-forehead mistakes on my part, but I'm coming up empty. Any ideas?
 
Sorry, hopefully someone who uses these displays on a regular basis will be able to suggest possibilities.

But it might help others to help out if there were more details about the software. For example which library are you using for the RA8875?
What resolution display and color mode? Do you try to use Layers?
Hardware Cursor? don't remember what happens if you do something like: TFT.showGraphicsCursor(false);

Font issue: What type of font are you using?
Hardware Font?
ILI9341 type font?
GFX type font?


I only dabble with the few of these displays I have, and usually only to try to fix problems in our version of the library.

Good luck.
 
As @KurtE mentioned you don't mention what fonts you are using. Just a couple of things off the top on my head based on the RA8875 library included in Teensyduino.

First setFontScale() method is only applicable to RA8875 fonts not to ILI9341 r GFX type fonts. According to the description:
Set the Text size by it's multiple. normal should=0, max is 3 (x4) for internal fonts
With Rendered fonts the max scale it's not limited
This time you can specify different values for vertical and horizontal
Parameters:
xscale: 0..3 -> 0:normal, 1:x2, 2:x3, 3:x4 for internal fonts - 0...xxx for Rendered Fonts
yscale: 0..3 -> 0:normal, 1:x2, 2:x3, 3:x4 for internal fonts - 0...xxx for Rendered Fonts
You can not reduce the size smaller than the default size. Rendered fonts in this case are the internal RA8875 fonts if I remember correctly. This also applies to setFontScale. You can go larger but doesn't appear to can go smaller.

This is probably the reason why using setFont(xxxx), works
The work around I used to get the image photo was to use setFont() with another font size

As for the artifact in the upper right hand corner I am at a loss. As Kurt said maybe someone who uses these displays can help more.
 
Sorry, hopefully someone who uses these displays on a regular basis will be able to suggest possibilities.

But it might help others to help out if there were more details about the software.

For example which library are you using for the RA8875? https://github.com/sumotoy/RA8875
What resolution display and color mode? 800x480 (see thread title), default color
Do you try to use Layers? Yes, 2
Hardware Cursor? No
don't remember what happens if you do something like: TFT.showGraphicsCursor(false);

Font issue: What type of font are you using? display default ER3304
Hardware Font? Yes, using ER3304
ILI9341 type font? No
GFX type font? Used elsewhere in code; call tft.setFontDefault(); when done with GFX font



I only dabble with the few of these displays I have, and usually only to try to fix problems in our version of the library.

Good luck.

To answer your questions:

For example which library are you using for the RA8875? https://github.com/sumotoy/RA8875
What resolution display and color mode? 800x480 (see thread title), default color
Do you try to use Layers? Yes, 2
Hardware Cursor? No
 
The "T41-EP" string in the upper-right corner is the default size. That is, if you don't try to do any "size" calls, that's the size that is used. The version number immediately after that string is size 0. The size below the frequency (7.147) is also size 0. That's what I want for the "Split Active" string. Clearly is can reduce the default font size, which is why I'm so puzzled.
 
To answer your questions:

For example which library are you using for the RA8875? https://github.com/sumotoy/RA8875
What resolution display and color mode? 800x480 (see thread title), default color
Do you try to use Layers? Yes, 2
Hardware Cursor? No
Suggestion try updating to our Forks of the library.
Note: It is currently installed by Teensyduino.

The Fork/Branch that is sort of our Master one is: https://github.com/mjs513/RA8875/tree/RA8875_t4
Although you saying you use GFX fonts, maybe implies you are using our updated version.


So with this size display and turning layers on, the code I believe will automatically switch you to the 256 color mode. As the RA8875 does not have enough memory
for 800x480 with 16 bit colors.

I have not used the Hardware Fonts, other than the default built in one... So I can not help you there. but maybe it is not in the right context? By context I mean, right layer? In right mode? active window? ... Again I am rusty on these displays.
 
Suggestion try updating to our Forks of the library.
Note: It is currently installed by Teensyduino.

The Fork/Branch that is sort of our Master one is: https://github.com/mjs513/RA8875/tree/RA8875_t4
Although you saying you use GFX fonts, maybe implies you are using our updated version.


So with this size display and turning layers on, the code I believe will automatically switch you to the 256 color mode. As the RA8875 does not have enough memory
for 800x480 with 16 bit colors.

I have not used the Hardware Fonts, other than the default built in one... So I can not help you there. but maybe it is not in the right context? By context I mean, right layer? In right mode? active window? ... Again I am rusty on these displays.
Hi Kurt:
I installed the new library, but no change with the mystery block. However, I did take the time to run the Mandelbrot example and it works fine...no block. So, it's something I'm doing wrong in my code. My best guess is that I've screwed something up with the layers, mode, or window. If I solve this, I'll report back.
 
Solved -- RA8875 800x480 5" display issues

I think I've solved my "block display mystery". In my code, I instantiated the display object with:

tft.begin(RA8875_800x480);

This was originally from an old RA8875 library and some of the current library examples use this call. I was using that for all the display processing up until this morning. Then I started looking in the special library written for the Teensy (https://github.com/mjs513/RA8875/tree/RA8875_t4). I had been using the default library that comes with the Teensy software patch since it was installed, but I never changed the begin() method call.

Looking at the new library source code, I saw:

void begin(const enum RA8875sizes s,uint8_t colors=16, uint32_t SPIMaxSpeed = (uint32_t)-1, uint32_t SPIMaxReadSpeed = (uint32_t)-1 );

After spending some time finding out what SPI speed options are, I changed my call to:

tft.begin(RA8875_800x480, 8, 20000000UL, 4000000UL); // parameter list from library code

No block on the display!! What I still don't understand is why my call wasn't flag as an error because I wasn't calling the method with the correct number of parameters. It is not overloaded. I'm pretty sure that what was happening is that it got the first parameter correct, but the last three were whatever random stuff was popped off the stack. If anyone wants to enlighten me as to why prototyping took a nap, I'd like to know.
 
void begin(const enum RA8875sizes s,uint8_t colors=16, uint32_t SPIMaxSpeed = (uint32_t)-1, uint32_t SPIMaxReadSpeed = (uint32_t)-1 );


If anyone wants to enlighten me as to why prototyping took a nap, I'd like to know.

Jack:

Take another look at the function definition. You should notice that all but the first parameter are assigned default values. Defining the function this way allows the function to be called with only one parameter value (as you were), or with any number of parameter values up to the max. This is a convenience feature provided by C++. For any parameter that you want to specify (e.g. the third) by passing a value, all preceding parameters must also be passed a value (in this example, all of the first three parameters must be passed a value).

Hope this clears things up for you . . .

Mark J Culross
KD5RXT
 
Jack:

Take another look at the function definition. You should notice that all but the first parameter are assigned default values. Defining the function this way allows the function to be called with only one parameter value (as you were), or with any number of parameter values up to the max. This is a convenience feature provided by C++. For any parameter that you want to specify (e.g. the third) by passing a value, all preceding parameters must also be passed a value (in this example, all of the first three parameters must be passed a value).

Hope this clears things up for you . . .

Mark J Culross
KD5RXT

It does, but I did not know that about C++. Is that a feature that came in during the past 20 years or so? I didn't look in the library for that because I thought it was my code, so that's where I spent my time looking. I finally was pretty sure that my code wasn't causing the problem, so I looked in the library at the method's definition. Once I saw it, it took about a minute to fix it.

To me, that's a dangerous convenience since it neuters part of the reason for prototypes. Oh well, lesson learned.
 
Back
Top