Using adafruit 1.44" graphics library on teensy 3.2

Status
Not open for further replies.

MertTens

New member
Hello!

I've tried using the provided example (graphicstest inside the Adafruid_ST7735 folder) but apparently this only works for the 1.8" screen. I messed around with the .h and .cpp files for this library with no luck. Does anybody know how to make the 1.44" screen work with the teensy 3.2?

Here is the exact screen I have: Adafruit 1.44" Color TFT LCD Display with MicroSD Card breakout - ST7735R

I'm using the following library: https://www.pjrc.com/teensy/td_libs_ST7735.html

I'm wondering if I can alter the library to support the screen I am using

Thanks!
 
Last edited:
Not enough detail to know what screen and controller you really have?

The only 1.44" TFT I have is an ILI9163 and 128x128 pixels and Sumotoy makes a great driver for it.

Start with this thread perhaps others - perhaps check with the place that sold it for needed details if you don't have them.
 
Do you have the Adafruit 1.44" display?

Are you using the Adafruit version of the library or the version that downloads from Adafruit?

Are you following the Adafruit learn section? https://learn.adafruit.com/adafruit-1-44-color-tft-with-micro-sd-socket/wiring-and-test

If you are using the Adafruit version of the library the instructions tell you that in your sketch file you need to change from using the INITR_BLACKTAB to use the
INITR_144GREENTAB line instead.

Not sure with the version downloaded downloaded with Teensyduino, the constants and the like might be slightly different.
 
Thanks!
I made the adafruit version work with my uno and have followed the instructions. My problem comes when I try to make it work on the teensy 3.2. I have tried both the adafruit version and the version that comes with the teensy libraries, but none have worked. What do you mean by the constants might be slightly different?
 
It should not be very hard to add in the code to allow the INTR_144GREENTAB support, to Paul's version

The Init table needs to be added to where the other command lists are.

Code:
Rcmd2green144[] = {              // Init for 7735R, part 2 (green 1.44 tab)
    2,                        //  2 commands in list:
    ST7735_CASET  , 4      ,  //  1: Column addr set, 4 args, no delay:
      0x00, 0x00,             //     XSTART = 0
      0x00, 0x7F,             //     XEND = 127
    ST7735_RASET  , 4      ,  //  2: Row addr set, 4 args, no delay:
      0x00, 0x00,             //     XSTART = 0
      0x00, 0x7F },           //     XEND = 127
The InitR function needs to be updated to support it:
// Initialization for ST7735R screens (green or red tabs)
Code:
void Adafruit_ST7735::initR(uint8_t options) {
  commonInit(Rcmd1);
  if(options == INITR_GREENTAB) {
    commandList(Rcmd2green);
    colstart = 2;
    rowstart = 1;
  } else if(options == INITR_144GREENTAB) {
    _height = ST7735_TFTHEIGHT_144;
    commandList(Rcmd2green144);
    colstart = 2;
    rowstart = 3;
  } else {
    // colstart, rowstart left at default '0' values
    commandList(Rcmd2red);
  }
  commandList(Rcmd3);

  // if black, change MADCTL color filter
  if (options == INITR_BLACKTAB) {
    writecommand(ST7735_MADCTL);
    writedata(0xC0);
  }

  tabcolor = options;
}
The setRotation function needs to be updated to update the height fields correctly.
Sorry I did not pull these in...

And constants need to be added to the header file

Code:
#define INITR_18GREENTAB    INITR_GREENTAB
#define INITR_18REDTAB      INITR_REDTAB
#define INITR_18BLACKTAB    INITR_BLACKTAB
#define INITR_144GREENTAB   0x1

#define ST7735_TFTWIDTH  128
// for 1.44" display
#define ST7735_TFTHEIGHT_144 128
// for 1.8" display
#define ST7735_TFTHEIGHT_18  160

You can grab the Adafruit sources directly from github or you can use the Arduino library Manager to download the library for you.

Probably someone should probably merge the later updates from Adafruit's library into the PJRC one which is up at: https://github.com/PaulStoffregen/Adafruit_ST7735
 
Thanks!
I made the adafruit version work with my uno and have followed the instructions. My problem comes when I try to make it work on the teensy 3.2. I have tried both the adafruit version and the version that comes with the teensy libraries, but none have worked. What do you mean by the constants might be slightly different?

The PJRC version does not have the 1.44" code merged in, from the adafruit version (my previous post). So was not sure until I looked at code again if the GREENTAB version was the same as the 1.44 Green version and the answer is no...

Not sure If I have any of these displays... Should not be hard to merge as I mentioned
 
Also you may want to try out the Teensy specific version of library: ST7735_t3 library, that Paul did. I think it ships now with current Teensyduino.
It also has a green tab you can see defined in the header file: INITR_144GREENTAB

I have a version of it as well, that I also updated to use my SPIN code... May soon try to convert that to use the updated SPI code base... So that it can be on different SPI busses. But that is not an issue on T3.2 (only 1).

Note: you may have to experiment around with does the image line up correctly. Some of the 1.44" displays are setup to use the first part of memory and others the end part... So sometimes things have to be updated. I don't have one of Adafruits displays but have ones I purchased on Ebay (which were supposed to be something else...)
 
The PJRC version does not have the 1.44" code merged in, from the adafruit version (my previous post). So was not sure until I looked at code again if the GREENTAB version was the same as the 1.44 Green version and the answer is no...

Not sure If I have any of these displays... Should not be hard to merge as I mentioned

Thank you :D I think this solves my problems. I'll test it tonight. Much appreciated
 
Status
Not open for further replies.
Back
Top