|
Post by TCB on Dec 5, 2014 13:56:13 GMT -8
Has anyone tried running the GD2 library on other FTDI boards?
I am trying make it work on their VM800C dev board.
So far I haven't had any luck...
James Bowman should package his board separately for developers!! It is much simpler to implement than the ones from FTDI.
|
|
|
Post by jamesbowman on Dec 5, 2014 18:25:58 GMT -8
Several people have said it works - if you change this line: github.com/jamesbowman/gd2-lib/blob/master/GD2.cpp#L8in the library so that PROTO is 0, and on the next line set STORAGE to 0, then it should work fine - apart from not having the SDcard/accelerometer function.
|
|
|
Post by TCB on Dec 7, 2014 11:16:59 GMT -8
Many thanks,
I'll let you know if it works for me.
Just out of curiosity, what are the PROTO and STORAGE definitions (Macros) affecting?
|
|
|
Post by jamesbowman on Dec 8, 2014 8:07:08 GMT -8
PROTO is the prototype mode - I originally developed the GD library on an FT800 eval board (PROTO=0) then modified it later for the Gameduino 2 hardware (PROTO=0).
STORAGE=0 switches off the SDcard initialization.
|
|
|
Post by TCB on Dec 8, 2014 11:28:16 GMT -8
Well, I made those changes, and I'm not getting any screen action. It's powering up, but won't display anything, so I assume the spi connection is not there. I suspect that there is a wiring/pinout issue.
In order to get the VM800C working on the arduino, I had to modify the FTDI FT_Platform.h file to switch the CS pin to 10...
But using the GD2 library, I'm assuming that the standard GD2 wiring should be correct...
|
|
|
Post by TCB on Dec 8, 2014 14:35:58 GMT -8
I got the screen working. But curiously, it is inverted - however, the touch tags are in the correct place??? So to press button you have to guess its mirror position?
|
|
|
Post by jamesbowman on Dec 9, 2014 7:06:24 GMT -8
Aha OK. The GD and the FT devices are the opposite way up, and the touch calibration needs to be redone when switching between the devices. There are two ways to fix this: (1) Set REG_ROTATE to invert the screen: github.com/jamesbowman/gd2-lib/blob/master/GD2.cpp#L99. (2) Re-run the "selftest" utility. It forces the touch re-calibration procedure so the screen will be calibrated for whichever orientation it currently has.
|
|
|
Post by TCB on Dec 9, 2014 17:28:38 GMT -8
OK, got all that working! Now I'm just trying to add an SD Card. I have an SD breakout on the spi bus running and reading files. I go through this normal sequence to load an image I've worked with before: The Serial.prints are for debugging.
It gets all the way to the GD.swap, and fails before it prints the "After GD.swap" debug line. And it sends a message to the Serial com that says "r=4095"
Does that message mean anything? I can't find any code in GD.cpp that looks like it would kick that back to me.
void setup() { Serial.begin(9600); Serial.println("Before GD.begin"); GD.begin(); Serial.println("After GD.begin"); //GD.cmd_calibrate(); Serial.println("After GD.cmd_calibrate"); GD.cmd_loadimage(0, 0); Serial.println("After GD.cmd_loadimage"); GD.load("hcsmall.jpg"); Serial.println("After GD.load"); }
void loop() { GD.Clear(); Serial.println("After GD.Clear"); GD.Begin(BITMAPS); Serial.println("After BITMAPS"); GD.Vertex2ii(45, 160); Serial.println("After GD.Vertex2ii"); GD.swap(); Serial.println("After GD.swap"); }
|
|
|
Post by TCB on Dec 9, 2014 17:32:15 GMT -8
So my Serial com output looks like: Before GD.begin After GD.begin After GD.cmd_calibrate After GD.cmd_loadimage After GD.load After GD.Clear After BITMAPS After GD.Vertex2ii r=4095
|
|
Pix-OS
Junior Member
Posts: 11
|
Post by Pix-OS on Jan 21, 2015 10:56:49 GMT -8
i got the same error in my serial monitor, nothing working after the GD.swap() difference is i'm using an original arduino uno with my gameduino 2.
any solutions?
EDIT: looked into the FT800 manual, and it seems the FT800 buffer (with a size of 0-4095) is overflowing(?), though i don't know why, i only wanted to let it add an background picture for the GUI of Pix-OS. so perhaps we can't have a background image in our OS, if this is confirmed, then a simple background color will have to do.
|
|
|
Post by jamesbowman on Jan 22, 2015 7:51:23 GMT -8
Calling GD.Begin() without the SDcard initialization will probably help. Also might as well tun off clock trimming since the FTDI board uses a crysytal:
GD.Begin(~(GD_STORAGE | GD_TRIM));
|
|
|
Post by TCB on Feb 11, 2015 11:53:38 GMT -8
I'm now getting the same error as above, using a GD2 board, with a 5.0" screen. No problem getting primitive, text, etc. to work, loading images from the SD seems to work (at least the code gets past it), but then it hangs on GD.swap().
Is there a limit on SD card size, or format? Or some other little detail that I may be missing here?
Thanks,
|
|
|
Post by TCB on Feb 11, 2015 20:15:25 GMT -8
Starting to get to the bottom of this one.
I had my SD card formatted as FAT32, rather than FAT. Also there is some jpeg format issue that isn't correct. Other images are now working.
|
|