Touchdisplay - UTFT / SPI Control brings strange sings at serial monitor

Hi community,

i cant get my Waveshare 4" Touch running. The first step is done, i get strange stuff at the serial monitor.

I can run the Display with the Sample gallerie, when i try to run the display with the UTFT Lib the Display doesnt show anything but the serial monitor is showing these strange signs:

+KK(JK%K*J⸮JJ⸮⸮[Zi[o-Zo⸮⸮⸮Z[Z⸮QZ[j[[⸮[ZZ[⸮⸮Z[[Ki⸮j{j⸮⸮Zk[⸮{m⸮⸮
⸮⸮[[⸮Ziz⸮KK⸮⸮+J⸮j⸮IK⸮⸮I ⸮z⸮*
KJJ+K⸮Z[⸮⸮⸮J++-JJ)'k⸮⸮⸮⸮*J+K⸮⸮KJ@⸮⸮[[⸮[j[Z[⸮k⸮⸮⸮kZZ⸮Z[k[[⸮JKK
⸮[Z⸮KJKJ⸮
j⸮[[[⸮⸮m⸮[Zi[:⸮
+Z[[⸮Z"K)
Ii+JK[Z[ZZ۰o⸮⸮,⸮⸮j[⸮
⸮[[⸮o⸮J+K⸮

I think the SPI communication is online but the "translation" to the board is going wrong.

I set up the new class:

UTFT myGLCD(CTE40, 11, 13, 10, 8);

CTE40 because its 16bit for ILI9486
I tried it with 4 or 5 wiring, both nothing.
SPI Config jumper at the shield board is fine.

I also uncommented the Uno Shield line. After that i got the serial monitor signs.

Is somebody knowing how to fit the communication with the display?

Display --> Link
Sample galerie is attached and i think the UTFT lib is known by everyone.
I use the Arduino MEga2560

Display_Sample_Lib.zip (15 KB)

Please post the full sketch that causes the strange Serial Monitor output.

If possible, you should always post code directly in the forum thread as text using code tags:

  • Do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code. This will make it easier for you to spot bugs and make it easier for us to read.
  • In the Arduino IDE or Arduino Web Editor, click on the window that contains your sketch code.
  • Press "Ctrl + A". This will select all the text.
  • Press "Ctrl + C". This will copy the selected text to the clipboard.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the sketch between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
  • Repeat the above process if your sketch has multiple tabs.

This will make it easy for anyone to look at it, which will increase the likelihood of you getting help.

If the sketch is longer than the 9000 characters maximum allowed by the forum, then it's OK to add it as an attachment. After clicking the "Reply" button, you will see an "Attachments and other settings" link.

When your code requires a library that's not included with the Arduino IDE please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

What do you think why i attached the stuff?

Seriously. The Waveshare display uses a Shift Register abortion. UTFT does not understand it. UTFT does not even understand a hardware SPI bus.

Your display is not supported by UTFT or Mr Karlsen.

It should be relatively simple to implement a suitable hardware driver.
You do not appear to know what you are doing.

David.

Thanks for your help. That is what i expected. Do you have any suggestions where i can get the informations for the Hardware register?

and thanks for the advice: "You do not appear to know what you are doing"

i thought thats the reason why forums have been invented that people who dont know what to do can learn from other people what to do...

My apologies. I would look at the schematic and program accordingly.

e.g. set RST, DC, CS as required. spi(hi). spi(lo)

You have to send two spi() bytes for every lcd_command or lcd_data() even if it is an 8-bit argument.
The net result is going to be much like the SPI_5_wire interface. Except that 8-bit commands and 8-bit arguments always use spi(hi), spi(lo)

I don't have this type of display. I do not intend to buy one.

I would imagine that someone, somewhere has bought this display and has implemented the hardware driver for UTFT.

No. You would not attempt to connect 0, 1 or use a Uno 8-bit parallel driver. (that is what created garbage)
You would use 5-wires + RESET.

David.

gnom:
What do you think why i attached the stuff?

You said:

I can run the Display with the Sample gallerie, when i try to run the display with the UTFT Lib the Display doesnt show anything but the serial monitor is showing these strange signs

I take this to mean that there is a sketch named "Sample gallerie" that works fine, and another sketch that uses the UTFT lib which causes the display to not show anything and bad output to Serial Monitor.

Then you said:

Sample galerie is attached

It sure sounds to me like the "stuff" you attached is the sketch that works, not the sketch that doesn't work.