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

Status
Not open for further replies.

Barney

Active member
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
 
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.
 
Your modification is very fast. You activate the 8 byte buffer. I use the 24MHz clock setting.

Thanks for your help
 
UPDATE: Nevermind, got it working! Thank you!

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:
Status
Not open for further replies.
Back
Top