Skip to content

Support for D-duino-32 #930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
srolf opened this issue Dec 17, 2017 · 1 comment · Fixed by #2030
Closed

Support for D-duino-32 #930

srolf opened this issue Dec 17, 2017 · 1 comment · Fixed by #2030

Comments

@srolf
Copy link

srolf commented Dec 17, 2017

Hardware:

Board: D-duino-32
Core Installation/update date: 17/dec/2017
IDE name: Arduino IDE 1.8.5
Flash Frequency: 80Mhz
Upload Speed: 115200

Description:

The D-duino-32 board (ESP32 with on-board I2C SSD1306 and OLED 128x64) is unluckily not using the standard pin assignment for SDA/SCL like 21/22, instead it uses 5/4.

Due to this problem it's not possible to use most of the I2C component libraries if these are not allowing to set explicitly the pins for SDA/SCL.

To resovle the problem, I tried to create a custom board description. With this it was possible to use the OLED by the Adafruit SSD1306 library as a display for a small MQTT listener.

Would it be possible to include this board in the list of supported ones?

The following mods were made (1st time in doing this, so I may have made something wrong):

\Arduino\hardware\espressif\esp32\boards.txt (added at the end)

##############################################################

ddunio32.name=D-duino-32

ddunio32.upload.tool=esptool
ddunio32.upload.maximum_size=1310720
ddunio32.upload.maximum_data_size=294912
ddunio32.upload.wait_for_upload_port=true

ddunio32.serial.disableDTR=true
ddunio32.serial.disableRTS=true

ddunio32.build.mcu=esp32
ddunio32.build.core=esp32
ddunio32.build.variant=dduino32
ddunio32.build.board=DDUINO32

ddunio32.build.f_cpu=240000000L
ddunio32.build.flash_mode=dio
ddunio32.build.flash_size=4MB
ddunio32.build.boot=dio
ddunio32.build.partitions=default

ddunio32.menu.FlashFreq.80=80MHz
ddunio32.menu.FlashFreq.80.build.flash_freq=80m
ddunio32.menu.FlashFreq.40=40MHz
ddunio32.menu.FlashFreq.40.build.flash_freq=40m

ddunio32.menu.UploadSpeed.921600=921600
ddunio32.menu.UploadSpeed.921600.upload.speed=921600
ddunio32.menu.UploadSpeed.115200=115200
ddunio32.menu.UploadSpeed.115200.upload.speed=115200
ddunio32.menu.UploadSpeed.256000.windows=256000
ddunio32.menu.UploadSpeed.256000.upload.speed=256000
ddunio32.menu.UploadSpeed.230400.windows.upload.speed=256000
ddunio32.menu.UploadSpeed.230400=230400
ddunio32.menu.UploadSpeed.230400.upload.speed=230400
ddunio32.menu.UploadSpeed.460800.linux=460800
ddunio32.menu.UploadSpeed.460800.macosx=460800
ddunio32.menu.UploadSpeed.460800.upload.speed=460800
ddunio32.menu.UploadSpeed.512000.windows=512000
ddunio32.menu.UploadSpeed.512000.upload.speed=512000

\Arduino\hardware\espressif\esp32\variants\dduino32\pins_arduino.h

#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS        40
#define NUM_ANALOG_INPUTS       16

#define analogInputToDigitalPin(p)  (((p)<20)?(esp32_adc2gpio[(p)]):-1)
#define digitalPinToInterrupt(p)    (((p)<40)?(p):-1)
#define digitalPinHasPWM(p)         (p < 34)

static const uint8_t TX = 1;
static const uint8_t RX = 3;

static const uint8_t SDA = 5;
static const uint8_t SCL = 4;

static const uint8_t SS    = 15;
static const uint8_t MOSI  = 13;
static const uint8_t MISO  = 12;
static const uint8_t SCK   = 14;

static const uint8_t A0 = 36;
static const uint8_t A3 = 39;
static const uint8_t A10 = 4;
static const uint8_t A11 = 0;
static const uint8_t A12 = 2;
static const uint8_t A13 = 15;
static const uint8_t A14 = 13;
static const uint8_t A15 = 12;
static const uint8_t A16 = 14;
static const uint8_t A18 = 25;
static const uint8_t A19 = 26;

static const uint8_t T0 = 4;
static const uint8_t T1 = 0;
static const uint8_t T2 = 2;
static const uint8_t T3 = 15;
static const uint8_t T4 = 13;
static const uint8_t T5 = 12;
static const uint8_t T6 = 14;

static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;

// Wemos Grove Shield
static const uint8_t D1 = 5;
static const uint8_t D2 = 4;
static const uint8_t D3 = 0;
static const uint8_t D4 = 2;
static const uint8_t D5 = 14;
static const uint8_t D6 = 12;
static const uint8_t D7 = 13;
static const uint8_t D8 = 15;
static const uint8_t D9 = 3;
static const uint8_t D10 = 1;

#endif /* Pins_Arduino_h */
@mszlachetka
Copy link

mszlachetka commented Jan 16, 2018

Workaround for this issue:

#include <Wire.h>
#include <driver/i2c.h>

#define SDA_NEW 5
#define SCL_NEW 4

TwoWire wire2(I2C_NUM_1); //I2C_NUM_0 will use default pins anyway
void setup()
{
Wire = wire2;
Wire.begin(SDA_NEW, SCL_NEW, 100000);
devices_which_use_default_Wire.begin();
}

Hope It helps :)
~Michal

me-no-dev pushed a commit that referenced this issue Nov 19, 2018
* adding d-duino-32 board/pins, fixes #930

* remove OLED_RST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants