You are here

SPI TFT Color LCD240x320 +SD | Cypress Semiconductor

SPI TFT Color LCD240x320 +SD

Summary: 25 Replies, Latest post by Sakis Goumenidis on 10 Jan 2016 08:44 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
user_49271930's picture
User
493 posts

greetings to all. I tried to make friends with         2.2" Serial SPI TFT Color LCD +SD

Progect arhive:     TFT240_320_SD.zip 

Source projects:
Library for TFT displays on the controller ILI9341
PSoC 4 Pioneer Kit Community Project#050 – SD Card Example   
Project is test and has many problems:
The main problem - the absence of the component datasheet to SDCard.
So reading from SD only by byte.
SPI - also only by byte.
So everything happens very slowly.
and project has 26 warning.
 

user_14586677's picture
User
7645 posts

I used the SDCARD project, I think it was originally done under Creator

2.2. That being said project worked, and I started (did not finish) fixing

the warnings, they are largely type based warnings.

 

The release notes for Creator discuss a large change in libraries and compiler

versions.

 

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}

http://www.cypress.com/?docID=46925

 

Regards, Dana.

dvorakvik's picture
User
110 posts

 Hi, 

I have cleaned the SDcard code. The pinout for this example is for PSoC4 / W5100 / SDcard. Tested and OK. Warnings about unused variable are unimportant.

Regards,

Viktor

 

dvorakvik's picture
User
110 posts

Hi,

sorry - Chrome uploading problem. File uploaded again.

Regards,

Viktor

 

user_49271930's picture
User
493 posts

Thanks,dvorakvik. All OK.
Redid  load images from SD_card. Time to fill the screen for about 4 seconds.
Project Archive:        TFT240x320_ECG_Simulator.zip
Files for SD_card:    SD_Files

ender11's picture
User
44 posts

now I have this LCD. I played with your project, and redid output functions in tft.c:

void TFT_SendCMD(uint8_t cmd)
{ D_C_Write(0);
while(!((SPIM_ReadTxStatus() & (1 << 2)) == (1 << 2)));
SPIM_WriteTxData(cmd);
}
//*************************************************************************************
void TFT_WriteData(uint8_t Data)
{ D_C_Write(1);
while(!((SPIM_ReadTxStatus() & (1 << 2)) == (1 << 2)));
SPIM_WriteTxData(Data);
}
 

then I set SPI data rate to 15Mbps, and it now it works a little faster :)

Sakis Goumenidis's picture
User
1 post

Hello

This is my first post.

First of all sorry for my bad English.

 

ender11 I have made the changes in tft.c but I can not go over 5Mbps.

Can you please share a simple working project?

 

Thank you

 

edit:

I found the solution.

I have:

1)Set all pins as Strong Drive as Kabron suggested.
2)Used an external clock. HFCLK 48Mhz !!!

3)Set buffer sizes to 4

user_49271930's picture
User
493 posts

Obviously this is a test SPIM_STS_TX_FIFO_NOT_FULL :

while(!((SPIM_ReadTxStatus() & SPIM_STS_TX_FIFO_NOT_FULL) == SPIM_STS_TX_FIFO_NOT_FULL));

Спасибо.

 

 

 

 

user_11721473's picture
User
63 posts

 SPI speed could be increased to 12MHz(PSoC4 limitation) by drivind all pins as Strong Drive.

Note! It works only with 3.3V control signals. 

 

PS On PSoC 5 SPI clock may be even 32MHz.

user_14586677's picture
User
7645 posts

Kabron, thread is 6 months old, quite possibly no one

looking at it anymore.

 

Regards, Dana.

ender11's picture
User
44 posts

what do you mean? 

Log in to post new comments.