Raspberry PI LCD Adapter Kit


18 posts
by iteadstudio » Tue May 14, 2013 7:18 am
We released a "Raspberry PI LCD Adapter Kit" before, and you can have our ITDB02-2.4E and ITDB02-2.8 connected directly to the Raspberry Pi for use. Here we provide some demo codes for these two screens – the demo codes are modified based on UTFT and UTouch libraries provided by Henning. As it is only for demonstration, and our engineers are not familiar with the Raspberry Pi, the codes may be a little bit rough thus for reference only.
Image
First, connect ITDB02-2.4E screen module to Raspberry Pi through our Raspberry PI LCD Adapter Kit, then start the Raspberry Pi and enter the system.

Next, we will need to create an IO operation library wiringPi for the Raspberry Pi. For specific installation method, please refer to this post.

After installation, copy the demo code folder we provided to the user directory (then extract the compressed packages) – To facilitate demonstration, we put it directly on the desktop. Run the command line (if it is placed in other locations, modify to the corresponding directory path):
cd / home / pi / Desktop / RPILCD

Then run the command line so that gcc can compile file:
gcc lcd.c lcddemo.c SFont.c-lm-lwiringPi-o lcddemo

After compiling, implement ‘run’ command to see the display results, and Raspberry Pi will drive ITDB02-2.4E to refresh and display of a variety of patterns constantly
sudo. / lcddemo

As we nearly used all the functions provided by UTFT, you can also regard this demo file as half of a library, and you can modify LCDDemo file directly or re-create a new file. That is, you can write a realization program, then save it and use command lines to browse, compile and run to see the implementation effects.

You can download the zip here:http://blog.iteadstudio.com/raspberry-pi-with-tft-lcd-demo/
Posts: 11
Joined: Tue May 14, 2013 6:57 am
by notro » Tue May 14, 2013 11:45 am
The Connection table on the product page has a confusing header: Pins of Raspberry.
Looking at the code example it seem to be Wiring PI Pins.
Wiring Pi pin mapping table: http://wiringpi.com/pins/

I have made a framebuffer driver for the ITDB02-2.8 display (~25 fps). Download prebuilt image here https://github.com/notro/fbtft/wiki
This is the default GPIO mapping which has to be changed to match the adapter (dc=RS):
Code: Select all
modprobe fbtft_device name=itdb28fb gpios=reset:17,dc:1,wr:0,cs:21,db00:9,db01:11,db02:18,db03:23,db04:24,db05:25,db06:8,db07:7
modprobe itdb28fb debug=3
Posts: 506
Joined: Tue Oct 16, 2012 6:21 pm
Location: Norway
by iteadstudio » Thu May 16, 2013 11:25 am
Thanks notro ~ Thanks for your supplement about the Wiring PI Pins

And the framebuffer driver is cool , I will try it and give you the reply about my experience. Would you like to make it ITDB02-2.4E support :) We'd like to offer the free 2.4" sample~
Posts: 11
Joined: Tue May 14, 2013 6:57 am
by notro » Thu May 16, 2013 2:36 pm
iteadstudio wrote:And the framebuffer driver is cool , I will try it and give you the reply about my experience. Would you like to make it ITDB02-2.4E support :) We'd like to offer the free 2.4" sample~
Glad you liked it :)

I had a quick look at the S6D1121 datasheet, and it looks like it uses the same registers to set GRAM update area as the ILI9325. That means you can probably use the flexfb driver.
Use the ITDB02-2.8 example, adjust width, height, gpios and init sequence: https://github.com/notro/fbtft/wiki/fle ... 28-ili9325
I'm a bit busy right now, so I can't make a dedicated driver. I have a display on the shelf that has been waiting 3 weeks for a driver...

Let me know if it works, and I'll add it to the wiki.
Posts: 506
Joined: Tue Oct 16, 2012 6:21 pm
Location: Norway
by stanley » Fri May 17, 2013 6:01 am
Hi,

I got an older revision D ITDB02-2.4DWOT without touchscreen and I hv a hard time figuring out the Raspberry Pi pinout from this page... without the LCD adapter...

http://store.iteadstudio.com/index.php? ... cts_id=133

There isn't any ICs on the back of the rev D board, is that normal or someone forgot to solder them on it ??

I have the pinout for the TFT LCD but for the Raspberry Pi side, I can't figure out which pins to connect to... is it physical pinout or the GPIO...

I'm looking at the RPILCD.doc , SetPinNU(P0, P1, P2, P3, P4, P5, P6, P7, Prs, Pcs, Pwr, Prst, Pdout, Pirq, Pdin, Pclk);

Which pins are P0 - P7 connect to the RPi ??

Thanks
Stanley
blog :- http://arduino-for-beginners.blogspot.com/
fb group :- https://www.facebook.com/groups/arduino.for.beginners/
Posts: 32
Joined: Fri Feb 01, 2013 7:38 pm
Location: Kuala Lumpur, Malaysia
by notro » Fri May 17, 2013 12:19 pm
This is to help those using the adapter with the FBTFT driver itdb28fb. I don't have an adapter, so this information is not verified

Raspberry PI LCD Adapter Kit wiring translation table
Code: Select all
 ITDB02     Wiring Pi   Raspberry Pi Pin    GPIO rev. 1   rev.2 change    FBTFT pinname
--------------------------------------------------------------------------------------
   DB8            D0             11              17                            db0
   DB9            D1             12              18                            db1
   DB10           D2             13              21             27             db2
   DB11           D3             15              22                            db3
   DB12           D4             16              23                            db4
   DB13           D5             18              24                            db5
   DB14           D6             22              25                            db6
   DB15           D7              7               4                            db7
   CS             D10            24               8                            cs
   RS             D8              3               0              2             dc
   WR             D9              5               1              3             wr
   RST            D11            26               7                            reset
   T_CLK          D12            19              10                           
   T_CS           D13            21               9                           
   T_DIN          D14            23              11                           
   T_DOUT         D15             8              14                           
   T_IRQ          D16            10              15                           
   VCC            +5V            2,4             
   GND            GND        6,9,14,20,25

Load driver

Rev. 1 board
Code: Select all
modprobe fbtft_device name=itdb28fb gpios=db0:17,db1:18,db2:21,db3:22,db4:23,db5:24,db6:25,db7:4,cs:8,dc:0,wr:1;reset:7
modprobe itdb28fb debug=3
Rev. 2 board
Code: Select all
modprobe fbtft_device name=itdb28fb gpios=db0:17,db1:18,db2:27,db3:22,db4:23,db5:24,db6:25,db7:4,cs:8,dc:2,wr:3;reset:7
modprobe itdb28fb debug=3


Edit: Fixed table, it was too wide.
Posts: 506
Joined: Tue Oct 16, 2012 6:21 pm
Location: Norway
by Skmo » Sun Jun 16, 2013 7:08 am
Notro, thanks for all the work! Just got my kit and lcd in the mail. I can get it to work with the itdb28fb fbtft driver but i cant make it permanent. I can see it is loading the driver on my hdmi monitor but the 2.8 is just black with the back light lit. Is it because the gpios are wired different? I'm kinda lost on this one. Any help would be great!
Posts: 2
Joined: Sun Jun 16, 2013 6:59 am
by texy » Sun Jun 16, 2013 7:28 am
Hi,
if you have the display working, but not permanent, then you probably need to edit the /etc/modules file and add the information.
For example, for the 1.8" TFT displays I sell, I would
Code: Select all
sudo nano /etc/modules


and add
Code: Select all
fbtft_device name=sainsmart18fb verbose=0 speed=32000000 fps=50
sainsmart18fb


(obviously you need to change those configurations for your display type)
Save those changes with Control-X, Y and reboot your Pi.
Hope this helps,
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2353
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by Skmo » Wed Jun 19, 2013 5:26 am
notro wrote:Rev. 2 board
Code: Select all
modprobe fbtft_device name=itdb28fb gpios=db0:17,db1:18,db2:27,db3:22,db4:23,db5:24,db6:25,db7:4,cs:8,dc:2,wr:3;reset:7
modprobe itdb28fb debug=3


Thanks Texy, I Added notros code to the /etc/modules and it works now
Posts: 2
Joined: Sun Jun 16, 2013 6:59 am
by bgouveia » Sat Aug 10, 2013 9:05 pm
notro wrote:
iteadstudio wrote:And the framebuffer driver is cool , I will try it and give you the reply about my experience. Would you like to make it ITDB02-2.4E support :) We'd like to offer the free 2.4" sample~
Glad you liked it :)

