|
Post by selcuk06 on Nov 20, 2017 22:27:56 GMT -8
Hello, I’ve been following this forum from the beginning of the first gameduino product. It has been a great support since most of the problems I encountered with Gameduino2 were already faced and solved here. Recently I moved to 7 inch FT813 displays from Riverdi because I needed larger monitors and more memory for images loaded from sd card. Riverdi comes with an arduino TFT shield option . This shield has Arduino UNO compatible pins and a SD card reader which uses SDA, SCL pins of Arduino UNO. I downloaded and used modified GD3 libraries from links provided in this forum. I programmed an Arduino UNO board with a sketch which uses PNG images from SD card. Then I seperated Riverdi TFT shield from the board and used 4 inch jumper cables to see which pins were used by Riverdi Shield. I found out that I need 10 pins in total for power and data; 5V (for backlight) 3.3V (for FT813 MCU) GND PIN 10 CS PIN 11 MOSI PIN 12 MISO PIN 13 SCK A5 or SDA (for SD-Card) A4 or SCL (for SD-Card) 5 SD-CS I was looking for a faster way communicating with outer systems so I decided to use a teensy 3.2, I used all the same pins as used in Arduino UNO. Nothing happened. I believe the problem is with the SD card connection pins. When I remove them I can work with simpler sketches which dont use SD card. My initial dream was to use a teensy 3.6 board which has a much faster sd-card access with SDIO interface. This seems to be a harder goal to achieve. At the moment I would really like to have your opinion to make my teensy 3.2 work with riverdi TFT shields Sd card. Thank you.
|
|
|
Post by rayman on Nov 21, 2017 7:06:06 GMT -8
look GD3/transports/wiring.h and set the cs pin correct ... look GD3/GD3.h and set #define MCU_Teensy3X and define FT_813_ENABLE correct
|
|
|
Post by rayman on Nov 21, 2017 7:07:12 GMT -8
look GD3/GD3.cpp and set define SD_PIN and define BOARD_FTDI_81X ...
|
|
|
Post by selcuk06 on Nov 21, 2017 22:03:36 GMT -8
Hello rayman,
Thank you for the reply. I've just had a chance to check the files you wrote about.
in wiring.h -> CS pin is defines by #define CS 10 Do I need to change this to something else? If I change it does the screen keep working with the current cabling I wrote above? (currently CS pin is connected to PIN 10 on teensy 3.2)
in GD3.h -> #define MCU_Teensy32 1 #define FT_813_ENABLE 1 Lines currenty exist. I think I am not changing them too.
in GD3.cpp #define SD_PIN 5 #define BOARD 1 // board, from above #define STORAGE 1 // Want SD storage? Lines exist too..
I was wondering if my problem was with the cabling. In some websites I saw that both the screen and the SD card was connected to the same MISO MOSI lines. But they were using a different/simpler SD card breakout board. Or is the problem caused by Riverdi TFT board I don't know. I am still not able to use my Teensy 3.2 + FT813x + Riverdi TFT board with SD card combo.
If anybody has a similar working setup, please can you please send me links of your GD3 library files? Maybe I messed up mine while trying to find a solution.
Thank you.
|
|
|
Post by rayman on Nov 21, 2017 22:53:40 GMT -8
|
|
|
Post by selcuk06 on Nov 22, 2017 0:14:28 GMT -8
Hımm. GD3_HOTMCU library seems interesting. It has many teensy lines in it . Let me give it a try. I will return to you shortly. By the way, I also have a Riverdi Break Out Board 20 . This does not have a on board sd card reader. What are you using for sd card connection? Thanks
|
|
|
Post by selcuk06 on Nov 22, 2017 22:33:06 GMT -8
Hello rayman, This library from lightcalamar is definitely better than mine. I switched to a teensy 3.6 + riverdi breakout board 20 combo since this was my dream choice from the beginning. I used a basic cabling and get the 5V backlight power from an external source. I thought teensy 3.6 may not be able to handle that at the moment. Anyways there is an example file in this library named "GD3_Teensy36_CardInfo_test" this compiled without a problem. Program uses a "chipSelect = BUILTIN_SDCARD" definition to use the sd card. I didn't touched them. There was also some image and asset files needed , so I copied them to sd card too. When the program runs it does not actually show any images (which is a problem still) but at least it can communicate with sd and retrieve some basic ID information. Then this info is display on the 800x480 7 inch display. Program also gets the list of contents in the root directory of the sd card and displays names of all the files from serial output (which is my terminal software here).This is a great step forward for me. I've never managed to make sd card and screen work at the same time before. Thanks to you library was a great help. I now believe with some minor tweaking I will be able to display an image read from sd card. Will keep forum updated when I do that Have a nice day.
|
|
|
Post by selcuk06 on Nov 23, 2017 9:13:00 GMT -8
I spend a lot of time today to understand why I can't get my teensy 3.6 and riverdi breakout board 20 combo to display images from sd card. Example codes can read file names from sd card and can write those information on my FT813 display. Somehow GD.xxx like functions to load images or assets don't work. Problem must be in my configuration files. Also there's a problem I can not understand. We define SD_PIN as 5 in GD3.cpp . Is that wrong? If it is not where am I supposed to connect this SD_PIN? Writing here BUILTIN_SDCARD did not solve the problem either. If only there was a step by step site for this to work Any help is greatly appreciated . Thank you guys.
|
|
|
Post by rayman on Nov 23, 2017 10:19:42 GMT -8
show your image which you want to load and your code
|
|
|
Post by tftlcdcyg on Nov 23, 2017 10:36:21 GMT -8
Hi. That example is a first attempt in order to work with de SDIO reader and SD library, sorry for my mistake, is it a work in progress Setup: Teensy 3.6 + Riverdi TFT FT813 5" + Riverdi breakout-20
|
|
|
Post by rayman on Nov 23, 2017 11:01:41 GMT -8
what ?!? ... test with a short test-sketch is a good choise ... ... ... ... void setup() { ... GD.cmd_loadimage(0, 0); GD.load("test.jpg"); GD.Clear(); GD.Begin(BITMAPS); GD.Vertex2ii(0,0); GD.swap(); } ... ... ...
note the maximum image size !!! see --> gameduino2.proboards.com/post/121/thread
|
|
|
Post by selcuk06 on Nov 23, 2017 23:37:33 GMT -8
Hello tftlcdcyg, I see we are on the same page here. Code works similarly on my hardware too. But I can't make it load from SD card. The problem must be in my library file settings. As rayman told I tried to work with shorter sketches too. But GD.cmd_loadimage; or GD.load("test.jpg"); like commands causes program to stop responding . Rayman to you have the same hardware working? "GD3_Teensy36_CardInfo_test" sketch can access to SD card. Somehow GD.xxx image related commands don't. Still working on it Here is the simple sketch; #include <SPI.h> #include <SD.h> #include <GD3.h> Sd2Card card; SdVolume volume; File root; const int chipSelect = BUILTIN_SDCARD; void setup() { GD.begin(); GD.cmd_loadimage(0, 0); GD.load("01.png"); GD.Clear(); GD.Begin(BITMAPS); GD.Vertex2ii(0,0); GD.ColorRGB(0xff8000); GD.cmd_text(240, 120, 31, OPT_CENTERX, "End of program..."); GD.swap(); } void loop() { // put your main code here, to run repeatedly: }
|
|
|
Post by rayman on Nov 24, 2017 4:43:46 GMT -8
give us your 01.png
|
|
|
Post by selcuk06 on Nov 24, 2017 5:51:33 GMT -8
Hello rayman, My problem was not with the image files. As I wrote in my first message I was already using these image files with Arduino Uno and Riverdi TFT Shield. Anyway I did some forum searching today. In forum.arduino.cc/index.php?topic=419836.90 site I found some information about my Teensy 3.6 and SDIO problem. In that forum user TFTLCDCyg wrote about a different GD3SDIO library to use with Teensy 3.6 . I downloaded the library. And used a sample sketch he provided there. It was a tachometer sketch which exactly uses my configuration; A teensy 3.6 board with SD card + Riverdi Breakout Board 20 + FT813 7 inch display. It uses a sdfat library different than my current GD3 library. It worked flawlessly. I will try to make this work with my previous ino files at the weekend. I would like to thank you for taking your time trying to help me. Have a nice weekend.
|
|
|
Post by rayman on Nov 24, 2017 5:56:47 GMT -8
it would be nice if you add your libs (gd3 and sdfat) as zip on this thread, then following generations have a problem less
|
|