Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Rob.Binet
#55480 Hi,

Is it a way while using the esp8266 SPI library to release the function of the GPIO15 of its SS function and reassign it to another pin.
I would like in my SPI configuration to have:
GPIO15 activated as an INPUT used as SPI interrupt
GPIO16 used as OUTPUT for SPI Slave Select
All the attempts I have made so far ended by:

Soft WDT reset

ctx: cont
sp: 3ffef600 end: 3ffef890 offset: 01b0

>>>stack>>>
3ffef7b0: 3ffee676 00000004 3ffee65c 402022e5
3ffef7c0: 000003e7 3ffee65c 0000e7ad 40202492
3ffef7d0: 3ffee650 00000001 00000040 4020232c
3ffef7e0: 3ffee650 00000001 3ffee65c 000003e7
3ffef7f0: 3ffee650 00000001 3ffee65c 40202b19
3ffef800: 0000e7ad 0000000c 00000001 40202074
3ffef810: 00000009 3ffee65c 00000000 0000e785
3ffef820: 00000001 3ffee65c 00000002 40202144
3ffef830: 3ffee650 0000000c 00000002 00000028
3ffef840: 33333420 7a684d20 3ffee7ac 000000be
3ffef850: 3ffee650 3ffee65c 3ffee7ac 40201f4a
3ffef860: feefeffe 00000000 00000000 3ffee868
3ffef870: 3fffdad0 00000000 3ffee860 40203e70
3ffef880: feefeffe feefeffe 3ffee870 40100718
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(1,6)


Thanks in advance,
Robert
User avatar
By Rob.Binet
#55604 My findings until now:
Definition of pins is done in :
packages/esp8266/hardware/esp8266/2.3.0/variants/generic/common.h
static const uint8_t SS = 15;
static const uint8_t MOSI = 13;
static const uint8_t MISO = 12;
static const uint8_t SCK = 14;
Changing
static const uint8_t SS = 15;
to
static const uint8_t SS = 16;
Has the advantage to restrict the limited functions of GPIO16 (GPIO16 doesn't allows interrupts) to Slave Select and so to improve the pins usage

However, I still continue to investigate the consequences of this changes.
Robert
User avatar
By schufti
#55665 @ rob.binet: what you did was just changing the pins aliases. they are used so plp don't need to remember that SS is gpio15. As SPI is hw that won't - unlike i2c - change the behaviour.
OTOH there are possibilities to swap hw-pinfunctions (see attached file) but from a quick glimpse it doesn't look like your wanted config is available...
You do not have the required permissions to view the files attached to this post.