NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Basic Electronics » GLCD SPI problems
September 27, 2013 by andyi |
Hi, I have looked over the forums and internet in general but I cannot find the answers i need (or I'm too stupid to understand them). I have a small 1.8 inch tft screen from ebay. It has an spi interface with the following pins:- RESET, A0, SDA, SCK, CS, It is a ST7735 controller and looking in the datasheet it mentions 2 versions of spi: 3 wire and 4 wire. The difference is that the 4 wire version uses CS, SDA, SCK and D/C (data or command switch) and the 3 wire uses CS, SDA and SCK whereby the D/C instruction is sent as a single bit immediately before the serial byte. i.e. 9 bits of info sent instead of 8. What I need to know first is which one is this? I think it all revolves around the A0 pin. I assumed this was the serial out pin and therefore I should use the 3 wire SPI protocol but could this pin be the D/C pin instead? Does any of this make sense ? Andy. |
---|---|
September 27, 2013 by JimFrederickson |
Hello Andy, It may be that you have multiple interfaces on that 1.8" display? Are those the ONLY pins for the Interface that are available, or just the pins that you Usually... SDA SCK, and A0 are associated with and an I2C Interface. MOSI, MOSO, SCK or CLK, CS are associated with an SPI Interface. I have seen some 1.8" Displays that have multiple Interfaces as well as some that have The place you purchased it from did not have a Datasheet? Do you have more details as to the Display? (Manufacturer for instance?) |
September 28, 2013 by andyi |
Hi Jim, Thanks for getting back to me. I think I made the mistake of assuming SPI and serial are the same and could be used interchangeably. I have been sent a number of diagrams that appear to show SD card connections too but mine doesn't have an SD card. All I know is that there are 14 pins and the controller is ST7735. The pinout i was sent is:- 1 NC 2 VSS 3 LED- 4 LED+ 5 VSS 6 /RET 7 A0 8 SDA 9 SCK 10 VDDA 11 VDDIC 12 /CS 13 VSS 14 NC where VSS and LED- are connected to Ground, LED+, VDDA, VDDIC are connected to 3.3V and the rest to the MCU (via 10K resistors to bring the voltage down to ~3.3v) |
September 28, 2013 by JimFrederickson |
Hello Andy, On the "drawing/datasheet" where you got your pinout do you see these numbers: TFT177T027-V4 Or maybe the actual filename is: SPE_IM120905001_FPC.pdf That one, that I found, shows the same Pinout as you posted. I looked it up initially, because I thought maybe you had an error in your Post. It is unusual NOT to have a GND pin referenced somewhere, however I did find one that doesn't... It seems that it is very likely, that most of your confusion |
September 29, 2013 by andyi |
The drawing has the heading TFT177F028 but further down there is also the designation TFT177M028-V4 . It is surrounded by chinese characters so I don't know what it refers to. |
September 29, 2013 by JimFrederickson |
Very similar to the one that I found... The names of the pins on the 14-pin connector do not follow what the ST7735 Datasheets shows. I am pretty sure that the following are correct: SDA - Serial Data (it looks like both in and out) There are 2 more Interface Pins to account for on the ST7735 Interface: A0 - Probably is for “Address Line 0”, this is common for selecting devices and also /RET - Is probably trying to saying “active low” with the “/” and “RET” is probably /CS - Is again probably trying to represent an “active low” condition, for the “Chip So you Interface Pins are: This is a fairly complex Controller. Just “talking to it” is only part of the problem. You have to “talk to it with the data and formats it expects” as well! Hopefully you have some code already designed, and known working, for this display? There is ALWAYS the allure of "cheap parts from China", but there is also the "reality of figuring them out". Often the documentation is not what it used to be when everything was made here, or at That is, probably, the most help I can give. (Which I believe, and hope, is accurate.) I don't have one of these Displays. I found lot's of software designed in the Arduino Environment for this Display, but This Interface while "called SPI" is not the "Serial Peripheral Interface"/"SPI" This is more a form of I2C... (you can look at good descriptions of both Standards on Wikipedia.) |
September 29, 2013 by andyi |
Thanks so much for that explanation. I do have some code for ST7735 controller - originally for another MCU but I think I've modified correctly it for the AVR. I'll get to the code bit when I'm fairly sure that the thing is wired up properly. |
September 29, 2013 by JimFrederickson |
If yo have code that "you believe works", I would use that first. I don't think that it is "I2C Compliant/compatible" it is just that the protocol they I would suggest getting the LCD to work with what you have and then separately getting Then you can look into seeing if i2c it will work with your LCD... There is a Thread in the Forums for a 24LC256 EEPROM. This part is relatively cheap, But read-up and be careful in your testing... Good Luck! |
September 30, 2013 by Ralphxyz |
And then there is Rick's I2C LED thread!! Since you will have a I2C buss going. Ralph |
September 30, 2013 by JimFrederickson |
I was only using the 24LC256 EEPROM because that is a cheap part, simple to wire with That way he can, fairly easily, have an AVR that Communicates VIA i2c to start with. So it is a "known good i2c implementation" and then "software on the AVR"... The "i2c LCD THREAD", :), is great but there it is more involved. I am always a fan of "smaller bites"! :) |
November 08, 2013 by andyi |
Hi, Thanks for all your suggestions. I managed to get this working by not using SPI but setting clock and SDA explicity in code. The A0 pin that I mentioned above is indeed the D/C (aka RS) input. Now I will try and make it work using SPI just for completeness sake. btw, Ralph, I asked you before about the best way of connecting FPC or FFC cables. I found these adapter boards that you can solder various pitch cables directly to. the code is just the same UTFT code I used for the sainsmart 3.2 glcd in my other thread. Andy. |
November 08, 2013 by andyi |
also I should mention that I got this working by running the mcu and glcd at 3.3v |
November 08, 2013 by Ralphxyz |
Hey andyi, those pcbs look interesting. What is the ic in the upper right? Do you have a schematic? Ralph |
November 10, 2013 by andyi |
Hi Ralph, I'm not sure what that space is designed for, possibly a level shifter ic? I only use these boards to solder FPC cable to as it is the only way I've found to do this reliably without buying expensive connectors for every ribbon I come across. As you can see from the link they have 4 different pitches and in the pictures below, you can see how easy they are to solder up (my soldering skills are basic at best!). |
Please log in to post a reply.
Did you know that inductors try to keep their current constant over short periods of time? Learn more...
|