Let's say I want specific pins for SCK MISO MOSI etc. I see there is a esp32-hal-spi.h allowing to attach/detach that however I noticed when compiling many Arduino-stuff examples and looked at the code - I couldn't find a straightforward initialization of SPI pins. I guess it's done by default somewhere...?
I really would like to control that because I use a lot of pins and connect more than couple devices and many of them get wrong readings because there is something wrong with how pins are set up.
Are there any ESP lower level/advanced tutorials for spi, adc/dac, i2c, timer...etc ?
I would appreciate help.
thank you
Initialize custom pins for SPI
-
- Posts: 9052
- Joined: Thu Nov 26, 2015 4:08 am
Re: Initialize custom pins for SPI
My guess (as it mentions HAL) is that this is an Arduino question?
Re: Initialize custom pins for SPI
Well I am not sure what other choices I have. I really would like to use plain non-Arduino libraries but I am just a beginner in esp programming. I don't have much choice but use Arduino framework for some time unless you can direct me to better dedicated framework - I prefer under Windows only. STM has stmCube - stuff like that would be nice for esp.
vsMicro works great but it is a bit quirky and doesn't work as full C/C++ environment. Personally, I don't think there should be some common framework for different boards because each of them is very unique and has special features
vsMicro works great but it is a bit quirky and doesn't work as full C/C++ environment. Personally, I don't think there should be some common framework for different boards because each of them is very unique and has special features
Re: Initialize custom pins for SPI
So is it possible to do that? how do I attach custom pins to spi clock mosi miso and other interfaces?
Re: Initialize custom pins for SPI
https://esp32.com/viewtopic.php?f=19&t=5205
Remember there is an Arduino subforum for anything related to Arduino. This subforum is for https://github.com/espressif/esp-idf
Remember there is an Arduino subforum for anything related to Arduino. This subforum is for https://github.com/espressif/esp-idf
Re: Initialize custom pins for SPI
I care less if I use Arduino. I just want to initialize custom pins using esspresif idf or other code
Also I have some questions about asp idf.
I assume sdk is to use with FreeRTOS and has nothing to do with Arduino esp libraries.
I don't even know how different is the architecture of those. Some people say OS is slower than bare metal.
Practically for larger projects OS is a must. I am at the stage of setting this up under Windows.
Not sure what is the best way. Will try the programming guides.
Also I have some questions about asp idf.
I assume sdk is to use with FreeRTOS and has nothing to do with Arduino esp libraries.
I don't even know how different is the architecture of those. Some people say OS is slower than bare metal.
Practically for larger projects OS is a must. I am at the stage of setting this up under Windows.
Not sure what is the best way. Will try the programming guides.
Re: Initialize custom pins for SPI
This is response I received from Arduino forum
On the Arduinos, the pins are given special meaning, like SPI, I2C, etc. by the chip maker.
IF the ESP allows customizing the SPI, I2C, etc. pins, you should ask on the ESP forum how to do that.
-
- Posts: 9052
- Joined: Thu Nov 26, 2015 4:08 am
Re: Initialize custom pins for SPI
Fyi Arduino also uses ESP-IDF (and thus FreeRTOS) underneath. Having an OS/RTOS is pretty much a requirement if you want to do multi-core programming with complex stuff like WiFi and BT.
Re: Initialize custom pins for SPI
Yes I said Arduino subforum aka https://esp32.com/viewforum.php?f=19
On esp32 Arduino runs on top of freertos anyway. Sounds like you have a lot of reading to do. There are lots of tutorials and examples on blogs and YouTube and GitHub.
On esp32 Arduino runs on top of freertos anyway. Sounds like you have a lot of reading to do. There are lots of tutorials and examples on blogs and YouTube and GitHub.
Re: Initialize custom pins for SPI
Well, then you easily should be able to help me.ESP_Sprite wrote:Fyi Arduino also uses ESP-IDF (and thus FreeRTOS) underneath. Having an OS/RTOS is pretty much a requirement if you want to do multi-core programming with complex stuff like WiFi and BT.
Where all pin initialization is located so I could assign pins?
Do you know what header/source file I should look up?
Who is online
Users browsing this forum: tomy983 and 270 guests