Trouble with the HX8357 display and Web IDE library for same [SOLVED]

Hello all!

I’ve searched a lot, but to no avail. I’ve been trying to use the Adafruit HX8357 TFT LCD display for some time now and I’m out of ideas. Nothing seems to work - the display powers up to a dead, white screen, and then nothing happens.

Here’s some specifics:

  1. I’m using the SPI side of the display. I know that the display and solders are good, because the display works fine when used with my Arduino Uno.

  2. I am running at 5V, sometimes 4.8-ish. I keep a 1000uF 16V capacitor in my breadboard power bus as a filter.

  3. I’m using the Adafruit_HX8357 and Adafruit_mfGFX libraries, and I’m attempting to run the GraphicsTest.ino example file included in the HX8357 library.

  4. My Connections are as follows:

CORE —> DISPLAY
A7 —> D/C
A6 —> CS
A5 —> MOSI
A4 —> MISO
A3 —> CLK

I’m really confused. I’ve used the ILI9341 display with no problem, but the project requires a larger display. I thought for sure with an SPI interface and a web IDE library that this was a perfect choice, but now I’m starting to second guess myself.

Hopefully I’m doing something incredibly obviously wrong that I’m not aware of, but you are!

Many thanks,

Mark

Despite the fact that you didn’t have any trouble with the very same display on Arduino, I’m still asking these questions :wink:

Have you bridged the bridged the IM2 jumper at the bottom of the board or are you alternatively pulling the IM2 pin to 3V3?
How have you got the RST pin connected? Or have you got it open (which would be fine too)?
Have you got the CSS pin open, to avoid a possibly present SD card to interfere with the TFT SPI?

2 Likes

Bridged the IM2 Jumper, RST is open, CCS is open. The only pins on the HX8357 I’m using are the ones mentioned above, and 5V/GND.

ScruffR, I was really hoping you’d help :slight_smile: Thanks for the library BTW!

Edit: I’m gonna re-heat and reflow the solder on the IM2 jumper. No other hardware thing I’ve thought of makes any sense, at least it’s something.

Has this library been ported to Particle yet? I see a bunch of Arduino specific code in there (even with the #define __arm__ ) like this:

void Adafruit_HX8357::writecommand(uint8_t c) {
  *dcport &=  ~dcpinmask;
  //digitalWrite(_dc, LOW);
  *clkport &= ~clkpinmask;
  //digitalWrite(_sclk, LOW);
  *csport &= ~cspinmask;
  //digitalWrite(_cs, LOW);

  spiwrite(c);
  //Serial.print("Command 0x"); Serial.println(c, HEX);

  *csport |= cspinmask;
  //digitalWrite(_cs, HIGH);
}

The commented out digitalWrite() calls would work on Particle but the direct OR’ing into the port does not.

If you have not ported this library already, I would try commenting out the direct port manipulations and uncomment the digitalWrite() statements.

1 Like

@bko , As far as I know, yes, it was ported… @ScruffR ported the adafruit library back in Nov '14, on this thread:

Thread

And they included pictures of it working. I took great pains to study those pictures to be sure about the connections I’m using, and as far as I know they match the hardware SPI connections on the Core.

I’ve dug around in the library a bit, but I’m still kind of a newb at all of this even after three years. One thing I did was fork the ILI9341 library (Which works perfectly for me on my other display) and change its size definitions to match the HX8357. That works… very, very, very badly. Lots of noise, and very unpredictable. Not only that, using the mod I made seemed to make the Core less stable, so I stopped using it and did a factory reset. Instead I re-focused my efforts on getting this library to work - I mean, teeming dozens of core users implement this library, why can’t I?

Anyway, I don’t think I’m at the point where I can port a library myself. Just fiddling with one was pretty intimidating. I have to use a bigger display though, so if it comes to it I’ll try… just really wanna avoid all that work if there’s any way.

OK, my mistake–I see the ported one in the web IDE build button now.

1 Like

I’ll retest the example with my own display and try to emulate your problem.
Give me some time - I’ll come back to you ASAP.

Maybe you could also post a photo of your setup :wink:

Meanwhile I’ve slightly changed my own wiring scheme to make it easier to follow. I’ll post you a pic of that too.

I got the problem :wink: It’s sort of my fault :blush:

void setup() {
  Serial.begin(115200);

  while (!Serial.available())
    Spark.process();
  ...

This while() waits for the user to send a GO signal via USB serial (like “PRESS ANY KEY” :grimacing:)
If you comment this out, it should work.

Sorry for that.

2 Likes

THANK YOU!!!

Worked like a charm. I knew it was going to be something tiny.

Really really really appreciate it, you just got me back on track!!!

2 Likes