Differences between Giga boards/Shields?

Sorry maybe sort of a random question, but I have two GIGA boards and both of them I currently have a GIGA shield on them.

Currently I am mostly using them to experiment with Zephyr and I have noticed differences on how these two boards behave. I bought both boards Several months (year?) apart.

For example on Zephyr: One of the boards, when I upload anything to them, like flashing new logical firmware or download a sketch, I always have to go to the kernel monitor, and type in: sketch
to make it run. The other board, I typically do not have to do this. Only if there was a problem loading it, like missing symbol, do I have to maybe type in sketch to find out what the problem. This has been going on for several months.

The touch coordinates are different between these two setups.
On the first board I mentioned, if you are looking at the screen in landscape mode with the camera on top, if I touch near the corners I see coordinates like:
UL: 456, 26 LL:4, 23 UR: 434, 782, LR: 23, 774.

With the other setup:
UL: 17, 14 LL:23, 434 UR: 782, 19 LR 788, 464

It is like the sensor is rotated or the the like.
Note; This was done with the example sketch: Touch_polling running on the MBED version of Arduino GIGA... I have seen the same results using my updated version of the Arduino_GigaDisplayTouch library running on Zephyr.

Wondering if these differences are due to changes to the boards? If so are there programmatic ways to detect which version we have?

Thanks

@ptillisch and all,

I am still having the same same issue between the two Different Display shields.

It has been awhile since I did much touch, and since I had both boards running at the
same time in the same sketch...

It feels like someone attached the touch sensor rotated 90 degrees.
Is there a way to detect this in hardware and or setting to compensate within driver?
Or do sketches need to tranlate the coordinates them self?

Like on this one, sort of rough positions 480 is probably 479...

The other top left is like 0.0...
Which one is Right?

Hi @KurtE

