CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

ili9341

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Zek_De



Joined: 13 Aug 2016
Posts: 100

View user's profile Send private message

ili9341
PostPosted: Wed Sep 05, 2018 2:11 am     Reply with quote

Hi friends, I have this ili9341 --> https://tr.aliexpress.com/item/3-2-inch-320x240-320-240-TFT-LCD-Module-Display-With-Touch-Screen-Controller-Panel-ILI9341/32912574891.html?spm=a2g10.search0104.3.162.3c741524sPg1ga&ws_ab_test=searchweb0_0,searchweb201602_3_10065_10068_10546_10059_10548_10696_100031_10084_5015115_10083_10103_451_10618_452_5015815_5015715_10307_5015015,searchweb201603_54,ppcSwitch_5&algo_expid=8eab7142-4a1b-433d-bf1a-3a76888d3a65-23&algo_pvid=8eab7142-4a1b-433d-bf1a-3a76888d3a65&transAbTest=ae803_2&priceBeautifyAB=0


and definitions are like that -->

#define TP_CLK_PORT GPIOE
#define TP_CLK_PIN T_CLK_Pin

#define TP_CS_PORT GPIOE
#define TP_CS_PIN T_CS_Pin

#define TP_MISO_PORT GPIOE
#define TP_MISO_PIN T_MISO_Pin

#define TP_MOSI_PORT GPIOE
#define TP_MOSI_PIN T_MOSI_Pin

#define TP_IRQ_PORT GPIOE
#define TP_IRQ_PIN T_IRQ_Pin


//CHIP SELECT PIN AND PORT, STANDARD GPIO
#define LCD_CS_PORT GPIOD
#define LCD_CS_PIN CS_Pin

//DATA COMMAND PIN AND PORT, STANDARD GPIO
#define LCD_DC_PORT GPIOD
#define LCD_DC_PIN DC_Pin

//RESET PIN AND PORT, STANDARD GPIO
#define LCD_RST_PORT GPIOD
#define LCD_RST_PIN RST_Pin

How can I match these pins with lcd
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 4:16 am     Reply with quote

You can't.
That is a parallel interface LCD, not an SPI LCD, which the defines you are showing are for.
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 5:18 am     Reply with quote

I got curious, waiting for the coffee to be made....so...
I downloaded the datasheet and it actually has an SPI interface! Pins 35-38 are the '3/4 wire' option. It's interesting that the module also has a memory card slot...
Provided it's configured correctly it should be possible to use the SPI interface. That would save a LOT of I/O pins !!
However it is a 3 volt device so it'd be best to use a 3 volt PIC to avoid having any 'logic level conversion' problems.
There are drivers written for other micros in other languages so they could be used as a 'template'. I didn't look very hard or long to see if there's an SPI (aka serial ) driver though. You'll need to read the datasheet to get the correct SPI mode and start small. Cut code to read/write a few registers, confirm that works THEN try simple text based display THEN graphics...

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 5:41 am     Reply with quote

Beware though that if it does have SPI, graphics could become quite slow by the time you have read a byte changed the bits required, and written this back for hundreds of bytes... Sad

Looking at it the marked SPI lines connect across directly to the SD card. I assumed these lines are actually the SD card interface not the display. They are labelled as SD_CS SD_DIN, SD_DO, and SD_CLK (note the SD...). The chipset supports an SPI interface, but requires jumpering to select this. I can't see any sign on the board that this option is actually selectable. I think it is wired as parallel only.


Last edited by Ttelmah on Wed Sep 05, 2018 6:44 am; edited 1 time in total
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 6:43 am     Reply with quote

It's kind of a shame to not bring out the SPI option..though there is a pin labelled f_cs, on the PCB but says N/C in the pinout chart.
sigh..could have saved a lot of I/O pins.
Really mfrs should supply ALL the data about their product
It'd be interesting to compare the parallel vs serial speeds since parallel requires 2 1/2 ports.

Jay
MikeW



Joined: 15 Sep 2003
Posts: 184
Location: Warrington UK

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 6:50 am     Reply with quote

this one has the SPI version.
Its a shame the module makers dont bring out the il94311 pins


https://www.aliexpress.com/store/product/3-2-inch-320-240-SPI-Serial-TFT-LCD-Module-Display-Screen-with-Touch-Panel-Driver/900905_32911859963.html?spm=2114.search0104.3.42.13d725faSzuoai&ws_ab_test=searchweb0_0,searchweb201602_1_5015211_10065_10068_10130_10547_10059_10548_10696_100031_10192_10190_10084_5015811_10083_10103_451_452_10618_5015111_10307_10820_10301_10821_10303_5015911,searchweb201603_2,ppcSwitch_7&algo_expid=14c18f96-d36f-42e3-ba19-9e0126e3cb92-5&algo_pvid=14c18f96-d36f-42e3-ba19-9e0126e3cb92&priceBeautifyAB=0
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 7:02 am     Reply with quote

With the SPI option available, makes more sense... Smile

That potentially could be connected to the driver involved.

I must admit it is fabulous value. Think what a display like that would have cost a few years ago....
MikeW



Joined: 15 Sep 2003
Posts: 184
Location: Warrington UK

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 9:34 am     Reply with quote

another one, and cheaper UK £10.26

https://www.banggood.com/3_5-LCD-Touch-Screen-Display-Module-Board-320x480-RGB-For-Raspberry-Pi-2-B-B-p-1145103.html?rmmds=cart_middle_products&cur_warehouse=CN
Zek_De



Joined: 13 Aug 2016
Posts: 100

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 12:17 pm     Reply with quote

Guys ,Thank all of you,I will examine,but there is a CS pin on it to select LCD,in this case I suppose ,SPI connect paralell with LCD and SD Card,right?
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 12:41 pm     Reply with quote

Not necessarily... the SPI SD card appears to be an 'addon' to the module... the touchpad also would be an 'addon' as it's not part of the LCD device itself.
The designer of the module may not have brought out the SPI pins for the LCD module, though maybe, just maybe the touchpad SPI pins are the same ?
The only one who KNOWS will be the mfr. try googling the 'part number' on the PCB, that may point to who made it and a proper datasheet.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 1:02 pm     Reply with quote

Some of the SPI signals are shared with the existing interface (just two extra
connections needed). The problem is there are four configuration pins that
have to have different logic levels on them to selet the interface to use. There
does not seem to be any option to jumper these to select the interface. So the
original module is parallel only. It is silly. Would have been very easy to just
have board pads that could be cut to allow the levels to be selected....
Zek_De



Joined: 13 Aug 2016
Posts: 100

View user's profile Send private message

PostPosted: Thu Sep 06, 2018 9:01 am     Reply with quote

Ok guys, also I will buy new one. I couldn't find any information about it. What I did it didn't work.
Zek_De



Joined: 13 Aug 2016
Posts: 100

View user's profile Send private message

PostPosted: Thu Sep 06, 2018 9:40 am     Reply with quote

Guys, how about these? They have different integrated circuit, I am sorry I have less information about LCDs, one has XPT2046, other one has I suppose different integrated circuit. There is an information about Spfd5408 ,what is it excatly, I examined datasheet, but very long maybe you guys mention about briefly. If I control these LCDs, I will follow same way or different solution. I am little confused.

--> https://tr.aliexpress.com/item/2-4-Inch-TFT-LCD-Shield-ILI9341-240x320-Touch-Board-65K-RGB-Color-Display-Module-With/32823261914.html?spm=a2g0s.13010208.99999999.259.777d3c00VXxLA3

-->https://tr.aliexpress.com/item/240x320-2-4-SPI-TFT-LCD-Touch-Panel-Serial-Port-Module-With-PBC-ILI9341-3-3V/32832952750.html?spm=a2g10.search0104.3.30.6abb15246oUtEn&ws_ab_test=searchweb0_0,searchweb201602_3_10065_10068_5015215_10059_5015315_10696_100031_10084_10083_10103_451_452_10618_10307_5015915_5016015-normal#cfs,searchweb201603_54,ppcSwitch_5&algo_expid=ba1a2b9b-189a-48ef-a4e6-60a9f045b301-4&algo_pvid=ba1a2b9b-189a-48ef-a4e6-60a9f045b301&transAbTest=ae803_2&priceBeautifyAB=0
Zek_De



Joined: 13 Aug 2016
Posts: 100

View user's profile Send private message

PostPosted: Thu Sep 06, 2018 9:55 am     Reply with quote

For example, I have two LCDs and one has xyz integrated circuit (to touch) and other one abc (to touch), in this case, can I control them with same way, I mean this integrated circuits always are similar, special for touch panel. Am I right? and also for this LCD --> https://tr.aliexpress.com/item/240x320-2-4-SPI-TFT-LCD-Touch-Panel-Serial-Port-Module-With-PBC-ILI9341-3-3V/32832952750.html?spm=a2g10.search0104.3.30.6abb15246oUtEn&ws_ab_test=searchweb0_0,searchweb201602_3_10065_10068_5015215_10059_5015315_10696_100031_10084_10083_10103_451_452_10618_10307_5015915_5016015-normal#cfs,searchweb201603_54,ppcSwitch_5&algo_expid=ba1a2b9b-189a-48ef-a4e6-60a9f045b301-4&algo_pvid=ba1a2b9b-189a-48ef-a4e6-60a9f045b301&transAbTest=ae803_2&priceBeautifyAB=0

I couldn't find any integrated circuit for SD Card, is it embedded under the screen or it is not necessary to drive SD Card ? It will be my first experience with SD Card and LCD this why I am sorry guys, I asked a lot of question but it will be a lot of benefit for me.
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Sep 07, 2018 5:27 am     Reply with quote

Your last 'link', if you scroll down there's a good picture of the bottom that shows the SD interface is J4 located on the opposite end from teh main connector. So that module has 3 SPI interfaces, LCD, TPAD, SD card. So you'd need a PIC with 3 hardware SPI to get best performance. One alternate would be to have LCD and SD using HW SPI and connect TPAD to a SW SPI. Still a lot of pins to connect !
It would be nice to find a module with ALL the I/O pins on ONE connector.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group