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.

netiness

Member Since 21 Sep 2013
Offline Last Active Jul 02 2017 08:26 PM
-----

#57932 TFT LCD (ILI9341)

Posted by netiness on 04 May 2014 - 12:34 PM

Probably mine, from https://code.google....tduino-spi-tft/. And yes, a bit slow. I also collected info from various docs, good to see it can be used.

--Kjetil


#53244 Need help with TFT display and SPI

Posted by netiness on 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




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.