Forum Rule: Always post complete source code & details to reproduce any issue!
Page 18 of 22 FirstFirst ... 8 16 17 18 19 20 ... LastLast
Results 426 to 450 of 531

Thread: ILI9488_t3 - Support for the ILI9488 on T3.x and beyond...

  1. #426
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    @KurtE
    Well as usual your sketch is a lot better than mine

    Anyway on startup the raspberries show correctly with a black background. Which is the top of the screen - the color seems match for the box that is farthest from screens ribbon cable.

    EDIT:
    Tried the startup change in your original startup sketch and it worked as well . Also tried it on the original display but the raspberries came out looking like blueberries - pretty sure display is damaged - that's the one I took apart. The new one is fine though.

    Started to make the change in the lib but have to stop - eyes are closing and beginning to make too many mistakes which is always bad around electronics - tend to put power to wrong connectors
    Last edited by mjs513; 07-19-2019 at 02:52 AM.

  2. #427
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    @KurtE - @defragster

    I think I mentioned that the new display wouldn't work at all with the existing lib - screen stayed white. I changed the startup sequence to match what we have in the startup3 sketch, sans raspberries. So it works now but text is messed up - haven't fixed that. Now I am tired - use rgb or bgr for color scheme in the .h file. Here is my modifications if you all want to test

    KeDeiRPI35_t3.zip

    EDIT: Looks like MADCTL needs to be:
    Code:
    Try madctl: eb
    Hit any key to continue
    then it matches the pict u posted

  3. #428
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,018
    Assuming the two day old github is the base of this? Kurt posted a startup sketch and mjs513 posted replacement source files?

  4. #429
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,018
    It builds and runs - I think my IDE needs a restart - it stalled horribly building??

    Dropped in the MJS513 after the github version not seeing a big change - didn't re-read prior to see what I should tweek?

    Raspberries are sorta like that - greenish top and purpleish bottom. Didn't power up a Pi or set it up to see how it should look. rPi's didn't see any PRIME DAY love so I skipped for now. Still don't know where my old rPi is - I have two piZero's right here …

    Anyhow - one thing I see is a couple of the colors BLEED flicker running the vertical bars - in both versions … about a quarter inch of streaky bleed - about a half dozen of the bar sets - others are crisp and clean. Not ALL combo's but some half on the my left edge of middle bar bleeding left across to the leftmost bar.

    I saw this in the touch paint and other before but this is full narrow width at rectangle border? Just mine?

    MODE0 in loop() works - MODE3 gives a white screen.

    Initial Build and ReBuild stalls up to a minute here - same after IDE restart ????:
    Code:
    "T:\\Ard186t4b2\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "T:\\TEMP\\arduino_build_647594\\preproc\\ctags_target_for_gcc_minus_e.cpp"
    Compiling sketch...
    "T:\\Ard186t4b2\\hardware\\teensy/../tools/precompile_helper" "T:\\Ard186t4b2\\hardware\\teensy\\avr/cores/teensy4" "T:\\TEMP\\arduino_build_647594" "T:\\Ard186t4b2\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IT:\\Ard186t4b2\\hardware\\teensy\\avr/cores/teensy4" "T:\\TEMP\\arduino_build_647594/pch/Arduino.h" -o "T:\\TEMP\\arduino_build_647594/pch/Arduino.h.gch"
    "T:\\Ard186t4b2\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IT:\\TEMP\\arduino_build_647594/pch" "-IT:\\Ard186t4b2\\hardware\\teensy\\avr\\cores\\teensy4" "-IT:\\tCode\\libraries\\SPI" "T:\\TEMP\\arduino_build_647594\\sketch\\KeDei_startup.ino.cpp" -o "T:\\TEMP\\arduino_build_647594\\sketch\\KeDei_startup.ino.cpp.o"
    KeDei_startup: In function 'void setup()':
    T:\tCode\libraries\KeDeiRPI35_t3\examples\KeDei_startup\KeDei_startup.ino:142:6: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
    
     void setup() {
    
          ^
    I did a build of th e othe ropen sketch TelephoneBill's QTimer and it builds fast and fine.
    Last edited by defragster; 07-19-2019 at 07:28 AM.

  5. #430
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    @defragster

    Interesting results and curious.

    As for the @KurtE's latest startup sketch you should see 3 berries - yep - sort of green and top reddish/purplish on the bottom. I have two displays - both act a bit differently but the new startup seems to work on both now.

    I didn't see any streaking that you are describing on the two screens though. Strange one but this display is strange.

    What I am seeing now is one display everything seems to work fine for graphicstest then on the other display its a mirror of the other - argh. I am using mode3 and mode1

  6. #431
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,034
    @mjs513 and @defragster - Good morning,

    I get that variable tracking size message every build as well, when building that app. I thought about ways to maybe resolve it. And if this was anything but a simple test to see what displays on a couple of devices, I would change this completely...

    That is for example the lcd_dat commands between about the range 290 and 8630 and likewise 8641-16647 are just screen data, i.e. a 2 byte version of screen data. so I would replace these groups of outputs, into a couple of: const uint16_t screen1[] = {
    Which both would be very long lists, but hopefully simply compile like some of the font files.
    And then the code would maybe just have the code like writeRect(0,0, width, height, screen1);
    ...

    @mjs513 - I will take a look at your startup... Or you could create a PR with it....
    And as a glutton for punishment - I ordered another one on Ebay, to see what it does? i.e. same as my current one or???

    As for Github - one thing I have never tried, and assume there is a way to do, if you receive a PR, You may want to have it logically merged, and then run tests on it, to verify that things are working correctly and then say yep it worked, and then accept the PR and have it reflected in the master branch for anyone who then does a sync...

    Not sure yet what I will try today. Maybe some other stuff on new breakout board...

  7. #432
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    @mjs513 - I will take a look at your startup... Or you could create a PR with it....
    And as a glutton for punishment - I ordered another one on Ebay, to see what it does? i.e. same as my current one or???
    @KurtE - @defragster

    If you can give it a try and see what happens with your current display. Right now I have both displays that the color is good and matches about what I would expect but the new one seems to be a mirror of the image of the old display what seems to work correctly with the startup. In other words the new display is inverted and prints backwards of what it should be.

    Not sure yet what I will try today. Maybe some other stuff on new breakout board...
    Have fun with your new toy Those are always fun got my 1" dia pcb speakers and tested it this morning with that transistor circuit and it pretty loud when using tone/rttl libraries. Still soft when using talkie = wonder if I could get it louder......

  8. #433
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,034
    @mjs513 - Will try it out soon.

    The mirror... issue sounds like the MADCTL is not right for that board.

    Wonder with my later version of test app, the outputs of the initial SPI transfers...

    In my case with the board, I see:
    Code:
    Start up
    After SPI Begin
    MOSI: 00e70000  MISO: 0000 1f80
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 07c0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00800000  MISO: 0000 0000
    After a few SPI outputs
    Before first page output
    End Setup
    Other screens will show color RGB top, BGR middle NRGB bottom
    Now Display color: BLACK - 0000 0000 ffff(ffff)
    Now Display color: NAVY - 0010 8000 ffef(ffef)
    Now Display color: DARKGREEN - 0400 0400 fbff(fbff)
    Now Display color: DARKCYAN - 0410 8400 fbef(fbef)
    Now Display color: MAROON - 8000 0010 7fff(7fff)
    Now Display color: PURPLE - 8010 8010 7fef(7fef)
    Now Display color: OLIVE - 8400 0410 7bff(7bff)
    Now Display color: LIGHTGREY - c618 c618 39e7(39e7)
    Now Display color: DARKGREY - 8410 8410 7bef(7bef)
    Now Display color: BLUE - 001f f800 ffe0(ffe0)
    Now Display color: GREEN - 07e0 07e0 f81f(f81f)
    I wonder if there is something in the outputs (miso) that maybe says something about the display...
    Like maybe something busy or version or ....

    In previous boards of mine that had the transistor circuit, I was using a small buzzer from CUI: CEM-1206S 12mm size...
    It was not great, but did fine for things I needed, like simple tones

    Back to playing

  9. #434
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    @KurtE

    You may have something. I just did a comparison between my 2 displays and what you posted. The new display that is causing problems has slightly different miso results:
    Code:
    New Display		Old Display	Kurts display
    MOSI: 00e70000  MISO: 0000 0000		MOSI: 00e70000  MISO: 0000 1f80		       MOSI: 00e70000  MISO: 0000 1f80
    MOSI: 00e70000  MISO: 0000 3fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 3fc0		MOSI: 00e70000  MISO: 0000 0000			MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 3fc0		MOSI: 00e70000  MISO: 0000 0000			MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 3fc0		MOSI: 00e70000  MISO: 0000 0000			MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000		MOSI: 00e70000  MISO: 0000 0000			MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000		MOSI: 00e70000  MISO: 0000 0000			MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 3fc0		MOSI: 00e70000  MISO: 0000 0000			MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000		MOSI: 00e70000  MISO: 0000 0000			MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000		MOSI: 00e70000  MISO: 0000 0000			MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000		MOSI: 00e70000  MISO: 0000 0000			MOSI: 00e70000  MISO: 0000 0000
    MOSI: 00e70000  MISO: 0000 0000		MOSI: 00e70000  MISO: 0000 3000			MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 07c0			MOSI: 00e70000  MISO: 0000 07c0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 3fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 3fc0			MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 1fc0			MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 1fc0			MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 1fc0			MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00e70000  MISO: 0000 0fc0		MOSI: 00e70000  MISO: 0000 1fc0			MOSI: 00e70000  MISO: 0000 1fc0
    MOSI: 00800000  MISO: 0000 0000		MOSI: 00800000  MISO: 0000 0000			MOSI: 00800000  MISO: 0000 0000
    Was playing around with the startup MADCTL values but couldn't get the right combo:
    Code:
      lcd_cmd(0x0036);  //Address mode
      // 0x48 = 0b01001000
      // 0 - top to bottom
      // 1 - right to left
      // 0 - normal mode of columns order
      // 0 - refresh top to bottom
      // 1 - RGB or BGR  (here BGR order)
      // 0 - <skip>
      // 0 - no hflip
      // 0 - no flip
      lcd_data(0x0060);  //was 60

  10. #435
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,034
    @mjs513 - will be interesting when I get my 2nd one... Supposed to be here by Wed (next week)...

    Looking at the XPD2046 spec: https://www.buydisplay.com/download/ic/XPT2046.pdf

    it looks like it will ignore any input where the high bit is not on (start...)
    So for each of these groups 00 ignored E7 - says something like:
    Start conversion - Channel 6 - Always powered on ... And I think 6 is whatever is connected to the AUX input to the chip... So wondering what they have may have connected?

    Which looking at my board I believe it is pin 8 of the 2046 chip (one nearest the 4 pin connector) with +5v and it looks like that pin may be routed to R2 and maybe R1. On my board R2 is populated and R1 is not...

  11. #436
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    @KurtE

    Old Board: R1 populated, R2 unpopulated
    New Board: R1 unpopulated, R2 populated

    The mystery deepens with this board.

  12. #437
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    @KurtE - @defragster

    Since I am stubborn here is what I got for the two sets of rotation values:
    Code:
    /* R1 = populated, R2 = unpopulated */
    const uint8_t KEDEIRPI35_t3::MADCTLRotionValues[4] = {0xEA, 0x4A, 0x2A, 0x8A};
    
    /* R1 = unpopulated, r2 = populated
    const uint8_t KEDEIRPI35_t3::MADCTLRotionValues[4] = {
    	0xAA,	//   0 = 0xEA
    	0x0A,	//  90 = 0x4A
    	0x6A,	// 180 = 0x2A
    	0xCA	// 270 = 0x8A
    };
    */
    and this is now what I am using for lcd_cmd(0x0036) in the .cpp
    Code:
      lcd_cmd(0x0036);  //Address mode
      // 0x48 = 0b01001000
      // 0 - top to bottom
      // 1 - right to left
      // 0 - normal mode of columns order
      // 0 - refresh top to bottom
      // 1 - RGB or BGR  (here BGR order)
      // 0 - <skip>
      // 0 - no hflip
      // 0 - no flip
      lcd_data(0x00AA);  //was 60
    How did I do this - trial and error using the rotation sketch - its come in handy.

    Heres the zip: KeDeiRPI35_t3.zip

    EDIT: Here is a pic of the R1/R2 resistors near the 4-pin connector:
    Click image for larger version. 

Name:	lHBYz.jpg 
Views:	1 
Size:	31.2 KB 
ID:	17040
    Last edited by mjs513; 07-20-2019 at 12:11 AM.

  13. #438
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,018
    I have a "432" on R1 on my display. I suppose I should test your 'theory' some time soon … after dinner.

  14. #439
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,034
    @...
    Sounds good, I downloaded and put into my library folder and ran touch paint and it appears to run fine. Looks like now it is using RGB colors instead of BGR, which is good.

    DOes your other one also use RGB colors as well?

  15. #440
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,034
    I am wondering if we can detect the differences between the boards and configure what MADCTL list to use.

    I am not sure if this code is perfect or not, but:
    Code:
    #include <SPI.h>
    
    #define LCD_CS 10
    #define TOUCH_CS 9
    #define SPI_SETTING     SPISettings(2000000, MSBFIRST, SPI_MODE0)
    
    uint16_t getTouchIOValue() {
      SPI.transfer(0xe7); // Start a conversion.
      uint16_t value = SPI.transfer(0) << 8;
      return value | SPI.transfer(0);
    }
    
    void setup() {
      while (!Serial && (millis() < 4000)) {;}
      Serial.begin(115200);
      pinMode(LCD_CS, OUTPUT);
      digitalWrite(LCD_CS, HIGH);
      pinMode(TOUCH_CS, OUTPUT);
      digitalWrite(TOUCH_CS, HIGH);
      SPI.begin();
      Serial.println("Test KeDEi...");
      // Try a few changing CS between..
      SPI.beginTransaction(SPI_SETTING);
      for (uint8_t i = 0; i < 10; i++) {
      digitalWrite(TOUCH_CS, LOW);
        Serial.printf("%04x ", getTouchIOValue());
        digitalWrite(TOUCH_CS, HIGH);
      }
      Serial.println();
      SPI.endTransaction();
      delay(5);
      SPI.beginTransaction(SPI_SETTING);
      digitalWrite(TOUCH_CS, LOW);
      for (uint8_t i = 0; i < 10; i++) {
        Serial.printf("%04x ", getTouchIOValue());
      }
      digitalWrite(TOUCH_CS, HIGH);
      SPI.endTransaction();
      Serial.println();
    }
    
    void loop() {
      SPI.beginTransaction(SPI_SETTING);
      digitalWrite(TOUCH_CS, LOW);
      Serial.printf("%04x\n", getTouchIOValue());
      digitalWrite(TOUCH_CS, HIGH);
      SPI.endTransaction();
      delay(2500);
    }
    But on mine I get the values:
    Code:
    Test KeDEi...
    7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 
    7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 7ff8 
    7ff8
    7ff8
    7ff8
    7ff8
    7ff8
    7ff8
    ...

  16. #441
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,034
    Note: The values are now consistent from that touch request... What I noticed is I looked at the XPT2046 library and it was doing SPI at 2mhz, I was trying up to 30mhz... I then looked again at the captured SPI data and they were doing 8mhz.

    So my test app above did 2mhz mode0 and the startup app at 8mhz mode3/
    Code:
    Start up
    After SPI Begin
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00e70000  MISO: 0000 7ff8
    MOSI: 00800000  MISO: 0000 7ff8

  17. #442
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    @KurtE - @defragster

    Might just work:
    Code:
    R1 populated = 0000
    R2 populated = 7ff8
    EDIT: Looks like we are beginning to break the code on this display - just thinking about all the time we are spending on a one off display but it has been a fun processes.

  18. #443
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,018
    Quote Originally Posted by defragster View Post
    I have a "432" on R1 on my display. I suppose I should test your 'theory' some time soon … after dinner.
    With mjs513 update lib files and KurtE sketch I get this:
    Code:
    T:\tCode\T4\KeDei_Auto\KeDei_Auto.ino Jul 19 2019 19:13:32
    Test KeDEi...
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
    0000
    0000
    ...

  19. #444
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,018
    Running Touch Paint has the color bar drawing opposite where it is tested for - and the short screen axis is swapped - long axis follows the pointer - short axis is flipped … like the color palette bar on the wrong side?

    But the colors look to be perfect and unique - no doubled bars and good BLACK fillscreen with nice sharp color definition - no longer muted and over driven like before!

  20. #445
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    Quote Originally Posted by defragster View Post
    Running Touch Paint has the color bar drawing opposite where it is tested for - and the short screen axis is swapped - long axis follows the pointer - short axis is flipped … like the color palette bar on the wrong side?

    But the colors look to be perfect and unique - no doubled bars and good BLACK fillscreen with nice sharp color definition - no longer muted and over driven like before!
    Try.adding tft.setRotation (0).. Working from phone now, in bed about to crash. We may to add that to the begin function. Will te SD this tomorrow.

  21. #446
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,018
    Quote Originally Posted by mjs513 View Post
    Try.adding tft.setRotation (0).. Working from phone now, in bed about to crash. We may to add that to the begin function. Will te SD this tomorrow.
    I looked for setRotation and not seeing it - made pork chops.

    I suspected that was not going to help and it would just re-orient on multiple axis and just flip the problem or something.

    Well - sr(0) is not the answer and sr(2) gets the direction correct UDLR good - but the map direction about the middle of long axis is MIRRORED - that is BLACK box draws RED and RED box draws BLACK

  22. #447
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,018
    As I first thought after not expecting rotate to help - WORKS::

    Code:
    // This is calibration data for the raw touch data to the screen coordinates
    //#define TS_MINX 175
    //#define TS_MAXX 3900
    #define TS_MINX 3900
    #define TS_MAXX 175
    Swap of X's MIN/MAX ????

    Is there some other change missing?

    That works for sr(2) - all wrong for (0)

    This looks like a rotation dependent map is needed ….

    OH >> For some reason I see two choices for the same looking MAGENTA centered right of BLUE on screen

  23. #448
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    Quote Originally Posted by defragster View Post
    Running Touch Paint has the color bar drawing opposite where it is tested for - and the short screen axis is swapped - long axis follows the pointer - short axis is flipped … like the color palette bar on the wrong side?

    But the colors look to be perfect and unique - no doubled bars and good BLACK fillscreen with nice sharp color definition - no longer muted and over driven like before!
    Ok. Now that I am awake think I figured out the problem. Make sure that the madctlRotationValues for R1 is uncommented and R2 ones is commented out. It should look like this:
    Code:
    /* R1 = populated, R2 = unpopulated */
    const uint8_t KEDEIRPI35_t3::MADCTLRotionValues[4] = {0xEA, 0x4A, 0x2A, 0x8A};
    
    /* R1 = unpopulated, r2 = populated
    const uint8_t KEDEIRPI35_t3::MADCTLRotionValues[4] = {
    	0xAA,	//   0 = 0xEA
    	0x0A,	//  90 = 0x4A
    	0x6A,	// 180 = 0x2A
    	0xCA	// 270 = 0x8A
    };
    */
    Yeah - looks like 2 magentas but one is suppose to be pink

  24. #449
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,018
    I'll look for those - as I didn't see them before.

    I did bring code into the sketch to do the 4 rotation map switch - it was working with the #define values swapped - I got it close to right with manipulating the map with arrays - then changed something and now colors report but nothing draws so I broke the map values it seems …

    Late here 1.5 hours past enough Zzz's time …

    <edit> - meant to note the TWO colors on the paint bar that show the same are showing USB text of PINK and MAGENTA and I can't tell them apart. All the others look to be right.

    <edit2> - also noticed when I pick up the KeDei to manipulate touch - my finger hits the tft voltage regulator on the back - it is right at too hot to touch comfortably for very long. The LED backlight is VERY/too bright.
    Last edited by defragster; 07-20-2019 at 10:38 AM.

  25. #450
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,664
    Quote Originally Posted by defragster View Post
    I'll look for those - as I didn't see them before.

    I did bring code into the sketch to do the 4 rotation map switch - it was working with the #define values swapped - I got it close to right with manipulating the map with arrays - then changed something and now colors report but nothing draws so I broke the map values it seems …

    Late here 1.5 hours past enough Zzz's time …

    <edit> - meant to note the TWO colors on the paint bar that show the same are showing USB text of PINK and MAGENTA and I can't tell them apart. All the others look to be right.

    <edit2> - also noticed when I pick up the KeDei to manipulate touch - my finger hits the tft voltage regulator on the back - it is right at too hot to touch comfortably for very long. The LED backlight is VERY/too bright.
    @defragster

    The rotation array in the .cpp does that mapping for you - so don't worry about it - just tried it on my display and once I remembered to change the mapping it worked fine. (see https://forum.pjrc.com/threads/55735...l=1#post210613)

    Never noticed about voltage regulate - did notice about how bright the screen is though

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •