Skip to content
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

Arduino board support/definition for TTGO T1 (v1.3+) #2740

Closed
probonopd opened this issue May 3, 2019 · 6 comments · Fixed by #2744
Closed

Arduino board support/definition for TTGO T1 (v1.3+) #2740

probonopd opened this issue May 3, 2019 · 6 comments · Fixed by #2744

Comments

@probonopd
Copy link

probonopd commented May 3, 2019

A board variant for TTGO-T1 V1.3 is needed.

TTGO-T1 V1.3 is a board based on ESP32 with a TF (microSD) card slot on the board. It is similar to the existing hardware/esp32/1.0.2/variants/ttgo-lora32-v1/pins_arduino.h but instead of LoRa it has microSD on board.

Looking at the pinout diagram my question is, how can we get SD.begin() to use GPIO13 for CS, GPIO15 for MOSI, GPIO2 for MISO, GPIO14 for SCK

static const uint8_t SD_SS    = 13;
static const uint8_t SD_MOSI  = 15;
static const uint8_t SD_MISO  = 2;
static const uint8_t SD_SCK   = 14;

while keeping, for all other devices,

static const uint8_t SS    = 18;
static const uint8_t MOSI  = 23;
static const uint8_t MISO  = 19;
static const uint8_t SCK   = 5;

so that the microSD card can be used while other SPI devices can still be attached to the broken out pins?

@luc-github
Copy link
Contributor

you just call
SPI.begin(14, 2, 15, 13);
before
`SD.begin();

check void begin(int8_t sck=-1, int8_t miso=-1, int8_t mosi=-1, int8_t ss=-1);
in
https://github.com/espressif/arduino-esp32/blob/master/libraries/SPI/src/SPI.h#L55

@probonopd
Copy link
Author

Thanks @luc-github

@atanisoft
Copy link
Collaborator

There is also the i2c pins, the built-in LED is on pin 22 and from my experience causes problems for i2c on that default pin.

@probonopd
Copy link
Author

Reopening, since having a board definition file would probably still be a good thing.

@probonopd probonopd reopened this May 3, 2019
@atanisoft
Copy link
Collaborator

I'll see if I can create a variant this weekend for this.

@atanisoft
Copy link
Collaborator

Submitted a PR for the board definition, opted for override SS/MISO/MOSI/SCK with the SD defaults to make it easier for end users. SS needs to be overridden for all SPI devices usually anyway so it doesn't hurt to share the other pins.

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.

3 participants