Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 33 of 33

Thread: 2.8" TFT touchscreen + Teensy 3.0

  1. #26
    Senior Member
    Join Date
    Feb 2013
    Posts
    179
    Yes, sort of. I'm using an older version, that's been modified to work with Teensy 3, Teensy 2++, and I macheted in support for the ILI9341 driver before Adafruit did on their version.

  2. #27
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,390
    Quote Originally Posted by PaulStoffregen View Post
    Are you using this library?

    https://github.com/adafruit/TFTLCD-Library
    They are not using the current library, as you guessed. I tried patching pin_magic.h with the teensy 3 mods, but more is required for the current TFTLCD library. The library now supports DUE, and the constructor does a lot of work mapping the control pins into port register access for set/clear operations. Maybe the teensy equivalent would be to use
    portSetRegister(pin) and portClearRegister(pin), or just digitalWrite() ?

    Has someone already done this?
    Last edited by manitou; 07-02-2014 at 10:41 PM.

  3. #28
    Senior Member
    Join Date
    Feb 2013
    Posts
    179
    For the hacked together version I've been using and testing on a 3.1, the __AVR__ style of pin/port mapping from the new library seems to be what I've been using. csPort = portOutputRegister(digitalPinToPort(cs)); etc

  4. #29
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,390
    OK, I got teensy 3.0 and 3.1 working with current Adafruit libraries. For teensy 3.1, I had to add delayMicroseconds(1) to read8inline so it looks like
    #define read8inline(d) { RD_ACTIVE; delayMicroseconds(1); d = GPIOD_PDIR; RD_IDLE;}
    Here are graphicstest times
    Code:
       
     teensy 3.0  96mhz
          TFT LCD test
          Using Adafruit 2.8" TFT Breakout Board Pinout
          Found ILI9328 LCD driver
          Benchmark                Time (microseconds)
          Screen fill              295919
          Text                     35533
          Lines                    719936   total time
          Horiz/Vert Lines         30875
          Rectangles (outline)     21577
          Rectangles (filled)      734834
          Circles (filled)         222147
          Circles (outline)        76280
          Triangles (outline)      57157
          Triangles (filled)       299737
          Rounded rects (outline)  40465
          Rounded rects (filled)   833481
          Done!   
    
     teensy 3.1 @ 96mhz
          Benchmark                Time (microseconds)
          Screen fill              210555
          Text                     25952
          Lines                    598607
          Horiz/Vert Lines         20019
          Rectangles (outline)     14406
          Rectangles (filled)      459568
          Circles (filled)         167211
          Circles (outline)        64348
          Triangles (outline)      47564
          Triangles (filled)       203945
          Rounded rects (outline)  31232
          Rounded rects (filled)   531085
    I tried 168mhz on teensy 3.1, but output had some gibberish and it eventually hung in Circles test ?? Lines at 168mhz was 363296us.

    And I measured 32.7ma at 3.3v for the TFTLCD, so I powered it from the teensy 3 3.3v pin. This is on older Adafruit TFTLCD, http://www.adafruit.com/products/335

    The Lines results (testLines in .cpp) is the total line drawing time. The graphicstest sketch had a bug (in my opinion) that only reported the time for the last test sequence, instead of the sum of all four line drawing sequences, so I corrected the return value to reflect the total time.

    For comparison, here are Lines results (us == microseconds) for
    Code:
    DUE @84mhz   1728104 us
    maple @72mhz 8069394 us  (my hack of 2012 lib)
    UNO @16mhz   4316544 us
    Paul has performance results for SPI-based TFTLCD here
    http://forum.pjrc.com/threads/26072-...ll=1#post50377
    (Lines results probably needs to be multiplied by 4, 4*245785 = 983140us )
    Last edited by manitou; 07-07-2014 at 07:11 PM.

  5. #30
    Junior Member
    Join Date
    Apr 2014
    Posts
    5
    Can someone please tell me where people are sharing their modifications for the TFTLCD library? On GitHub, or just with ad-hoc patches to this forum?

  6. #31

  7. #32
    Junior Member
    Join Date
    Apr 2014
    Posts
    5
    OK, maybe I'm confused, but does that library drive the Adafruit display in 8-bit mode (as described at https://learn.adafruit.com/adafruit-...8-bit-wiring)? The TFTLCD library has the disadvantage of needing more pins, but my impression was that it could achieve a higher throughput of data to the display, or am I mistaken in that as well?

  8. #33

    Unhappy

    Well, this is awkward. I had a 2.8" ILI9325 screen from Adafruit working on a Teensy 3.0 a couple of years back. I just tried to rebuild the code for that and I seem to have lost some files. Specifically I'm looking for the right Adafruit_TFTLCD library (well, I think that's all I'm looking for). The current library from Github doesn't compile with a Teensy3, and I recall I had to edit the pin_magic file as per ZTiK.nl (earlier in this thread). But the later files from Github look different now. I don't seem to be able to go back to an earlier branch on Github.
    I can see Paul has posted an ILI9341_t3 library, but mine is an ILI9325. Has anyone got a working copy of the library that works with my combination posted somewhere? I'd rather not upgrade the hardware at this stage, the problem I have is software.
    Thanks
    Roger

Posting Permissions

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