Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: Need help with FT800 using Gameduino 2 libraries on Teensy 3.6

  1. #1
    Member
    Join Date
    Sep 2015
    Location
    Los Angeles Metro Area
    Posts
    24

    Need help with FT800 using Gameduino 2 libraries on Teensy 3.6

    I'm having some trouble getting the Haoyu FT800 based displays to work with the Teensy 3.6. I'm using the Gameduino 2 libraries with pretty much the same pin connections as they set up for the Arduino, but I just can't get it to do anything at all. I have tested the display on the Arduino and it does seem to work.
    Has anybody had any success with this display?
    http://www.hotmcu.com/43-graphical-l...tml?cPath=6_16

  2. #2
    Senior Member
    Join Date
    Oct 2013
    Posts
    252
    Here is something to try:


    you must set the value in the GD2.ccp file (Line 6):
    #define PROTO 1 -> #define PROTO 0

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,785
    Are you feeding it 5v power or 3.3v? If you are feeding it 5v power, you may need to use level shifters to convert the SPI pins (SCLK = 13, MISO = 12, MISO = 11, CS = whatever) from 3.3v to 5v.

  4. #4
    Member
    Join Date
    Sep 2015
    Location
    Los Angeles Metro Area
    Posts
    24
    Quote Originally Posted by MichaelMeissner View Post
    Are you feeding it 5v power or 3.3v? If you are feeding it 5v power, you may need to use level shifters to convert the SPI pins (SCLK = 13, MISO = 12, MISO = 11, CS = whatever) from 3.3v to 5v.
    Their connector only has a pin for DC-5V, but they are using an XC6209 to regulate it down to 3.3V for everything that needs that, while still having 5V to power the LCD backlight. I grabbed 5V from VUSB, I think.

    I was thinking that, since the FT800 is a 3.3V part that I wouldn't need to do any level conversion. But, I notice that their schematic is using 74LCX125 quad buffers to make their device 5V tolerant. Looking at the datasheet VIH and VIL suggests to me that it should still work with 3.3v inputs, but I'm a bit inexperienced in such things, so perhaps I am reading it wrong?

    I also notice that they are using 47K pull up and pull down resistors on certain pins, but those are after the quad buffer level shifters, and IIRC 47k is consistent with 3.3v operation.

    So, I guess my answer is "I don't think I need that, and I'm not sure how to test whether I do."

  5. #5
    Senior Member
    Join Date
    Oct 2013
    Posts
    252
    #include <EEPROM.h>
    #include <SPI.h>
    #include <GD2.h>

    void setup()
    {
    pinMode(4, OUTPUT); // FT800 Power Down (reset) input


    digitalWrite(4, HIGH); // Set PD# high to start
    delay(20);
    SPI.setMOSI(7); // Audio shield has MOSI on pin 7
    SPI.setSCK(14); // Audio shield has SCK on pin 14
    GD.begin();
    }

    void loop()
    {
    GD.Clear();
    GD.Begin(POINTS);
    for (int i = 0; i < 100; i++) {
    GD.PointSize(GD.random(16 * 50));
    GD.ColorRGB(GD.random(256),
    GD.random(256),
    GD.random(256));
    GD.ColorA(GD.random(256));
    GD.Vertex2ii(GD.random(480), GD.random(272));
    }
    GD.swap();
    }I had this code running on that display two years ago, dropped it because I could not get touch input to work. You must also #define PROTO 0 .

  6. #6
    Senior Member
    Join Date
    Mar 2013
    Posts
    643
    My understanding is there is a GD3 library that supports Teensy 3.
    Gameduino 2 library modified for FT81X screens

    Ive actually got 2 of the 5" Hotmcu FT810's on the way, hopefully next week I can give one a spin.

  7. #7
    Senior Member
    Join Date
    Mar 2013
    Posts
    643
    I spent a few hours playing with the HotMCU FT811's I bought a few months back and got one running on a T3.1.

    Code:
    //#include <EEPROM.h>
    #include <SPI.h>
    #include <GD2.h>
    #define PDNPin 8
    void setup()
    {
    
    pinMode(PDNPin, OUTPUT);
    digitalWrite(PDNPin, HIGH);
    
    delay(20);
    digitalWrite(PDNPin, LOW);
    delay(20);
    digitalWrite(PDNPin, HIGH);
    delay(20);
    GD.begin(0);
    }
    
    
    void loop()
    {
    
    GD.ClearColorRGB(0x000000);
    GD.Clear();
    GD.cmd_text(GD.w / 2, GD.h / 2, 31, OPT_CENTER, "Hello world");
    GD.swap();
    delay(19);
    }
    It appears that Toggling the PD pin is needed most of the time to get things rolling. Also I placed a delay in the code after noticing that if you update close to or faster then 60Hz the code will pause and wait for the previous update to finish.

    They don't seem to like to wake up after flashing new code all the time so you tend to need to cycle power on the whole setup. Many of the examples require an SD card since they are created for the Gameduino hardware, without the SDcard the code just locks up when it gets to that point.

    Also depending on what hardware you have you may need a different version of the Gameduino library, there is a few versions in the wild for specific setups and the CS pin can be different from one version to another.

  8. #8
    Member
    Join Date
    Sep 2015
    Location
    Los Angeles Metro Area
    Posts
    24
    My GD2 library didn't have a GD.w or GD.h value, so I hardcoded 480 and 272 in respectively and got it to run.
    It displays "Hello world" and then a few seconds later the screen gets a strange grid on it and slowly turns white.

    I got my library from the excamera Gameduino 2 site at (http://excamera.com/sphinx/gameduino2/code.html). Where did you get yours?

  9. #9
    Senior Member
    Join Date
    Mar 2013
    Posts
    643
    The stock library should have that since that's where that example comes from. There are other libraries out there with optimizations for Teensy, but you can run several stock examples without the SD Card. Try changing GD.begin(); to 0 - 3. You may find one option works better then the rest or you can leave it blank and it will hopefully auto detect the hardware.

    Here is a link to where I got a GD library with several optimizations and some nice examples if you browse the entire thread. One thing to remember is the Teensy is much faster so you may have to add a delay in the loop to slow the Teensy down, the FT8 series are only good up to 60Hz. Any faster and you start getting odd behavior and flickering.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •