ST7735 Graphics Chip & read frame buffer memory over SPI

Go To Last Post
65 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I'm aware of your code in #13. Thank you for posting it :-)

 

I have no trouble reading the ID bytes either through command 0x04 or through commands 0xDA to 0xDC. All the other read commands work as expected as well. The RAMRD command (0x2E) however results in all ones regardless of the amount of bits read, and this is not what the memory contents are set to.

 

The module I'm using is off eBay and labeled as 1.44" SPI 128*128 V1.1. I'll have to admit that I assumed that the controller was an ILI9163 based on your comment on eBay 128x128 displays being ILI9163 as well as the note in the ILI9163 datasheet. The ID bytes reported by the display are 0x5C89F0, which may in fact match an ST7735.

 

Anyway, the display just doesn't seem to have any interest in responding to the RAMRD command. I've tried using different clock speeds, different power modes, different pixel formats etc.

 

I've ordered some other displays from eBay - hopefully with better results this time :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

0x5C89F0 confirms that you have NOT got an Ilitek ILI9163C.

 

There are several different makes of "almost" ST7735.   Some of which can read registers but not GRAM.

No,   we have had discussions on the Arduino.cc forum.   And concluded that it is not Sitronix and not Himax  and not Novatek.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am still struggling to get just a glip of a pixel on ,on my display.(Topfoison TF-BL17711B-V1,small ribbon cable,18 pins ,pin1 and 18 not used,4 pins for touch screen)

I see the mention of a ID which is not a ili9163 ,how do you know what ID is used for what display?

The CS is not very clear on the datasheet .

From the datasheet === if CS is HI serial interface is initialised and CS = LOW then ready for data.

Should CS be toggled HI -LOW before every command/data string is send and should DC be toggled back to previous state after data is send?

I saw a few posts that says CS can be tied to ground if no read function is used.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Life is much simpler when you provide a link to the actual item.

 

My best efforts with Google found http://www.topfoison.com/product/1.77inch-touch-TFT-LCD-module.html

which appears to be a bare 3.3V module with an ILI9163C.   That is TF-BL17711A.  Apparently you have the B version.

 

1. I suggest that you read the ID to determine the actual controller (or to confirm that it is ILI9163)

2. These controllers tend to be not fussy about CS.   But in my opinion it is very unwise (tm) to not use CS properly.

3. You can leave DC in whatever state that you like.   It must be high for data, low for command.  

 

It is a mystery why anyone would want to misuse the interface.   Why not follow the timing diagrams in the datasheet?

 

Note that it is a single bi-directional SDA pin.   An AVR can only read with bit-bashing.   You can write with SPI.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks already got that picture and datasheet.
What is the ID of the ili9163?
What is the yellow block in the middle of the timing daigram with a 0 (zero) printed inside.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The state of DC is only read during the last SPI bit.   DCX can have any value during D7..D1 bits.   It must be 0 in D0 bit for command (1 for data)

 

In practice,   you set DC to 0 before writing an SPI byte.    In practice,  most sequences are:

CS-ACTIVE, DC=0, spi(command), DC=1, spi(data), ....spi(data), CS_IDLE

 

Most "commands" have data arguments.   If you are doing a fillScreen(),  you will be doing 160x128x2 spi(data).

In practice,  you might wait for completion of the spi(command) before starting the enormous data block (perhaps with DMA).

I suppose that you could send the DC=0 with a one-shot.   It is not worth the bother. 

 

Read 0x04 for the ID:  54 80 66

or read 0xDA, 0xDB, 0xDC.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got my LCD to initialise (i hope so)there is various color pixels on the display.

Now the next step is to put some pixels on it ,i looked at a lot of source code from different site but i finds it very complicated.

What is the steps to setup which registers to write on the display.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go on. It is straightforward to write a single drawPixel(x, y, color) function.
Everything follows from there.
.
Ok, there are optimisations for filling a rectangular area. But drawing one pixel at a time is not too bad on a small display.
.
If you do not understand something, post a link to public code, quote the problem sequence, ask your question.
Or ZIP up and attach your complete buildable AS7 project.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Every thing is easy once you know the answer.

I spend weeks searching for info to get the lcd initialised ,i  also cut the little pcb mount connector for the ribbon cable from the original pcb and solder very thin wires on the pins.

This lcd come from a lightning damadge LAN router and still works.(ili9163 topfoisn ).

Then back engineerd the pins to find which of the 18 i need to narrow it down to cd,dc,rst,sda and the 3v3 supply.

Dont be so rude i really think i deserve some easy answers .

The datasheet gives all the ingridance but does not tell you how to mix the ingridance to bake a cake.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Post your drawPixel() function. Or preferably a whole project ZIP.
It is the most effective way to get help.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David, I cut and pasted your code in post #13, and I only needed to change the pin numbers to get it to work first time with my ebay bought 1.44" TFT screen (eBay item number:263168647740)

http://www.ebay.co.uk/itm/1-44-C...

 

Original:
#define TFT_DC  (9)     //DC=7 for HX8347
#define TFT_RESET (8)   //Backlight on HX8347

Altered to: (because this is how I have my screen wired for hardware SPI to na Arduino Nano)
#define TFT_DC  (8)     //DC=7 for HX8347
#define TFT_RESET (9)   //Backlight on HX8347

The result was this unit has the ST7735R controller chip.

You, Sir, are a very clever man.
I thank you

Kintara 8-)

Last Edited: Tue. Sep 12, 2017 - 11:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

These Red Displays require 3.3V logic.     Your Nano has 5V GPIO.

   

Do not believe Ebay vendors.

You should either use a level converter chip or simply insert series resistors on RESET, DC, SDA, SCK pins.

 

There are many ST7735 libraries.   These displays work well.

 

David.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

These Red Displays require 3.3V logic.     Your Nano has 5V GPIO.

   

Do not believe Ebay vendors.

You should either use a level converter chip or simply insert series resistors on RESET, DC, SDA, SCK pins.

 

There are many ST7735 libraries.   These displays work well.

 

David.

 

 

 

Absolutely correct. The logic signals should be converted to 3.3v. But as I'm just messing about with the displays as I have a few left over from a build I'm running it directly from the Nano. I wouldn't advise doing that for a finished product.

I wonder if anyone has ran them to destruction on 5v logic levels to see how long they last. Had mine running for a week with no ill effects - but not advisable for long term reliability.

 

Kintara

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You probably have a ST7735S. Read the ID registers. The datasheet says that ST7735S is not 5V tolerant.
Examine your module pcb. Are there any series resistors?
.
Run your TFT to destruction if you want.
.
David.

Pages