1.8" TFT LCD with black tab - swapped colors

by Andy_123 on Sun Jan 27, 2013 1:43 pm

I am not sure if this is dispaly related or not:

What I see is if I dispaly 8 basic colors then
RED/Blue collors swapped
Yellow/Cyan swapped

Green, Magenta, Black and White are OK
If I remap codes in .h file then display shows basic colors correctly

Yellow is a combination of Red and Green
Cyan is combination of Blue and Green

It feels like Blue and Red pixels are swapped... Is it even possible?

I tried multiple examples - all giving me the same result.
Any Ideas?

Thanks
Last edited by Andy_123 on Mon Apr 29, 2013 6:18 pm, edited 1 time in total.
Andy_123
 
Posts: 9
Joined: Sun Jan 27, 2013 1:29 pm

Re: 1.8" TFT LCD - incorrect (swapped) colors

by Andy_123 on Sun Jan 27, 2013 5:11 pm

I have suspision that hardware pin SRGB of ST7735 on my display is not set correctly

To invert it, I was able to clear RGB bit it in MADCTL register (ST7735.cpp file) and now it looks correct.

Any other ideas?
Andy_123
 
Posts: 9
Joined: Sun Jan 27, 2013 1:29 pm

Re: 1.8" TFT LCD - incorrect (swapped) colors

by adafruit_support_rick on Sun Jan 27, 2013 6:29 pm

We stock 3 different 1.8" TFT devices. What is the product ID of the screen you have?
User avatar
adafruit_support_rick
 
Posts: 8470
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: 1.8" TFT LCD - incorrect (swapped) colors

by Andy_123 on Sat Apr 27, 2013 10:52 am

I just want to bring this thread back - it appears that black tab displays have RED and BLUE colors swapped and library was updated recently to address this.

It was done by swapping BLUE and RED colors before sending each pixel - from my tests that slows down dispaly dramatically
Code: Select all
if (tabcolor == INITR_BLACKTAB)   color = swapcolor(color);

Also "if" check performed at runtime that takes extra time - if should be done at compiler level I guess.

The more efficient way is to clear RGB bit in then MADCTL register - this will automatically swap colors and no swapcolor() is necessary.

Here are simple changes:

Replace 0xC8 witt 0xC0:
Code: Select all
    ST7735_MADCTL , 1      ,  // 14: Memory access control (directions), 1 arg:
      0xC0,                   //     row addr/col addr, bottom to top refresh
 


Also remove all instances of MADCTL_RGB from setRotation
Andy_123
 
Posts: 9
Joined: Sun Jan 27, 2013 1:29 pm

Re: 1.8" TFT LCD with black tab - swapped colors

by adafruit on Mon Apr 29, 2013 8:58 pm

Thats right! thanks for the reminder, latest github library has this fix and supports all tab colors
User avatar
adafruit
 
Posts: 11505
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: 1.8" TFT LCD with black tab - swapped colors

by Aron on Sun Oct 20, 2013 2:24 pm

I have the same issue using the 1.8" LCD (ST7735R) with BeagleBone Black. BBB's running ArchlinuxARM, kernel 3.8.11.

I can load the 1.8" LCD's Device Tree file (cape-bone-adafruit-lcd-00A0.dts), and everything's fine, except the swapped colors. The LCD works with Arduino, using libraries provided by Ada, and it does not swap the colors. Thanks for any help!
Aron
 
Posts: 1
Joined: Mon Aug 26, 2013 7:13 am

Re: 1.8" TFT LCD with black tab - swapped colors

by adafruit_support_rick on Sun Oct 20, 2013 2:43 pm

That file is part of the Beagleboard kernel distribution. We don't support it here. You'll have to contact Beagleboard.
User avatar
adafruit_support_rick
 
Posts: 8470
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY