2.2" SPI TFT - Anyone recognize this model ? - Page 1
Forum section: electronics / general

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: August 12, 2012, 03:38:34 pm
content: UPDATEI got it working now.The hacked together "datasheet" not only got the display name wrong (the BTL display has a different number of pins), but also the claim the the RS line is not needed and should be grounded is wrong. (it would be correct for the BTL221722...)The driver IC is indeed the ILI9225B, and the serial comm mode with 8 bits data frame and a separate command/data select line ("RS") are to be used.With that, the supplied example code does work.Using hardware SPI on my stm24f100 with 24 mhz (i.e. max 12 Mbit/s SPI clock), a bit "cheating" to use a 16bit data frame, and currently, no DMA, I get a full screen update rate of 15 Hz with 16bit pixels, which is already nice for an SPI TFT.This could perhaps get up to alomst a "cinematic" 25 Hz, with stm32f103's which can do 18Mbit/s SPI, and using DMA - which I think because the scope shows some good space between the write bursts, i.e. it's not fed as fast as possible.So far I'm quite happy with that display.-------------------------------------Hey!Does anyone recognize this 2.2" 220x176 SPI TFT, which I was unfortunate enough to buy?http://www.ebay.de/itm/2-2-SPI-Interface-TFT-LCD-Touch-Panel-176x220-Dots-262K-Colors-4-IO-Needed-/170860428742?pt=LH_DefaultDomain_0&hash=item27c8133dc6Another seller has it, from the looks:http://www.ebay.de/itm/2-2-inch-touch-serial-SPI-TFT-LCD-liquid-crystal-screen-/261076609049?pt=LH_DefaultDomain_0&hash=item3cc960e819The 1st chinese seller has given a wrong model name.He claims (in the supplied sheet), it's a BTL221722-276L,which it is probably not, because:I have now found I think 4..5 places on the net, ebay & elsewhere, where a display by that name was sold.They all gave the same specs (which is similar to the one I bought, but has the HX8340B driver IC), and all the photos looked alike, and the plastic frame and flex pcb look different from mine.Since the 2nd ebay seller doesn't give a name for the tft, and "everywhere else" the such named TFT is a different one, the 1st seller is probably wrong.They even initially had the HX8340B mentioned in their sheet - after I contacted them they fiddled in the datasheet and now claim it's the ILI9225B IC, like the 2nd seller, but they still call the TFT "BTL221722-276L" ...I think they don't really know what they're selling...Anyway, I can't get the thing initialized with the procedure for BTL221722-276L, and if it's not that display, knowing the IC is probably ILI9225B doesn't help me much, since i.e. I donÄt know the TFT, and setup parameters are TFT specific, right?(I'm not extremely experienced with those things, but such I've read. But I recently did get a cheapie 1.8" SPI TFT to run, so I'm not a complete n00b ;-) )EDIT:Btw., the given pinout seems to be at least partially correct, since the 3 backlight LEDs do work (all 3 of them).*scratches head*

author: shebu18
author_rank: Frequent Contributor
timestamp: August 12, 2012, 06:41:06 pm
content: I would say it is a mather of the chip to start the TFT. Have you tried toe procedure of the ILI9225B chip? Did you took a look on the chips you have on the back side?

author: amyk
author_rank: Super Contributor
timestamp: August 13, 2012, 09:46:05 am
content: In the world of small display controllers there tends to be little creativity as the majority of them use one of a few common command sets, copied from some of the original designs from Toshiba, Hitachi and a few others. I did abunch of researchfocusing mainly on CSTN but the situation with TFT shouldn't be that different.I don't have the ILI9225 datasheet but the ILI9220is in the Hitachi HD667xx family (a big one) while the HX8340 isn't (it's in a family that includes theTL8347 and a few other Himax devices, and possibly the TL2796.)My advice is to try the initialisation sequences and operations of the few common command sets and see what works.

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: August 13, 2012, 07:16:12 pm
content: Thanks for the advice, especially mentioning the original hardware.Yeah, I already found some samsung datasheet that looked pretty much exactly like one of the chinese ones I had a look at:-DBut, aren't some things very specific to the TFT panel used, e.g. the voltages? I'd imagine that that can decide whether it works, or not.As for the 9220 - it was mentioned in their (chinese sellers) example code... not the 9225.Does the 9220 use a dedicated cmd/data line? If not, their code probably never worked on any chip, lol.The 9225 doesn't, from what I saw.I'm considering looking for another display now, it can be chinese, but should be trief and proven, and there should be photos available that surely depict it, so I won't buy a wrong one again from ebay sellers who don't know their stuff.I also tinkered with the idea of buying a parallel display with otherwise similar specs - there were some cheaper ones, for which I have seen fotos e.g. at adafruit, confirming the driver IC, and providing init code...And then, using shift registers to make a serial display out of it - is that feasible?The 220x176 things with the Himax chip made a neat impression and I have also found some of them with confirmed IC... (by which I mean, I found several sites with identical looking detail photos & same specs).But what bugs me is the 9-bit serial protocol.The HW SPI of my stm32 does not support that, only its USART does, with max. 3Mbit/s, which gives me ~ 4 Hz update rate... ugh.Anyway, I'm really not too keen to waste more time on that thing here - unless anyone can surely identify the display.Instead of wasting yet one more weekend, i'd rather like to continue with the actual substance of my project.

author: Hypernova
author_rank: Unknown
timestamp: August 14, 2012, 04:12:01 pm
content: There's a reason why companies like Crystalfontz, 4D Systems and Electronic Assembly are still in business. Sometimes it's just not worth the hassle to mess with thesechinese sourced LCDs on a one off basis.

author: amyk
author_rank: Super Contributor
timestamp: August 15, 2012, 10:47:12 am
content: Quote from: TinkeringSteve on August 13, 2012, 07:16:12 pmEven if the voltages aren't right you'll see something, gamma and contrast may be off though. Some controllers have a small amount of OTP ROM for tuning these.QuoteThe 9220 has a RS line which is similar to all the other register-based controllers: write the register number with RS in one state, read/write the register value with RS in the other.QuotePhotos are only useful if they show the part number on the FPC, but otherwise not so much because all displays look roughly the same. Even if the FPC has the same part number you can't be guaranteed it's the same controller. I know this is definitely true of the CSTN world, where the mobiles that the displays are used in will detect the controller type automatically so it's not a big deal. (With CSTN there's mainly the 3 big families I pointed out above, and Epson/Philips are the majority.)

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: August 19, 2012, 12:39:04 pm
content: Ok amyk, I'll might give it another go. Just because it looks so "cute", sigh ^^ Would be the right size for what I want.Btw, on the back, there is some sort of batch numbers, or so I thought, but one of the codes ends with "-9225B", the ILI 9225B is for 176x220, so I guess it's no coincidence and it's really that one.What I still don't know now is, which of the different possible SPI modes on that chip is activated in the display...There are 8-bit modes, 9-bit modes, with RS line or with the 1st bit as RS (for 9bit mode) or even with a start byte that has a bit for that.But the "original" (cobbled together by the seller) spec sheet, which got at least the LED connections right, stated, for the RS line "NOT USE !" and told to put it to GND. Why is it even available if one should do that...What would be the best way to figure it out? Just try all the combinations in sequence? :-D Aw man.I think I'll try the 20,- EUR display first, that I got from a reliable seller in my country, to have some success moment this weekend, and get back to this mystery machine here later :-D

author: rk
author_rank: Newbie
timestamp: August 30, 2012, 06:03:05 pm
content: Hi,the seller sells two different 2.2" SPI displays; I have bought both (but I have not used them yet):2.2" SPI Interface TFT LCD + Touch Panel 176x220 Dots...http://www.ebay.de/itm/2-2-SPI-Interface-TFT-LCD-Touch-Panel-176x220-Dots-262K-Colors-4-IO-Needed-/170860428742This display has a Touch Panel and probably uses an ILITEK ILI9225B (according to you, the seller and an other seller).The same display is also sold by an other seller (http://www.ebay.de/itm/2-2-inch-touch-serial-SPI-TFT-LCD-liquid-crystal-screen-/261076609049); his webpage also mentions the ILI9225B, but his datasheets unfortunately are about a display with 16-bit-interface and the ILI9320.2.2" SPI Interface TFT LCD Module 176 x 20 Dots...http://www.ebay.de/itm/2-2-SPI-Interface-TFT-LCD-Module-176-x-20-Dots-262K-Colors-HX8340B-4-IO-Needed-/170724874233This display isreallynamed "BTL221722-276L R1.0", doesnothave a Touch Panel, and probably uses the Himax HX8340B.(And yes, they don't know what they are selling, and they could not tell the difference between these two displays (except for the touch panel), before I bought them.)I'm now trying to get the ILI9225B-datasheet. Does anyone of you have the datasheet of the ILI9225B?Otherwise I might try to get it working with the ILI9235C datasheet I have and the ILI9225-code in the web*.So:If you don't need a touchscreen and want the Himax HX8340B, you could buy the other 2.2" SPI display without touch panel.If you want a display, which is guaranteed to work, I could recommend the 3.2" TFT displays with SSD1289 and PCB. But it's 3.2", has a 16-bit-data-interface (so it needs at least 19 IOs), and is more expensive (about 14€/17$). But it works -- I have one running on a Raspberry Pi (although I have not yet tested the touch panel), and someone else got it running on a Carambola.If you can get the ILI9225B-datasheet, or use the ILI9225B-code in the web*, you could write a driver for this display.If you need an other display with a SPI-interface: I don't know of any cheap ones. The only way is probably to take a display with a parallel interface and use shift-registers (as someone has done with the 3.2" TFT and the Carambola **), or a CPLD (as I'm planning to do) to convert the parallel interface to SPI.*http://asf.atmel.com/docs/latest/sam.components.display.ili9225.example.sam3n_ek/html/ili9225_8c.html**http://www.8devices.com/community/viewtopic.php?f=5&t=102&sid=008a222a74b22bd868bfcb9b519bc728

author: amyk
author_rank: Super Contributor
timestamp: August 31, 2012, 06:36:04 am
content: Quote from: TinkeringSteve on August 19, 2012, 12:39:04 pmFirst result for ILI9225B in Google gives the datasheet:http://www.kentecdisplay.com/uploads/soft/Datasheet/ILI9225B_DS_V07.pdfPage 8 shows that pins IM0-3 are used to select the interface mode, so one could figure out what mode was used by seeing how they're connected. The only slight problem is, the "pins" are actually pads 40 x 56 um in size, so you're going to need a microscope.

author: rk
author_rank: Newbie
timestamp: August 31, 2012, 08:21:06 am
content: Quote from: amyk on August 31, 2012, 06:36:04 amThanks!Quote from: amyk on August 31, 2012, 06:36:04 amI don't think that you can see the padsat all, since they are probably soldered face-down to the LCD. But I would assume that it uses the 8-bit (or maybe 24-bit) 4-wire SPI interface; otherwise the display would be quite useless.

author: amyk
author_rank: Super Contributor
timestamp: September 01, 2012, 08:46:53 am
content: If it's COG, you can see the padsfrom the other side.With the given number of pins, it does make sense to try the serial interface options.

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: September 08, 2012, 10:59:22 pm
content: Well, I got the actual BTL221722-276L now (from a different seller), with the himax IC.It does work, but horribly slow, since my stm32 does not support the 9bit data frame SPI needed, and the USART can only do 3Mbit/s.I get ~ 2 Hz update rate in 12BPP mode (cant do less).So to make this thing usable at all, a "update as small screen areas as possible" strategy is needed.Which only makes sense if what one wants to display really lends itself to that.But better than nothing for now ^^

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: September 17, 2012, 09:26:21 am
content: I updated the original post. The display now works.

author: RobG
author_rank: Newbie
timestamp: September 19, 2012, 12:23:35 am
content: Awesome! I have been watching this thread because I got both of those 2.2" LCDs some time ago.After asking seller to provide corrected data sheet, all they did is added 2 pins on each side of the connectorAlso, the drawing has reversed pin numbers so I have to remake my PCB. The LCD without the touch panel is fine.I was suspecting that this could be 8bit SPI, but I am not successful in init'g it.Is the pinout the same? Can you provide your init sequence?Thanks.

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: September 20, 2012, 03:15:11 pm
content: Hi,have you carefully checked all solder connections? E.g., grab a multimeter and and check for stable continuity between each line on the flex print and corresponding pin on your adapter PCB. And no shorts of neighboring ones.Checked each GPIO pin for correct configuration? Not just in code, do measure whether the pin voltages do as supposed when toggled in software.Note: for stm32, IIRC, a few pins do not have GPIO as default but as alternate function, and must be configured accordingly (e.g. the JTAG pins, if you use SWD and therefore decided to use them as GPIO...)The pinoutgiven when I originally posted this was correct, besides that yes, RS must ineed be used. They reversed it?? WTF.Btw., 18 pins, with the two outer ones not used, i.e. 16 actual pins ==> you could use an LQFP64 adapter (16 pads per edge), which is sometimes cheaper (when bought in qty 5 pcs or so) than those display adapters. (done this)The init sequencein the source code provided in the ebay auction works, at least the one for stm32.I also only have that code, just a bit fiddled with.One important thing is: you need toprovide your own delay function! As is often in example code, they use a for loop or something, you never get the correct timing with that, except when using the exact same MCU & clockspeed & no interrupts. It's garbage.You'll have to implement a microsecond, or millisecond timer.Those china ware data sheets will often write "ms" for actually microseconds, i.e. µs - but sometimes they do actually mean milliseconds, *sigh*. Not so keen on standards.Can't look at it here, but I think for this one it was ms, i.e. your delay function must wait the number of millieconds passed as parameter.Then, there's another trap,when using hardware SPI:You must make sure that youdon't flip the ChipSelect line too early, i.e. before the last byte given to the SPI's TX buffer was actually fully transmitted by the hardware. The TX register on STM32 SPI can be empty again before transmission is finished. Wait busy "BSY" flag to be zero to make sure it's done.

author: RobG
author_rank: Newbie
timestamp: September 21, 2012, 02:04:13 pm
content: Thanks Steve, I got it working now!The PCB you see in the picture was made by me, it's a Booster Pack for MSP430 & Stellaris LaunchPad. After realizing that the pins are reversed, I have soldered the display to a custom made breakout board.When it come to software, I have written a universal library that works with 8 and 9 bit SPIs, so the bit banging was the way to go. It's little slower than hardware SPI, but I can use it with many different displays, Nokia, JD-T, HX8340 based, and now I am hoping to use it with ILI9225B.Thanks again,Rob. 43oh.com

author: RobG
author_rank: Newbie
timestamp: October 29, 2012, 03:21:26 pm
content: One more thing is incorrect, touch panel connections.Datasheet: Y-, X+, Y+, X-Actual: Y-, Y+, X-, X+

author: rk
author_rank: Newbie
timestamp: June 03, 2013, 02:42:55 pm
content: Quote from: rk on August 30, 2012, 06:03:05 pmSmall update: The 3.2" TFT display I mentioned runs well with an Raspberry Pi, and the touchscreen works, too. But since the Raspberry Pi does not have enough GPIOs by default, some ugly hacks were necessary, so it's better to use some additional electronics and create e.g. a SPI-to-parallel-converter.So, I've now built a board (called "AdvaBoard"), where you can connect this 3.2" TFT display (or a 2.4", 4.3", 5" or 7" one), and communicate with the display and the touchscreen via (optimized) SPI; and I've achieved up to nearly 50 frames/s (!) with the 3.2" display. So, this board can be used to connect such displays to any microcontroller-SPI or to the Raspberry Pi.If you're interested in the board (or a cut-down-version, containing only the display-interface), please mail me or visithttp://www.advaboard.deorhttp://www.advamation.com/products/embeddedpc/advaboard.html.

author: kerrinal
author_rank: Contributor
timestamp: June 19, 2013, 03:01:08 am
content: I just got a 1.8 SpI TFT LCD Shield 128X160 dots including a sd card Socket

author: PetrS
author_rank: Newbie
timestamp: July 21, 2013, 03:40:39 pm
content: Hello guys,I have bought a cheap (< $9) display that is mentioned in the subject of this thread on Ebay and I couldn't get it working on Arduino at all. Even modifying the provided C51 sample code and comparing with the ILI9225B datasheet still didn't lead to success. So I've decided to ask both Rob and TinkeringSteve by PM and right afterwards I found out that the C51 code was missing one simple instruction that gets it working miraculously. The instruction is:Lcd_WriteIndex(0x28);(the WriteIndex is just sending the 0x28 as command byte, that's the C51 sample code syntax)The instruction should be the very first instruction right after the LCD Reset. I found it in a library called lcd_screen-distribution105.zip on Embedded Computing by Rei Vilo (so you might simply go there and try using his library).I thought I'd share this bit of crucial information here (since Google leads to this thread when one searches for the 2.2" display) that wasn't covered by the sample code from the Ebay seller.The other information mentioned here, especially that RS needs to be used (instead of 9-bit SPI) is valid for my display as well, so I bet I got the same LCD as TinkeringSteve.Thanks and enjoyPetr

author: RobG
author_rank: Newbie
timestamp: July 22, 2013, 05:41:55 pm
content: You should always do software reset to restore default values. Some init functions do not include all necessary commands.Check outmy library