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

LED/LCD TFT Screen

TFT Screen

  • Please log in to reply
14 replies to this topic

#1 studlyed

studlyed

    New Member

  • Members
  • Pip
  • 8 posts

Posted 25 December 2014 - 11:12 PM

Is there any known working TFT screens for the netduino? I've been searching but am not finding anything other than an Adafruit one that people can't seem to get working.

 

I currently have a Seeed Studio 2.8" TFT v2.1 screen that I picked up from Radio Shack for about 10 bucks the other day during a "closing sale" where everything was on sale. :)

 

I've tried taking their drivers from their git hub site and porting it to C#, but it does not display anything (other than the backlight). I can't even tell if it's actually doing anything. I ported it as if it was going to run on a LINKIT device as that looked the closest to the .net micro framework.



#2 studlyed

studlyed

    New Member

  • Members
  • Pip
  • 8 posts

Posted 09 January 2015 - 03:32 AM

I finally got the Seeed Studio lcd to work, I'm cleaning up the driver a lot (basically a rewrite of it) and once that's done I'll be posting it. Performance increases, breaking pieces out, making it more modular etc.

It's only a display driver so far though, no touch input yet. That'll be coming soon.



#3 studlyed

studlyed

    New Member

  • Members
  • Pip
  • 8 posts

Posted 21 January 2015 - 05:39 AM

Here's a link to the driver that I've created on git hub.

 

https://github.com/v...Drivers.Ili9341

 

I've been testing this on my Seeed Studio lcd, would be cool to see if it would work on others as well.



#4 asciiman

asciiman

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts
  • LocationTurkey

Posted 21 January 2015 - 07:59 PM

hi sir 

 
i am waiting long time for this.
 
thanks so much..!
 
my lcd is 
 
it dont have touching  and i dont need :)
 
But can we use Netduino Helpers Font ?


#5 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 26 January 2015 - 02:20 PM

Here's a link to the driver that I've created on git hub.

 

https://github.com/v...Drivers.Ili9341

 

I've been testing this on my Seeed Studio lcd, would be cool to see if it would work on others as well.

hi Sir,

I tested your driver and is working fast.

Thx for you project



#6 studlyed

studlyed

    New Member

  • Members
  • Pip
  • 8 posts

Posted 06 February 2015 - 05:13 AM

I just added support for the netduino helper fonts. I also included the fonts in the driver so you don't have to reference the helpers library if you don't want to.

 

To use the helper fonts in the driver:

                var font = new NetduinoHelpersFont(VerdanaBold14.Bitmaps,
                                                   VerdanaBold14.Descriptors,
                                                   VerdanaBold14.Height,
                                                   VerdanaBold14.FontSpace);
                tft.DrawString(10, 10, "Current Temperature", 0xF800, font);

To use the fonts in the helpers library, you would need to get to the bitmaps and descriptors in the font, as well as the height. The FontSpace didn't exist in their libraries, so you need to find one that works for you, I went through them and 2 pixels personally looked the best for them, except the fixed width ones, it was best with 0.

 

Let me know if you need help with it or if there is anything else you would like to have added to it and I will look at what it would take.



#7 asciiman

asciiman

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts
  • LocationTurkey

Posted 06 February 2015 - 08:51 AM

hi sir

I write this code for using HelpersFont. I completed a few days ago.

    public class BitmapCharacter
    {
        public byte Width;          // Columns
        public byte Height;         // Rows
        public ushort[] Pixels;     // Includes color data
    }

    public class FontBase
    {

        public static BitmapCharacter getBitmapCharacter(char pChar, ushort pColor, ushort pTransparentColor, byte pFontHeight, ref ushort[] pFontMap, ref byte[] pFontBitmap)
        {
            byte xFontMapIndex = (byte)(pChar - 32);
            ushort xFontBitmapIndex = pFontMap[xFontMapIndex * 2 + 1];

            byte xCharWidthPixel = (byte)(pFontMap[xFontMapIndex * 2]);  // Bit or Pixel
            byte xColumnByteCount = (byte)(xCharWidthPixel / 8 + (xCharWidthPixel % 8 == 0 ? 0 : 1));

            var xPixelArray = new System.Collections.ArrayList();
            for (byte yIndex = 0; yIndex < pFontHeight; yIndex++)
            {
                UInt64 tmpInt64 = 0;    // RowCount = FontHeight, ColumnCount = CharWidthPixel (64 Max)
                for (byte xIndex = 0; xIndex < xColumnByteCount; xIndex++)
                    tmpInt64 = tmpInt64 << 8 | pFontBitmap[xFontBitmapIndex + yIndex * xColumnByteCount + xIndex];

                for (int xColumnIndex = 0; xColumnIndex < xCharWidthPixel; xColumnIndex++)
                {
                    byte xShiftCount = (byte)(xColumnByteCount * 8 - xColumnIndex - 1);

                    if (((tmpInt64 >> xShiftCount) & 1) == 1)
                        xPixelArray.Add(pColor);
                    else
                        xPixelArray.Add(pTransparentColor);
                }
            }

            var xBitmapCharacter = new BitmapCharacter()
                {
                    Width = xCharWidthPixel,
                    Height = pFontHeight,
                    Pixels = (ushort[])xPixelArray.ToArray(typeof(ushort))
                };

            return xBitmapCharacter;
        }

    }

I am using helpers font because i cant use any other font. For example created by TinyFontToolGUI.exe

pls look at this

 

https://learn.adafru...itmap-plus-text

 

 