Not tried it (don't have the display), but querying these registers of the GT911 might reveal differences:

There's a raft of other registers that you could query that could assist

Thanks,

I downloaded the manual from:

https://www.bing.com/ck/a?!&&p=31fab780c8a2b3c58dd4d6eb183f13ced2d210613c8d01eac7f7b8085c72b76bJmltdHM9MTc4ODk5ODQwMA&ptn=3&ver=2&hsh=4&fclid=1f32e013-e10a-6992-301b-f552e0276895&psq=goodix+gt911+manual&u=a1aHR0cHM6Ly93d3cuY3J5c3RhbGZvbnR6LmNvbS9jb250cm9sbGVycy9HT09ESVgvR1Q5MTFQcm9ncmFtbWluZ0d1aWRlLzQ3OC8

I have hacked up a simple Zephyr sketch I have for doing touch paint on the
display...
zephyr_GIGA_shield_touchpaint-260910a.zip (3.0 KB)

Note: It uses my MemoryHexDump to do the printing...
KurtE/MemoryHexDump: Simple Arduino Memory Dump

This is from the Display that works currently with the touch paint.

Touch Paint!
Touch controller init - OK
Touch Orientation: 0
Can change by typing 0-3 in Serial monitor
GFX Rotation: 0
--------------------------------------------------------
GT911 Registers
00008047 - 41 20 03 E0 01 05 4D 00  01 08 28 05 50 32 03 10  : A ....M. ..(.P2..
00008057 - 00 00 00 00 00 00 00 00  00 00 00 86 26 07 17 15  : ........ ....&...
00008067 - 31 0D 00 00 01 9B 03 1D  00 00 00 00 00 03 64 32  : 1....... ......d2
00008077 - 00 00 00 0F 4B 94 C5 02  07 00 00 04 9C 11 00 72  : ....K... .......r
00008087 - 18 00 55 21 00 41 2E 00  32 40 00 32 00 00 00 00  : ..U!.A.. 2@.2....
00008097 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
000080A7 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
000080B7 - 12 10 0E 0C 0A 08 06 FF  FF FF FF FF FF FF 00 00  : ........ ........
000080C7 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 22 21  : ........ ......"!
000080D7 - 20 1F 1E 1D 00 02 04 06  08 0A FF FF FF FF FF FF  :  ....... ........
000080E7 - FF FF FF FF FF FF FF FF  00 00 00 00 00 00 00 00  : ........ ........
000080F7 - 00 00 00 00 00 00 00 00  92                       : ........ .
GT911 Registers
00008140 - 39 31 31 00 60 10 20 03  E0 01 00 00 00 00 00 00  : 911.`. . ........
00008150 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
00008160 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
00008170 - 00 00 00 00 00 00                                 : ......
--------------------------------------------------------

And this is from the other where the coordinates are different:

GFX Rotation: 0
--------------------------------------------------------
GT911 Registers
00008047 - 41 E0 01 20 03 05 05 00  01 08 28 05 50 32 03 05  : A.. .... ..(.P2..
00008057 - 00 00 00 00 00 00 00 00  00 00 00 86 26 07 17 15  : ........ ....&...
00008067 - 31 0D 00 00 01 9B 03 1D  00 00 00 00 00 03 64 32  : 1....... ......d2
00008077 - 00 00 00 0F 4B 94 C5 02  07 00 00 04 9C 11 00 72  : ....K... .......r
00008087 - 18 00 55 21 00 41 2E 00  32 40 00 32 00 00 00 00  : ..U!.A.. 2@.2....
00008097 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
000080A7 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
000080B7 - 12 10 0E 0C 0A 08 06 FF  FF FF FF FF FF FF 00 00  : ........ ........
000080C7 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 22 21  : ........ ......"!
000080D7 - 20 1F 1E 1D 00 02 04 06  08 0A FF FF FF FF FF FF  :  ....... ........
000080E7 - FF FF FF FF FF FF FF FF  00 00 00 00 00 00 00 00  : ........ ........
000080F7 - 00 00 00 00 00 00 00 00  E5                       : ........ .
GT911 Registers
00008140 - 39 31 31 00 60 10 E0 01  20 03 00 00 00 00 00 00  : 911.`...  .......
00008150 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
00008160 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
00008170 - 00 00 00 00 00 00                                 : ......
--------------------------------------------------------

There are obviously differences:
Like Just looking at the first several registers:
8047 Config version - both 41
8048-49 X Output MAX: 800 versus 480
804A-4B Y Output Max: 480 versus 800
804C - Both support up to 5 touch points
804D - Module Switch 1: 0x4D versus 0x05
Bit6:Sensor_Resersal(X2X), configured as 1 indicates X axis reversal.
...

Question is Why? And is this a one off issue, or ...
And Best way to resolve? For my own sketch I can probably add
code to read one or more of these registers as I did here, detect that things
are reversed...

But I wonder if Arduino is aware of these differences and potentially have a patch
program to update one or the other?

@ptillisch @pennam and all - Suggestions? Or should I create an issue maybe to the library:
arduino-libraries/Arduino_GigaDisplayTouch ?

I went ahead and created an issue:

Does not Work with all Arduino GIGA Displays, differences with GT911 configuration. · Issue #23 · arduino-libraries/Arduino_GigaDisplayTouch

As a current test/work around, I have a hacked up version of the Touchpaint
zephyr_GIGA_shield_touchpaint-260910a.zip (3.3 KB)

Where I use:

// lets see if we think the GT911 if off.
  uint8_t switch_1;
  ReadGT911Registers(GT911_REG_CONFIG_MODULE_SWITCH1, &switch_1, 1);
  g_touch_Alt_config = (switch_1 & 0x40) ? false : true;
  if (switch_1 & 0x40) Serial.println("GT911 Normal display(Sensor_Resersal(X2X))");
  else Serial.println("GT911 display sensor different");

Then I use a helper function to convert the raw inputs depending on Old versus New

void convertRawTouchyByRotation(int xRaw, int yRaw, int &touch_x, int &touch_y) {
  if (g_touch_Alt_config) {
    switch (g_touch_rotation) {
      case 0:
        touch_x = xRaw;
        touch_y = yRaw;
        break;
      case 1:
        touch_x = yRaw;  //display.width() - xRaw;
        touch_y = display.height() - xRaw;  // display.height() - yRaw;
        break;
      case 2:
        touch_x = display.width() - xRaw;
        touch_y = display.height() - yRaw;
        break;
      case 3:
        touch_x = display.width() - yRaw;
        touch_y = xRaw;
        break;
    }

  } else {
    switch (g_touch_rotation) {
      case 0:
        touch_y = xRaw;
        touch_x = display.width() - yRaw;
        break;
      case 1:
        touch_x = xRaw;  //display.width() - xRaw;
        touch_y = yRaw;  // display.height() - yRaw;
        break;
      case 2:
        touch_x = yRaw;
        touch_y = display.height() - xRaw;
        break;
      case 3:
        touch_x = display.width() - xRaw;
        touch_y = display.height() - yRaw;
        break;
    }
  }
}

The sketch now allows me to type in a new rotation 0-3, at which time
it will set the screen rotation and draw the color pallet and then map the touch.

This appears to be working on both of my two displays.

@ptillisch @pennam @facchinm and all - It would be great to know if for example my newer display was a one off oops or if Arduino changed the configuration of the registers at some point.

Note: Our (@Merlin513 and mine) Displays we purchased early on, have what I say is
the main/ not alternate configuration.

What is interesting about this configuration, is when the screen is in landscape mode (orientation 1), the Touch is setup to the X and Y match the screen X, Y:

      case 1:
        touch_x = yRaw;  //display.width() - xRaw;
        touch_y = display.height() - xRaw;  // display.height() - yRaw;
        break;

Where as the one I purchased later on, has what I currently call the Alternate or different configuration. The interesting thing here is, if you are in default rotation (0), or portrait mode the positions returned from the GT911 match the screen coordinates.

      case 0:
        touch_x = xRaw;
        touch_y = yRaw;
        break;

It would be great if a few people with older and newer displays would try running this
sketch on ArduinoCore-zephyr and see which configuration it has. And
with latest version of sketch if you type 0-3 in Serial monitor it will change the screen to that
orientation, and if you can touch the screen and the touchpaint appears to be tracking
correctly that would be great to know.

Thanks

The detected touch coordinates work correctly with the sketch, with all four orientations.

I'm pretty sure I bought my GIGA Display Shield soon after it was released. It says "V0.5" on the copper layer on the connector side of the PCB.

Thanks,

Curious did it print
GT911 Normal display(Sensor_Resersal(X2X)
Or
GT911 display sensor different

Here is the output from the sketch:

Touch Paint!
Touch controller init - OK
Touch Orientation: 0
Can change by typing 0-3 in Serial monitor
GFX Rotation: 0
--------------------------------------------------------
GT911 Registers
00008047 - 41 E0 01 20 03 05 05 00  01 08 28 05 50 32 03 05  : A.. .... ..(.P2..
00008057 - 00 00 00 00 00 00 00 00  00 00 00 86 26 07 17 15  : ........ ....&...
00008067 - 31 0D 00 00 01 9B 03 1D  00 00 00 00 00 03 64 32  : 1....... ......d2
00008077 - 00 00 00 0F 4B 94 C5 02  07 00 00 04 9C 11 00 72  : ....K... .......r
00008087 - 18 00 55 21 00 41 2E 00  32 40 00 32 00 00 00 00  : ..U!.A.. 2@.2....
00008097 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
000080A7 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
000080B7 - 12 10 0E 0C 0A 08 06 FF  FF FF FF FF FF FF 00 00  : ........ ........
000080C7 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 22 21  : ........ ......"!
000080D7 - 20 1F 1E 1D 00 02 04 06  08 0A FF FF FF FF FF FF  :  ....... ........
000080E7 - FF FF FF FF FF FF FF FF  00 00 00 00 00 00 00 00  : ........ ........
000080F7 - 00 00 00 00 00 00 00 00  E5                       : ........ .
GT911 Registers
00008140 - 39 31 31 00 60 10 E0 01  20 03 00 00 00 00 00 00  : 911.`...  .......
00008150 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
00008160 - 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  : ........ ........
00008170 - 00 00 00 00 00 00                                 : ......
--------------------------------------------------------
GT911 display senseor different

Thanks,

That matches my I believe newer one.
Both of mine show the 0.5...

I know that @Merlin513 one matches my older one as well.

Sorry I know we are spending a lot of time on some of this, but finding that playing with things like this help find and maybe hopefully resolve issues.
giga_weather_display_v5-260911a.zip (121.9 KB)

Here is my current version of the Weather sketch...
Main screen:

If you touch one of the days it will drill into that day
Click back to go back to main screen.

Click on symbol toward upper right for Keyboard:
Brings up:

Where you can click on buttons to type in new loactions.

Things so far with this sketch:
a) WiFi - One of my boards is much better at connecting...
b) I am using /storage/ file to save security data as well as Location information. - Issues with partitions, some bad block? Maybe difference between old or new board?
c) Touch Orientation.
d) Maybe Touch timing differences?
...

But at least we are having some fun!

Thanks again

Thought I would mention found another good document/website to look at:

Programming a Capacitive Touch Panel utilizing the GT911 Touch Controller - Focus LCDs

I thought would mention, that have found issues with differences between the two register configurations of the different Displays.

Orientation as I mentioned above..

Timing: does work differently in mentioned sketch. Needed to adjust a delay depending on configuration: I noticed in the Above dumps: The register:
8056: was different: Our original one 0x10, the Other config 0x5
From the GT911 programming guide it shows:
image

Which is different than register number from the Focus LCDs documents?

But as for talking about the Weather app will continue on the thread:
Playing with Zephyr V1.0.0 on GIGA and Wifi - Mega / GIGA R1 WiFi - Arduino Forum