Forum Rule: Always post complete source code & details to reproduce any issue!
Page 9 of 9 FirstFirst ... 7 8 9
Results 201 to 219 of 219

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

  1. #201
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,404
    @...

    Started doing the above update for the counted version (changed in fillRect, HLine, VLine, and drawFastH/VLine...

    Now running it on TLC:
    Code:
    Benchmark                Time (microseconds)
    Screen fill              2182109
    Text                     163683
    Lines                    1921780
    Horiz/Vert Lines         179702
    Rectangles (outline)     109453
    Rectangles (filled)      5472139
    Circles (filled)         1656675
    Circles (outline)        1144773
    Triangles (outline)      527821
    Triangles (filled)       1987452
    Rounded rects (outline)  381047
    Rounded rects (filled)   6124822
    Done!
    Showing some improvements from above...
    Pushed up WIP to TLC_And_Others_Speedups...

    Actually if you compare the timings versus the current master branch:
    Code:
    Benchmark                Time (microseconds)
    Screen fill              8222049
    Text                     141225
    Lines                    1512162
    Horiz/Vert Lines         693357
    Rectangles (outline)     381698
    Rectangles (filled)      22552883
    Circles (filled)         2440288
    Circles (outline)        1344817
    Triangles (outline)      334055
    Triangles (filled)       6792542
    Rounded rects (outline)  638986
    Rounded rects (filled)   22217715
    It is a little more dramatic.

  2. #202
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,997
    @KurtE ….

    Yeah - big difference!

  3. #203
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,404
    Teensy 3.2 timings:

    Current Master:
    Code:
    Benchmark                Time (microseconds)
    Screen fill              1125906
    Text                     22806
    Lines                    194702
    Horiz/Vert Lines         98556
    Rectangles (outline)     52773
    Rectangles (filled)      2722081
    Circles (filled)         320964
    Circles (outline)        191968
    Triangles (outline)      45565
    Triangles (filled)       880293
    Rounded rects (outline)  94748
    Rounded rects (filled)   3018257
    WIP - Have not inlined functions yet but using the counted write16...
    Code:
    Benchmark                Time (microseconds)
    Screen fill              916442
    Text                     22186
    Lines                    185441
    Horiz/Vert Lines         74216
    Rectangles (outline)     40873
    Rectangles (filled)      2217830
    Circles (filled)         274170
    Circles (outline)        190159
    Triangles (outline)      42772
    Triangles (filled)       673674
    Rounded rects (outline)  84186
    Rounded rects (filled)   2406312
    Done!

  4. #204
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,997
    @KurtE - @defragster

    Guess these would be baseline timings for T3.x and T$
    Code:
    T$
    Benchmark                Time (microseconds)
    Screen fill              734499
    Text                     16411
    Lines                    211365
    Horiz/Vert Lines         62177
    Rectangles (outline)     34664
    Rectangles (filled)      1775576
    Circles (filled)         232640
    Circles (outline)        178364
    Triangles (outline)      45409
    Triangles (filled)       564945
    Rounded rects (outline)  74147
    Rounded rects (filled)   1951860
    Done!
    Code:
    T3.2
    Benchmark                Time (microseconds)
    Screen fill              1125924
    Text                     22799
    Lines                    194697
    Horiz/Vert Lines         98556
    Rectangles (outline)     52774
    Rectangles (filled)      2722062
    Circles (filled)         320962
    Circles (outline)        191968
    Triangles (outline)      45569
    Triangles (filled)       880304
    Rounded rects (outline)  94743
    Rounded rects (filled)   3018250
    Done!
    Code:
    T3.5
    Benchmark                Time (microseconds)
    Screen fill              1027245
    Text                     18863
    Lines                    159271
    Horiz/Vert Lines         80375
    Rectangles (outline)     45535
    Rectangles (filled)      2482100
    Circles (filled)         269807
    Circles (outline)        157316
    Triangles (outline)      36520
    Triangles (filled)       695693
    Rounded rects (outline)  77324
    Rounded rects (filled)   2683266
    Done!
    Code:
    T3.6 (Teensy64)
    Benchmark                Time (microseconds)
    Screen fill              730910
    Text                     13957
    Lines                    136735
    Horiz/Vert Lines         59114
    Rectangles (outline)     32613
    Rectangles (filled)      1766754
    Circles (filled)         202309
    Circles (outline)        126649
    Triangles (outline)      30773
    Triangles (filled)       530764
    Rounded rects (outline)  59396
    Rounded rects (filled)   1912628
    Done!

  5. #205
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,404
    Thanks Mike,

    I just pushed up to the TLC_And_... branch changes for KinetisK - moved stuff to be inlined plus the change for reducing color conversions...
    In case anyone wants to try them on T3.x boards...

    Current timing on T3.2 is:

    Code:
    Benchmark                Time (microseconds)
    Screen fill              915902
    Text                     20976
    Lines                    182761
    Horiz/Vert Lines         74050
    Rectangles (outline)     40831
    Rectangles (filled)      2216187
    Circles (filled)         263130
    Circles (outline)        174230
    Triangles (outline)      41050
    Triangles (filled)       668732
    Rounded rects (outline)  79863
    Rounded rects (filled)   2401543
    Not as dramatic as TLC, but still not too bad.

    Next up try the T4, again Move functions to header...

  6. #206
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,404
    T4 changes done - Did not notice any differences in speed...
    Moving more of the TLC stuff back over to header last speed test:
    Code:
    Benchmark                Time (microseconds)
    Screen fill              2145532
    Text                     257228
    Lines                    3512514
    Horiz/Vert Lines         186286
    Rectangles (outline)     120870
    Rectangles (filled)      5389336
    Circles (filled)         2317337
    Circles (outline)        2550341
    Triangles (outline)      834965
    Triangles (filled)       2283635
    Rounded rects (outline)  763143
    Rounded rects (filled)   6250006
    I ran on T3.5 and some reasonable speed ups I think
    Code:
    Benchmark                Time (microseconds)
    Screen fill              732370
    Text                     16914
    Lines                    149756
    Horiz/Vert Lines         59244
    Rectangles (outline)     32673
    Rectangles (filled)      1771869
    Circles (filled)         210503
    Circles (outline)        141709
    Triangles (outline)      33717
    Triangles (filled)       535282
    Rounded rects (outline)  64518
    Rounded rects (filled)   1920309
    Next up check in the last part, maybe combine changes and Do PR

    Created PR: https://github.com/mjs513/ILI9488_t3/pull

  7. #207
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,997
    T4 changes done - Did not notice any differences in speed...
    I am seeing a bunch of speed improvements - maybe not as much as the TLC but still a bit of a change.

    Whenever you want to do the PR that's fine. Now I have to change the comments that the lib supports the TLC as well. . Didn't mention anything that you could use the ILI9341 as well and the lib should work.

  8. #208
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,049
    not sure if this was wrong or got missed - as it seems to allow 2 byte color transfer ?

    Would be so nice if the 9488 would get into 2 byte color mode to reduce the SPI xfer!
    I find this in the recently linked ili9488-unlocked.pdf:
    4.9. DSI Transmission Data Format
    4.9.1. 16-bit per Pixel, Long Packet, Data Type 00 1110 (0Eh)
    Packed Pixel Stream 16-Bit Format is a Long packet, used to transmit image data formatted as 16-bit pixels to a
    Video Mode display module. The packet consists of a DI byte, a two-byte WC, an ECC byte, a payload of length
    WC bytes and a two-byte checksum. Pixel format is red (5 bits), green (6 bits), and blue (5 bits), in that order.
    ...

  9. #209
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,997
    @KurtE - @defragster

    PR Processed with the changess

  10. #210
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,404
    Thanks - Later may try some more updates - to counted outputs.
    Some areas that I am looking at include text output...

    May also try a few hacks, like Suppose I change write16BitColor:
    Only showing the LC...

    Code:
    uint16_t last_color = 0;
    uint8_t r = 0;
    uint8_t g = 0;
    uint8_t b = 0;
    
    void ILI9488_t3::write16BitColor(uint16_t color, bool last_pixel){
    
      setDataMode();
    
      if (color == last_color) {
          outputToSPI(r);
          outputToSPIAlready8Bits(g);
          outputToSPIAlready8Bits(b);
      } else {
          r = (color & 0xF800) >> 11;
          r = (r * 255) / 31;
          outputToSPI(r);
          g = (color & 0x07E0) >> 5;
          g = (g * 255) / 63;
          outputToSPIAlready8Bits(g);
          b = color & 0x001F;
          b = (b * 255) / 31;
          outputToSPIAlready8Bits(b);
          last_color = color;
      }      
      if (last_pixel) {
          waitTransmitComplete();
      } 
    
    }
    I would obviously change the name of the variable... They could be static or member (probably member)... Again not sure if this will speed it up much..
    But might also speed up the frame buffer output functions as well... Especially given there are often lots of the same color...

  11. #211
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,049
    That could add up. So can 153K conditionals?

    Code:
    void ILI9488_t3::write16BitColorLastPixel(uint16_t color){ // new method
         write16BitColor(uint16_t color);
         waitTransmitComplete();
    }
    
    void ILI9488_t3::write16BitColor(uint16_t color){ // , bool last_pixel){
      // ...
    // no last pixel test
    //  if (last_pixel) {
    //      waitTransmitComplete();
    }
    May not be that simple with all the variants? But quick look seems it does the normal - then : waitTransmitComplete();

  12. #212
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,404
    On my last ideas - I think I will punt for now... Example with Fonts, the number of pixels to output at at time in one color is pretty small, so did not help
    Also checking for pixels same color did not help...

    Probably wait for new shiny thing to do more here.

  13. #213
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,997
    @KurtE

    Good idea. The new thing will probably have some differences we have to address anyway.

  14. #214
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,997
    @KurtE

    Was going back through the SPI changes you made to test for the spi port. Can you explain to me what the heck these lines are doing:
    Code:
     	uint32_t *pa = (uint32_t*)((void*)spi_port);
    	_spi_hardware = (SPIClass::SPI_Hardware_t*)(void*)pa[1];
        #ifdef KINETISK
    	_pkinetisk_spi = (KINETISK_SPI_t *)(void*)pa[0];
    Guess I am at a loss of what pa[0] and pa[1] is suppose to be.

  15. #215
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,404
    It is a really bad hack!

    I wanted access to the internals of the SPI class. And for example the KINETISK version starts off the data associated with it, defined like:
    Code:
    private:
    	KINETISK_SPI_t & port() { return *(KINETISK_SPI_t *)port_addr; }
    	const SPI_Hardware_t & hardware() { return *(const SPI_Hardware_t *)hardware_addr; }
    	void updateCTAR(uint32_t ctar);
    	uintptr_t port_addr;
    	uintptr_t hardware_addr;
    	uint8_t miso_pin_index = 0;
    	uint8_t mosi_pin_index = 0;
    	uint8_t sck_pin_index = 0;
    	uint8_t interruptMasksUsed = 0;
    	uint32_t interruptMask[(NVIC_NUM_INTERRUPTS+31)/32] = {};
    	uint32_t interruptSave[(NVIC_NUM_INTERRUPTS+31)/32] = {};
    	#ifdef SPI_TRANSACTION_MISMATCH_LED
    	uint8_t inTransactionFlag = 0;
    	#endif
    So the first uint32_t is the port_addr variable, the second one was the hardware_addr.

    I was concerned at first the first pointer might be vtable, but there are no virtual functions...
    So the first line: uint32_t *pa = (uint32_t*)((void*)spi_port);
    Just casts our pointer of which SPI object we are using to be a pointer to uint32_t...

    So if you look at where SPI0 as defined: SPIClass SPI((uintptr_t)&KINETISK_SPI0, (uintptr_t)&SPIClass::spi0_hardware);
    And assuming we are using SPI object

    Then the next line was out of order: spi_hardware = (SPIClass::SPI_Hardware_t*)(void*)pa[1];
    But had same class type common to all three versions of the class, so in our case it returns the pointer: &SPIClass::spi0_hardware

    Then the next line: _pkinetisk_spi = (KINETISK_SPI_t *)(void*)pa[0];
    It returns the first 32 bits value of the data associated with SPI object and casts to the KINETISK_SPI_t * which again was passed in to the constructor: &KINETISK_SPI0

    Again a real HACK!

  16. #216
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,997
    @KurtE

    Figured you wanted access to SPIclass but never in a million years would I have figured out that was what was going on. Going to have to absorb this now

  17. #217
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,404
    Wondering if I should pick up a second one of these displays...

    Again wondering which version people are using?

    Ebay?

    BuyDisplay.com? Like this link: https://www.buydisplay.com/default/a...e-for-mega-due
    Was mentioned in a different thread...

  18. #218
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,997
    Does that board really support 4wire SPI?

  19. #219
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,404
    Not Sure, I have a different version of the board that only has the 20 pin connector... Actually wondering if it (the board I have) is actually compatible with the Arduino Mega boards...

    But I think some might find interesting a part of their description for the board:

    The pin32 (SDO) of 3.5 display module is also used by touch panel or SD card SPI interface, so we must cut off this pin to avoid conflict with the touch panel or SD card.

Posting Permissions

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