Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Need help with TFT display and SPI


  • Please log in to reply
8 replies to this topic

#1 netiness

netiness

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationNorway

Posted 17 October 2013 - 06:29 PM

Still learning but boy is this fun. A big thanks to the people at Secret Labs !! 

 

I have a TFT display like this one

http://www.elecfreak...#External_Links

 

I have connected it with SCK on D13,MOSI on D11, CS on D10, reset on A1, D/C on A2.

 

I have converted the source from the above link to C# and have no problem setting pixels on the display. Really slooow, but it works. Now, I would like to try using SPI to speed things up, but have run into some problems.

This is how I have found the SPI should be initialized :

Device1 = new SPI.Configuration(       Pins.GPIO_PIN_D10, // CS-pin       false,             // CS-pin active state       0,                 // The setup time for the SS port        0,                 // The hold time for the SS port       true,              // The idle state of the clock       false,             // The sampling clock edge       1000,              // The SPI clock rate in KHz        SPI_Devices.SPI1   // The used SPI bus (refers to a MOSI MISO and SCLK pinset)   );                SPIBus = new SPI(Device1);

I use the following for sending data/commands to the display. Note that if I set UseSPI=false everything works as expected

 void LCD_Write_Bus(byte data)        {            if (UseSPI)            {                SPIBus.Write(new byte[] { data });            }            else            {                P_CS.Write(false);                for (byte c = 0; c < 8; c++)                {                    P_MOSI.Write((data & 0x80) != 0);                    data = (byte)(data << 1);                    P_SCK.Write(false);                    P_SCK.Write(true);                }                P_CS.Write(true);            }        }        void LCD_Write_COM(byte VL)        {            P_DC.Write(false);            LCD_Write_Bus(VL);        }        void LCD_Write_DATA(byte VL)        {            P_DC.Write(true);            LCD_Write_Bus(VL);        }

Anyone experience who can point me in the right direction ?

 

Kjetil



#2 netiness

netiness

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationNorway

Posted 17 October 2013 - 07:40 PM

Oh well, I figured it out. The configuration was not correct. The Idle state of clock should be false, and the sampling clock edge should be true.

 

Still a bit too slow, but faster; I am not able to push the clock rate above 1.3 Mhz



#3 netiness

netiness

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationNorway

Posted 24 October 2013 - 05:26 PM

Are there anyone else using this kind of display (ILI9341) via SPI ? What clock rates can you use at maximum ? With my current configuration I cannot go above 1311Khz, making the display really slow. I don't have a real understanding of the various initialization parameters for the display, but has hacked together what information I've found on the net. A sample naive project can be found at http://code.google.c...tduino-spi-tft/. The NP2 should be able to pump out data faster than this, right ? Any suggestions are welcome.

 

Thanks,

 

Kjetil



#4 pmc

pmc

    New Member

  • Members
  • Pip
  • 2 posts

Posted 26 October 2013 - 04:01 PM

I'm using the DisplayTech STD028ATFT (ILI9341) on the STM and it's pretty fast. Here are my low-level routines if that can help.

 

Attached Files

  • Attached File  tft.zip   4.83KB   41 downloads


#5 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 13 December 2013 - 07:00 AM

I'm using the DisplayTech STD028ATFT (ILI9341) on the STM and it's pretty fast. Here are my low-level routines if that can help.

Coll, but i havent tested it..its not in C#  its in C...is anybody to rewrite it to c# ?



#6 asciiman

asciiman

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts
  • LocationTurkey

Posted 29 April 2014 - 06:36 AM

yes

 

me to need C# code 



#7 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 29 April 2014 - 06:45 AM

I can place here me working example code if you wish...if you help me how to add file to new topic :-).



#8 asciiman

asciiman

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts
  • LocationTurkey

Posted 29 April 2014 - 06:53 AM

hi sir

 

Start new topic and press choose files button bottom of editor

 

or

 

press "more reply options" near the post button

 

you can see attachment button



#9 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 03 May 2014 - 08:55 AM

http://forums.netdui...ft-lcd-ili9341/






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.