1 year, 9 months ago.

White screen - FRDM-K64F with RA8875 and Adafruit 7" TFT

I have been trying to initialise my Adafruit 7" TFT for some time but no matter what combination of programs and library's I try I have only ever got a blank white screen at best.

I have been mainly using David Smarts RA8875 library https://os.mbed.com/components/RA8875-Based-Display/ and variations of it. Somebody has made a fork of it for use with the K64F's but this still does not work. https://os.mbed.com/teams/FRDM-K64F-Code-Share/code/RA8875_KeyPadDemo/

I am confident with my SPI connections on my board. SCK = PTD1 MOSI = PTD2 MISO = PTD3 CS = PTD0 Reset = NC

I have wired my RA8875 and TFT to an Arduino Uno and used the demo sketch to initialise the TFT, this worked perfectly! So i'm confident that all components are in working order. The Arduino sketch made use of both the RST and INT pins of the RA8875 whereas the MBED programs do not?? Is this something particular for my screen that I need? By looking at the RA8875 library it looks like the screen gets reset in a similar manner but I am unsure.

I'm completely stumped as what else to try. I have tried to import versions of MBED os2 v146. (but I assume these are already included with the demo_Ra8875?) I have made sure that the lcd.init function has 800,480 in it. I have tried using different SPI ports.

I have been commenting out this line of code in order to compile the original RA8875_demo succesfully: but I dont even get a white screen with this.

/media/uploads/el16jh/code1.png

I have also tried to import older versions of FATfilesystem/SDFilesystem library's so that I dont need to comment it out but no luck.

The white screen is when I upload a program from Michael Ball's https://os.mbed.com/users/unix_guru/code/FRDM_RA8875_mPaint/

I have no idea what else to try and any help would be greatly appreciated.

/media/uploads/el16jh/thumbnail_20190310_121754.jpg

Thnaks, Jake

I've just dug out my BuyDisplay RA8875 display and checked the function.

I'm using an older version of the RA8875 library rev.85 on a FRDM-K22F and up to date Mbed OS2 rev.172

No peripherals connected and used this code:

#include "mbed.h"
#include "RA8875.h"

RA8875 lcd(PTC6, PTC7, PTC5, PTC4, NC, "tft");    // MOSI-SDI, MISO-SDO, SCK, /ChipSelect, /reset, name 
 
int main() { 
    
    led=1;wait(1);led=0;
    lcd.init(800,480);
    lcd.Backlight(1);
    lcd.foreground(255,255,255);
    lcd.cls();
    wait_ms(250);
    
    lcd.puts("Initialise!\r\n");
    
    
    while(1);
}    

I'm using a separate 2amp power supply for the display.

posted by Paul Staron 07 Mar 2019

Hi guys, just wanted to update you with my success!

After converting the Arduino libraries to work with MBED I managed to initialise the screen! I still don't know exactly where the problem/difference was but for now I don't care too much, I can carry on with the rest of my project.

Thanks very much for your help!

posted by Jacob Horgan 12 Mar 2019

2 Answers

1 year, 8 months ago.

Hi Jake,

I've been playing around with this display, latest RA8875 library works fine with the latest Mbed(OS2).

Your power supply arrangements look good, the LCD and driver board will probably max out at 600mA so a 1000mA supply should be okay and would power the LPC as well. One of the biggest problems is 'current inrush' when you connect the unit, doubling your normal operating current is generally a good guide to sizing power requirements.

lcd.frequency is the SPI speed to and from the Mbed and RA8875 controller board. The default in the library is 5MHz so that is well within the maximum speed of the RA8875 which is 12MHz. I have mine set at 10MHz which is actually 9.6MHz due to the MCU prescallers.

The 60Hz is the LCD screen refresh rate that will be handled by the T-con controller embedded on the LCD and the RA8875. Now that's where there could be a difference between the BuyDisplay units we're using here and yours. There are various sync settings that will be relevant to your display and could be why its not working here as you indicated.

You have two solutions, firstly you can compare and adjust the 'init' settings between the Arduino version and this one. The Arduino library is pretty straight forward only two files.

The other option is to copy the Arduino files into the compiler and change them to work in Mbed, it is actually quite straight forward, I've done it many times and may actually be quicker, you will need an 'Adafruit' version in any case for your set up.

The code below is the minimal I used to test.

int main() {

    lcd.init(800,480,50);   
    lcd.background(0,0,0);
    lcd.foreground(255,255,255);
    lcd.cls();
    
    lcd.puts(100,200,"TEST");
    
    while(1);
}    

Accepted Answer

Hi Paul, thanks for your detailed answer it is much appreciated.

I will be back in University tomorrow and will have access to power supplies and oscilloscopes, so I can make sure that all my power connections are correct and that I'm actually supplying enough current for the screen.

I agree with your 'Adafruit' version statement. I've previously compared the Arduino library and this one and I actually made a couple of changes to the initialisation - but it's still likely that I missed something.

After reading your comment I decided to try and convert the the Arduino library, after a few hours work I've managed to get it to compile, it does not work yet of course haha, but I think I need to get some sleep before debugging it.

I think I need to do a lot more reading up on the MBED SPI functions to make sure I'm getting that right, as I think David created his own functions for his Program? I may be wrong though, like I said, still very much a learner here!

Cheers, Jake.

posted by Jacob Horgan 11 Mar 2019
1 year, 9 months ago.

hi Jacob,

At least some other users also had the white-screen, and sometimes the explanation is simple - that the PC USB port doesn't have enough power to energize the display at full brightness. If your code starts the display at high brightness, dial it way down in the init(), to rule out that possibility. As you see in Paul's note above, he runs a separate power supply.

When developing, I sometimes do it all from the PC USB port - and have to remember to dial it down. For "deployed" projects, I have a supply capable of the mbed, display, and other attached circuits. I don't have the K64F, but the LPC1768 is about 150 mA, then when I use Ethernet I have to up the budget by another 50 mA, and the display can draw between 300 mA and over 600 mA depending on the size and brightness - so basically 1 A if you don't have much else going on.

And then there is the 3V v. 5V variants, and 4-wire SPI v. other IO variants.

Hi guys, Thank you both for your quick replies!

I managed to get hold of a LPC1768 yesterday in a bid to make my setup as similar as possible to your original David. Still no luck unfortunately with just a dark screen on initial uploads.

Changing the value within the init() function does not seem to have an effect. Whereas adding the Backlight() function just below brings us to the white screen - regardless of if powered from an external power source or my laptop (since your answers I have tested all fresh uploads from an external power source). However, the white screen is only apparent when Backlight(1) is true, all other lower values in this return us to the dark screen.

lcd.init(LCD_W, LCD_H, LCD_C, 1);
lcd.Backlight(1);

I have compared the initialisation sequence of your library to that of the Arduino RA8875 library for this screen https://github.com/adafruit/Adafruit_RA8875 - and I noticed a couple of minor differences:

The PLLC1 on line 314 changed from: 0x0C to 0x0A. The Vertical Non-Display Period Bit on line 350 changed from: 0x20 to 0x1F

I don't know how important these changes are, but the screen responds the same way as I mentioned above, regardless of running your original program or my slightly changed program.

I am starting to think that it must be something different with my screen. https://cdn-shop.adafruit.com/product-files/2354/adafruit_SPEC-YX700WV03_REV.A-787880.pdf.

I am going to email the manufacturers to see if they can shed any light. I am also going to revert back to the K64F and attempt to upload again but with these initialisation changes + an external power source.

The screen has no option for a separate power supply by the way - it only has the 40pin flex cable as it is designed specifically to work with the RA8875.

Apologies for what must seem trivial questions and information! I'm a University student and still have a lot to learn.

Many thanks again, Jacob

posted by Jacob Horgan 08 Mar 2019

Hi Jacob, I'm not ready to give up on this just yet. Can you share links to the adafruit display (not just the datasheet you linked above)? That datasheet appears to be for a "raw LCD panel", and the ribbon connects to a controller. I'd like to see the chain of parts from your mbed to this panel. thx!

posted by David Smart 08 Mar 2019

Hi David, most appreciative! So the panel is in fact a "raw LCD panel", sold with the intention of being connected to an RA8875. Link here - https://www.adafruit.com/product/2354. I am regretting not just buying a BuyDisplay screen now though!

The only components involved are my board connected to the RA8875 and then the ribbon cable connected to the LCD.

posted by Jacob Horgan 08 Mar 2019

Just quickly jump in here,

That's the LCD screen link, do have the RA8875 interface board?

https://www.adafruit.com/product/1590

If so how are you wiring to the Mbed board and power supply connections, how are these arranged ?

posted by Paul Staron 08 Mar 2019

I have the RA8875 interface board indeed.

My connections from the LPC1768 to the RA8875 are:

GND - GND. 3.3V - VIN. p5 - MOSI. p6 - MISO. p7 - SCK. p12 - CS.

I have just realised that maybe I am not supplying the board with an external power supply correctly. For this I have been plugging the microUSB connection into a 5V / 2.1A wall plug. Should I be supplying VIN of the LPC1768 with a supply instead?

posted by Jacob Horgan 08 Mar 2019

Hi Jacob, I looked at the information on the adafruit site.

As best I can tell, that RA8875 Interface board accepts 5V and provides power to the display module.

Independent of that, you want to power the LPC1768, ideally from the same supply, so that it and the display can power-up together.

Independent of that, your PC USB cable will also power the LPC1768.

I don't think the 3.3v output on the LPC1768 can provide the power for the RA module and display, so each will need to be powered from your 5V wall plug. And be sure they have a common ground pin.

posted by David Smart 09 Mar 2019

Hi David,

I have followed your instructions regarding the power supplies and still no luck unfortunately. I have edited the OP to include a picture of my connections - the RA8875 and LPC are powered from the 5V wall plug and the LPC is also connected via PC USB.

The same problems from before are still apparent - I only get the white screen when the back-light is set to max:

lcd.init(LCD_W, LCD_H, LCD_C, 255);
//lcd.Backlight(1);

Any value lower than 235 returns a dark screen. At value 235 the screen is flickering white. And at any value above 235 it is a solid white screen.

The information regarding the Adafruit screen says that it needs to be refreshed at 60 Hz. I have changed the lcd.frequency() value to 60, but this doesn't seem right being such a big change from your 500,000. Doing this however, does bring a white screen on regardless of the backlight value.

Also, I imported this program straight from your page, should I still try replacing the MBED library that comes with it with older versions?

Thank you again for your time spent on this.

posted by Jacob Horgan 10 Mar 2019

The demo's on my page worked for me as-is. I'm not sure where to go next. mbed OS 2 v118 - 138. I have not tested the latest. And set the backlight to 40 or so. It will be bright enough to see. The Whitescreen is usually power supply related. - even though you've reworked that.

Some of the protoboards power-rails along the long edge stop half-way, and you need to jumper across to continue. Yours might be continuous, but it is worth a check.

If you unplug the usb from your mbed, it should still be powered on.

posted by David Smart 10 Mar 2019

Tomorrow I will be back in University and will have access to better power supplies and some oscilloscopes, I can make sure that all my power connections are correct and that I'm actually supplying enough current for the screen.

I will update here if I have any success.

posted by Jacob Horgan 11 Mar 2019

Hi guys, just wanted to update you with my success!

After converting the Arduino libraries to work with MBED I managed to initialise the screen! I still don't know exactly where the problem/difference was but for now I don't care too much, I can carry on with the rest of my project.

Thanks very much for your help!

posted by Jacob Horgan 12 Mar 2019