I had a quick look at the S6D1121 datasheet, and it looks like it uses the same registers to set GRAM update area as the ILI9325. That means you can probably use the flexfb driver.
Use the ITDB02-2.8 example, adjust width, height, gpios and init sequence: https://github.com/notro/fbtft/wiki/fle ... 28-ili9325
I'm a bit busy right now, so I can't make a dedicated driver. I have a display on the shelf that has been waiting 3 weeks for a driver...

Let me know if it works, and I'll add it to the wiki.


Hi , I managed to use your driver with an S6D1121 LCD with the following lines :

Code: Select all
modprobe fbtft_device name=flexpfb
modprobe flexfb width=240 height=320 regwidth=16 setaddrwin=1 init=-1,0x0013,0xCC00,-1,0x0011,0x2004,-1,0x0015,0x2600,-1,0x0014,0x252A,-1,0x0012,0x0033,-1,0x0013,0xCC04,-2,5,-1,0x0013,0xCC06,-2,5,-1,0x0013,0xCC4F,-2,5,-1,0x0013,0x674F,-1,0x0011,0x2003,-2,5,-1,0x0030,0x2609,-1,0x0031,0x242C,-1,0x0032,0x1F23,-1,0x0033,0x2425,-1,0x0034,0x2226,-1,0x0035,0x2523,-1,0x0036,0x1C1A,-1,0x0037,0x131D,-1,0x0038,0x0B11,-1,0x0039,0x1210,-1,0x003A,0x1315,-1,0x003B,0x3619,-1,0x003C,0x0D00,-1,0x003D,0x000D,-1,0x0016,0x0007,-1,0x0002,0x0013,-1,0x0003,0x0003,-1,0x0001,0x0127,-2,5,-1,0x0008,0x0303,-1,0x000A,0x000B,-1,0x000B,0x0003,-1,0x000C,0x0000,-1,0x0041,0x0000,-1,0x0050,0x0000,-1,0x0060,0x0005,-1,0x0070,0x000B,-1,0x0071,0x0000,-1,0x0078,0x0000,-1,0x007A,0x0000,-1,0x0079,0x0007,-1,0x0007,0x0051,-2,5,-1,0x0007,0x0053,-1,0x0079,0x0000,-3

nice piece of code btw.

I also tried to change it to landscape mode , but it wasn't working very well , changed the resolution and the entry mode , but the screen wasn't updating where it should

Greetings

Bruno Gouveia
Posts: 3
Joined: Sat Aug 10, 2013 8:58 pm
by notro » Sun Aug 11, 2013 1:33 pm
bgouveia wrote:I also tried to change it to landscape mode , but it wasn't working very well , changed the resolution and the entry mode , but the screen wasn't updating where it should
Maybe this can help you with the entry mode: https://github.com/Tectu/ChibiOS-GFX/bl ... _lld.c#L77
Posts: 506
Joined: Tue Oct 16, 2012 6:21 pm
Location: Norway
by bgouveia » Sun Aug 11, 2013 3:09 pm
notro wrote:
bgouveia wrote:I also tried to change it to landscape mode , but it wasn't working very well , changed the resolution and the entry mode , but the screen wasn't updating where it should
Maybe this can help you with the entry mode: https://github.com/Tectu/ChibiOS-GFX/bl ... _lld.c#L77


Hi , thanks

I actually forgot the rotate parameter... , everything working now.

Code: Select all
fbtft_device name=flexpfb rotate=3
flexfb width=240 height=320 regwidth=16 setaddrwin=1 init=-1,0x0013,0xCC00,-1,0x0011,0x2004,-1,0x0015,0x2600,-1,0x0014,0x252A,-1,0x0012,0x0033,-1,0x0013,0xCC04,-2,5,-1,0x0013,0xCC06,-2,5,-1,0x0013,0xCC4F,-2,5,-1,0x0013,0x674F,-1,0x0011,0x2003,-2,5,-1,0x0030,0x2609,-1,0x0031,0x242C,-1,0x0032,0x1F23,-1,0x0033,0x2425,-1,0x0034,0x2226,-1,0x0035,0x2523,-1,0x0036,0x1C1A,-1,0x0037,0x131D,-1,0x0038,0x0B11,-1,0x0039,0x1210,-1,0x003A,0x1315,-1,0x003B,0x3619,-1,0x003C,0x0D00,-1,0x003D,0x000D,-1,0x0016,0x0007,-1,0x0002,0x0013,-1,0x0003,0x0009,-1,0x0001,0x0127,-2,5,-1,0x0008,0x0303,-1,0x000A,0x000B,-1,0x000B,0x0003,-1,0x000C,0x0000,-1,0x0041,0x0000,-1,0x0050,0x0000,-1,0x0060,0x0005,-1,0x0070,0x000B,-1,0x0071,0x0000,-1,0x0078,0x0000,-1,0x007A,0x0000,-1,0x0079,0x0007,-1,0x0007,0x0051,-2,5,-1,0x0007,0x0053,-1,0x0079,0x0000,-3
Posts: 3
Joined: Sat Aug 10, 2013 8:58 pm
by notro » Sun Aug 11, 2013 3:25 pm
Good, which display are you using? I'm going to add it to the wiki.
Can you also give me the various entry mode values for the different rotations?
Posts: 506
Joined: Tue Oct 16, 2012 6:21 pm
Location: Norway
by bgouveia » Sun Aug 11, 2013 8:47 pm
Hi,

I bought the dipslay on ebay, in the description the seller says that it uses an ili9235 controller but it actually comes with an s6d1121 , it's an 8bit 2.4" lcd like this one from elecfreaks (http://www.elecfreaks.com/store/24-tft- ... p-110.html) , it comes with a touchscreen and an SD card socket.

the entry modes are similar to the ili9235 (the bit positions are diferent):

Register 0x0003 controls rotation: 0=0x0003, 1=0x000A, 2=0x0000, 3=0x0009
Posts: 3
Joined: Sat Aug 10, 2013 8:58 pm
by notro » Sun Aug 11, 2013 10:25 pm
Posts: 506
Joined: Tue Oct 16, 2012 6:21 pm
Location: Norway
by chou.aieb » Thu Sep 05, 2013 10:13 am
i got this 2.8" 18-bit color TFT LCD with touchscreen breakout board - ILI9325 from adafruit
here is a link for it :http://www.adafruit.com/products/335
its needs 8 pins for data i/o , 4 for the control input,4 for the touch panel plus the leds and back light.
any ways i'm wondering if any one have an idea on how to wire this display with a raspberry pi model B.
do i wire it to pins of my choice and when loading the module for it assign each db and control pin to the one i've chosen ? or there is a default wiring that needs to be done ?
here is two photos of the display pins:
Image
Image
thank you in advance
Posts: 2
Joined: Thu Sep 05, 2013 10:08 am
by Gary Littlemore » Fri Sep 06, 2013 12:33 pm
Would I be able to get this working with RaspBMC? If so, how easy would it be?
Posts: 144
Joined: Thu Oct 11, 2012 11:52 am
Location: Cheshire, UK
by bmichel » Thu Apr 24, 2014 6:56 pm
Hello,

The LCD works fine with the adapter kit and notro's driver. However the touchscreen SPI isn't correctly connected. I needed to make some changes in order to make it work:
- Connect ITDB02 pin RST to Raspberry pin 8 (GPIO14) instead of pin 26 (GPIO7/CE1)
- Connect ITDB02 pin T_CLK to Raspberry pin 23 (SCLK) instead of pin 19
- Connect ITDB02 pin T_CS to Raspberry pin 26 (CE1) instead of pin 21
- Connect ITDB02 pin T_DIN to Raspberry pin 19 (MOSI) instead of pin 23
- Connect ITDB02 pin T_DOUT to Raspberry pin 21 (MISO) instead of pin 8

I didn't try to do the modifications on the adapter yet, I just did the connections with wires.

Then the configuration of the drivers is:
Code: Select all
fbtft_device name=itdb28 gpios=reset:14,dc:2,wr:3,cs:8,db00:17,db01:18,db02:27,db03:22,db04:23,db05:24,db06:25,db07:4 rotate=90
ads7846_device cs=1 speed=2000000 model=7846 swap_xy=1 x_min=230 x_max=3900 y_min=200 y_max=3700 x_plate_ohms=80 pressure_max=255 gpio_pendown=15 keep_vref_on=1 verbose=3

PS: I have a Raspberry version B rev 2.
Posts: 1
Joined: Thu Apr 17, 2014 10:08 pm