Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Teensy 3.1: adafruit 1.8 18-bit color tft, SPI speed

  1. #1

    Teensy 3.1: adafruit 1.8 18-bit color tft, SPI speed

    Hi,

    on Arduino DUE ist was possible to set the SPI speed to clk/2, on Teensy 3.1 there is no way to controll the SPI speed like Arduino DUE. Why? Is there an simple way to overwrite the SPI clock settings like in this code snipped?

    From the Adafruit_ST7735.cpp
    Code:
    #ifdef __AVR__
        SPI.setClockDivider(SPI_CLOCK_DIV2); // 4 MHz (half speed)
        //Due defaults to 4mHz (clock divider setting of 21)
    #endif
    #if defined(__SAM3X8E__)
        SPI.setClockDivider(21); // 4 MHz
        //Due defaults to 4mHz (clock divider setting of 21), but we'll set it anyway 
    #endif
    best regards

    Barney

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,079
    This modified copy of Adafruit's library has native Teensy 3 SPI support for that LCD.

    https://github.com/PaulStoffregen/Adafruit_ST7735

    It defaults to 12 MHz. Most of those LCDs can actually run faster. This copy added a setBitrate() function, so you can easily change the speed. Just use mylcd.setBitrate(24000000);

    This copy also has native SPI manipulation for the CS and RS pins by the SPI port, if you connect those signals to CS pins supported by SPI. The recommended connection is CS on pin 10 and RS on pin 9. The native CS+RS support makes an incredible speedup on this LCD.

  3. #3
    Your modification is very fast. You activate the 8 byte buffer. I use the 24MHz clock setting.

    Thanks for your help

  4. #4
    Member mixania's Avatar
    Join Date
    Oct 2014
    Location
    New York, NY
    Posts
    20
    UPDATE: Nevermind, got it working! Thank you!

    Quote Originally Posted by PaulStoffregen View Post
    This modified
    This copy also has native SPI manipulation for the CS and RS pins by the SPI port, if you connect those signals to CS pins supported by SPI. The recommended connection is CS on pin 10 and RS on pin 9. The native CS+RS support makes an incredible speedup on this LCD.
    Right now I'm trying to connect my Teensy 3.0 and and this ST7735 128x160 TFT[http://ebay.com/itm/300931228245?nav=SEARCH] display from ebay. While I have connected this display numerous times to my Arduino UNO since I'm more familar with its SPI "nicknaming", right now I'm puzzled with the way I should connect the LCD to my Teensy 3.0. The pins on the TFT display are the following: SCL, SDA, RS/DC, RES, CS and of course, VCC and GND which i already know where to connect

    Thanks in advance!
    Last edited by mixania; 06-05-2015 at 02:15 PM.

Posting Permissions

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