Bienvenido a los foros de FT81x Manía. Te invitamos a regístrate totalmente gratis. Disfruta de tu experiencia con un grandes amigos y Staff.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Thread Contributor: raufjayGD2UB with esp32

#1
0
I just got esp32 board. It is amazing. 
I wanted to have your idea about, can this GD2UB library be used for esp32 as well?
I have a project, considering ample io ports with a lot of communication peripherals built into esp32 module, I am thinking to use esp32 standalone with FT810 or FT811 with 4" LCD.
I tried it but it seems not compiling.

I get following error message:

Arduino: 1.8.4 (Windows 10), Board: "ESP32 Dev Module, QIO, 80MHz, 4MB (32Mb), 921600, None"


In file included from C:\Users\AbdulRauf\Documents\Arduino\LargerFonts\LargerFonts.ino:1:0:

C:\Rauf\development\Arduino\Arduino1.8.4\libraries\GD2UB/GD2UB.h:17:19: fatal error: SdFat.h: No such file or directory

compilation terminated.

exit status 1
Error compiling for board ESP32 Dev Module.

But when I select STM32F boards, that error disappears and program compiles normally.


Any ideas?

Thanks,

Rauf
Reply
#2
1
Better response on post RE: GD2UB with esp32You need to copy this libraries inside Arduino folder: C:\Users\(your user PC name\Documents\Arduino\libraries

SdFat
AT24Cxx
GD2UESP32 (GD2UB modified for ESP32 devices)

This is the first attempt with ESP32. Check the correct pins for POR-pin, SD card and TFT-CS inside of GD2UESP32.h
SdFat library is not necessary, but in this attempt must be included, in order to avoid some error.

ESP32 devices are new for me, and I not have any such board to experiment.

?mage

?mage

Enjoy it!

PD: The zip attached has the 3 libraries


Attached Files
.zip   ESP32.zip (Size: 328.22 KB / Downloads: 4)
Reply
#3
0
Thank you very much for helping me in this. I have downloaded the ESP32.zip and extracted it in the C:\Users\(your user PC name\Documents\Arduino\libraries.
After that code started compile without error. Just couple of warnings as usual.

The simple codes I tried and that works ok.

Then I used the following code but nothing is appearing on screen. That seems getting the system stuck. I have used smaller wires from ESP32 to FT811 LCD.

#include <GD2UESP32.h>

void setup()
{
 
 Serial.begin(115200);

 Serial.print("MISO = ");Serial.println(MISO);
 Serial.print("MOSI = ");Serial.println(MOSI);
 Serial.print("SCK = ");Serial.println(SCK);
 Serial.print("CS = ");Serial.println(SS);
 
  GD.begin();

 Serial.print("MISO = ");Serial.println(MISO);
 Serial.print("MOSI = ");Serial.println(MOSI);
 Serial.print("SCK = ");Serial.println(SCK);
 Serial.print("CS = ");Serial.println(SS);
}

void loop()
{
 GD.ClearColorRGB(0x000055);
 GD.Clear();
 GD.cmd_text(GD.w / 2, 100, 31, OPT_CENTER, "Font 31");

 GD.SaveContext();
    GD.cmd_romfont(15,32);   //Extra font 32 in image handle 15
    GD.ColorRGB(0xffff00);  
    GD.cmd_text(150, 150, 15, 0, "Font 32 inside handle 15");
    GD.cmd_number(20, 150, 15, 0, 32);

    GD.cmd_romfont(14,33);   //Extra font 33 in image handle 14
    GD.ColorRGB(0xffff00);  
    GD.cmd_text(150, 200, 14, 0, "Font 33 inside handle 14");
    GD.cmd_number(20, 200, 14, 0, 33);

    GD.cmd_romfont(13,34);   //Extra font 34 in image handle 13
    GD.ColorRGB(0xffff00);  
    GD.cmd_text(150, 270, 13, 0, "Font 34 inside handle 13");
    GD.cmd_number(20, 270, 13, 0, 34);    
 GD.RestoreContext();

   GD.Begin(POINTS);
   GD.PointSize(10*16);
   GD.Vertex2f(100*16,100*16);
 
 GD.swap();
}

When I run the code I get the following info on Serial monitor:

//SERIAL MONITOR OUPUT

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0010,len:4
load:0x3fff0014,len:956
load:0x40078000,len:0
load:0x40078000,len:11856
entry 0x40078a34
MISO = 19
MOSI = 23
SCK = 18
CS = 5

Please notice the last 4 lines, that is because I have used the following lines in my code:
Serial.print("MISO = ");Serial.println(MISO);
 Serial.print("MOSI = ");Serial.println(MOSI);
 Serial.print("SCK = ");Serial.println(SCK);
 Serial.print("CS = ");Serial.println(SS);

But the MISO=19 .......
should appear two times, one before GD.begin and second time after GD.begin. But it seems the 2nd time system gets stuck.

I have tried the following things:

In GD2UESP32.h I tried changing the followings:

I defined TFT_CS  21, then I tried with 5 also.
I defined POR_PIN 12, tried connecting the POR pin to ESP32 EN pin as well, which is Reset pin of ESP32. (I successfully used POR_PIN connected to bluepill rst pin.)
#define TFT_CS           5 //21  // PA4 at bluepill //PC5 //10 Riverdi-shield   8  gameduino2

#define SD_PIN           13  // PA15 at bluepill //PC5//PA4 // 5 Riverdi-shield   9  gameduino2


I tried changing the SPI frequency as follows:
#define FreqSDIO         (10500000) //21000000)  // (21000000)=21 MHz    (42000000)=42 MHz

#define FreqSPI1         (3000000) //(21000000)  // (18000000)=18MHz

I have tried 21000000 as well as 3000000, did not work.

Any further thoughts?

Thanks,

Rauf
Reply
#4
0
can i get any help?
Reply
#5
1
Better response on post RE: GD2UB with esp32The key with ESP32, specifically the DevKit is the SPI architecture it is some different to STM32 or Teensy 3.x boards (something strange). It´s prepare to work with SDIO cards. We need to locate the right SPI-bus pinout

Schematic ESP32 DevKit: https://github.com/SmartArduino/ESP/blob/master/SchematicsforESP32.pdf

Maybe James can help you with this architecture, because the original gameduino 2 lib can work with ESP8266, the "grandpa" of ESP32  Smile .
Reply
#6
0
I found this article. http://iot-bits.com/esp32/esp32-spi-tutorial-part-1/

i will try to connect any other SPI device on ESP32 VSPI port.

Thanks,

Rauf
Reply
#7
0
This library could be a good starting point to learn how the SPI works inside the ESP32

https://forum.arduino.cc/index.php?topic=443787.0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)