Post by mali on Aug 6, 2023 6:24:27 GMT -8
Hi James and all the others
First of all a big thank you for the big effort with the Gameduino environment! After several attempts with much reading of articles in this board, I got the "HelloWorld" script working on an ESP32 microcontroller connected to a Gameduino 2.
I use the Arduino IDE 2.1.1 on a Mac and the Gameduino Library 1.3.4.
I wired it like this (currently without SD-card access and no accelerators):
Originally the ESP32 restarted endlessly as soon as the function GD.begin() was called. This seems to be due to hardcoded digital outputs in the file "wiring.h". In the class GDTransport the outputs in the function begin0() are set as follows:
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
Pin 9 is used for the chipselect for the SD card. Pin 10 does not seem to be used at least for the Gameduino Boards. (See excamera.com/sphinx/gameduino2/ and excamera.com/sphinx/gameduino3/index.html).
On the ESP32 these outputs are used for the integrated SPI Flash and cannot be used for custom applications (See randomnerdtutorials.com/esp32-pinout-reference-gpios/).
After I commented out the 4 lines in the file "wiring.h" I had to add the correct pins for the ESP32 for the chipselect in the function GD.begin() in "HelloWorld". And finally it works!
#define GPU_SELECT 12
#define SD_SELECT 13
void setup()
{
GD.begin(0, GPU_SELECT, SD_SELECT);
}
I would very appreciate if the hardcoded pin number would have been replaced so that the library can be used more flexible.
Further I noticed that the ZIP file contains the version designation 1.3.4 the file GD2.h the version 1.3.3 registered.
Best regards Martin
First of all a big thank you for the big effort with the Gameduino environment! After several attempts with much reading of articles in this board, I got the "HelloWorld" script working on an ESP32 microcontroller connected to a Gameduino 2.
I use the Arduino IDE 2.1.1 on a Mac and the Gameduino Library 1.3.4.
I wired it like this (currently without SD-card access and no accelerators):
Gameduino | ESP32 |
5V | 5V |
GND | GND |
SCK | D18 |
MISO | D19 |
MOSI | D23 |
GPU sel | D12 |
Originally the ESP32 restarted endlessly as soon as the function GD.begin() was called. This seems to be due to hardcoded digital outputs in the file "wiring.h". In the class GDTransport the outputs in the function begin0() are set as follows:
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
Pin 9 is used for the chipselect for the SD card. Pin 10 does not seem to be used at least for the Gameduino Boards. (See excamera.com/sphinx/gameduino2/ and excamera.com/sphinx/gameduino3/index.html).
On the ESP32 these outputs are used for the integrated SPI Flash and cannot be used for custom applications (See randomnerdtutorials.com/esp32-pinout-reference-gpios/).
After I commented out the 4 lines in the file "wiring.h" I had to add the correct pins for the ESP32 for the chipselect in the function GD.begin() in "HelloWorld". And finally it works!
#define GPU_SELECT 12
#define SD_SELECT 13
void setup()
{
GD.begin(0, GPU_SELECT, SD_SELECT);
}
I would very appreciate if the hardcoded pin number would have been replaced so that the library can be used more flexible.
Further I noticed that the ZIP file contains the version designation 1.3.4 the file GD2.h the version 1.3.3 registered.
Best regards Martin