Every think is lastes..!
 
Netduino is Netduino +2
Firmware is v4.3.1.0
Netduino SDK is v4.3.1.0
Framework is v4.3.1.0(QFE2)
Visual Studio is v2013 ...!

 

but i cant use it.

 

I have two problem with helpersfont

  1) I cant find larger font than Verdana14  ( or any font like helpersfont)

  2) I cant write transparent font for example over any image.

 

I will upload video today for problems..!

My english is not good sorry..!


Edited by asciiman, 08 February 2015 - 08:03 AM.


#8 studlyed

studlyed

    New Member

  • Members
  • Pip
  • 8 posts

Posted 06 February 2015 - 04:19 PM

I reversed the order of the bits for the character row so that it now makes it a bit easier to manually write out fonts.So if that was written for the old drawcharacter method, each character will be backwards. I'll take a look at the tool and your code in a little bit and check it out.

Transparency doesn't exist with the ILI9341. When writing a buffer you write the color of the pixel, there is no "transparent" color.



#9 studlyed

studlyed

    New Member

  • Members
  • Pip
  • 8 posts

Posted 08 February 2015 - 02:02 AM

Using the tool in your link, it exports out a TinyFont file. I have written a font class that can read in that file. Using that tool and class, you should be able to create any sized font you want, as long as it fits in memory. I have found some weirdness with what it outputs though, sometimes, depending on the font, the left or right margin has a padding of 253 pixels. So I had to work around that by putting in a "max margin" amount. It needs some optimizing work before I get the code up into the git repository (currently it goes through 2 conversions, 1 into the HelpersFont, then another into the font the driver uses). I'll let you know when I get it done and pushed into the git repository.

 

On a side note, that tool is pretty awesome, being able to take any font and build something the .net framework can use easily is completely awesome. But I did find a bug, in order to use the file spit out by the current version of that program, be sure to put a ` in the "These" box, otherwise you will be missing the ` character and the letters will be off by one. For example, you want it to print out "hello". You would get "ifmmp" (all letters slid over by one).



#10 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 04 May 2015 - 04:38 PM

Hi Studlyed,
i am some local modifications on my side.

- modified FontHelper class Used enum FontNames insted variables.

 

If you wish i can send it tou You.

 

Best regards

AB
 



#11 Rudolf

Rudolf

    New Member

  • Members
  • Pip
  • 4 posts

Posted 12 July 2015 - 03:08 PM

Hi community,

 

can anyone explain, how I have to connect the display? With the Arduino I use following wiring

1.VCC               3.3 V
2.GND               GND
3.CS                  D5
4.Reset              D6
5.DC / RS          D7
6.MOSI              D11
7.SCK                D13
8.LED                3.3V
9.MISO              D12

with a CD4050     (Source)

but I don't get it running with the Netduino 2.

 

 

 

Soucecode :

using Vecc.Netduino.Drivers.Ili9341;
...
...
...

public static void Main()
{
    var tft = new Driver(isLandscape: true,
                         lcdChipSelectPin: Pins.GPIO_PIN_D5,
                         dataCommandPin: Pins.GPIO_PIN_D7,
                         resetPin: Pins.GPIO_PIN_D6); 
    var font = new StandardFixedWidthFont();
    tft.ClearScreen();
    tft.DrawString(10, 10, "Hello world!", 0xF800, font);
    tft.BacklightOn = true;
}

can someone help me please

Thanks and Greetings



#12 asciiman

asciiman

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts
  • LocationTurkey

Posted 13 July 2015 - 06:32 AM

hi
vecc solution code is working perfect. 
 
i remember Power pin is 5v, and backligth pin is 3.3v
you need power and backlight voltage


#13 Rudolf

Rudolf

    New Member

  • Members
  • Pip
  • 4 posts

Posted 13 July 2015 - 08:00 AM

hi,

 

thanks, but what about the other wires? where do I connect the other cabels (CS, RESET, D/C, SDI, SCK, SDO). I also found an example where RESET and D/C is connectet to the Analog Ports.

 

other example:

VCC to 3.3v
GND power ground.
CS to D10
RESET to A1
D/c to A2

SDI to D11 (Mosi)
SCK to D13 (spck)

 

This is confusing.

 

what is the right wiring with an Netduino and this display to use with vecc Libs?

Do i need the CD4050 Hex Buffer/ Converter like for Arduino?



#14 asciiman

asciiman

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts
  • LocationTurkey

Posted 13 July 2015 - 01:14 PM

hi

dont use CD4050.

 

 The display interface is serial, it just needs 5 wires (CS, DC, SCK, RST, SDI) for controlling.

 LCD_CS -- ChipSelect any Digital Pin
 LCD_DC -- Data/Command any Digital Pin
 LCD_SCK -- SPCK-D13
 LCD_Reset -- Reset any Digital Pin
 LCD_SDI(MOSI) -- SDI/SDA (Serial Data Input)  MOSI-D11
 LCD_SDO(MISO) -- SDO/SDA (Serial Data Output) MISO-D12 for SDCard
 LCD_Led -- any Digital Pin Or any PWM Pin Or 3.3V maximum Power Supply Pin
 
 but i am not sure Vcc is 5v.  You must try 3.3v first
 
U can use Analog pin like Digital PIN


#15 Rudolf

Rudolf

    New Member

  • Members
  • Pip
  • 4 posts

Posted 13 July 2015 - 06:55 PM

asciiman,

 

you are my hero, dude, big thanks its working now.

 

thank you very much!!!!!!!






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.