-->
Page 1 of 1

ESP8266 & SPI Portexpansion with MCP23S17

PostPosted: Wed Jan 14, 2015 8:16 pm
by rudi
hi
happy new year!
i work at spi and mcp23s17 so i make for esp8266 a base for my playing.
here


used:
ESP8266 ESP-12 AI-THINKER
MCP23S17 MICROCHIP
LED Array NO NAME

in this short video i show the new ESP-12 from ai-thinker with adc and all gpio and append in function i will show you here my new firmware with spi and portexpansion by using the MCP23S17

i installed a spi portexpander from microchip MCP23S17 for gives the esp8266 2 full port more.
portA with 8 GPIO as setup here as Output
portB with 8 GPIO reserve

for demontstration i connect from portA 8 GPIO's to a LED array and run
a simple small base firmware for fun.

you can connect from same SPI Expansion device 8 devices
the devices are called by the device adress so you must take for each device a separatly CS.

you can set this with 3 port adress A2 A1 A0

in this demo i set all to GND and the device is device ID : 0

A2=0 A1=0 A0=0 Device ID is : 0
A2=0 A1=0 A0=1 Device ID is : 1
A2=0 A1=1 A0=1 Device ID is : 2
A2=0 A1=1 A0=0 Device ID is : 3
A2=1 A1=0 A0=0 Device ID is : 4
A2=1 A1=0 A0=1 Device ID is : 5
A2=1 A1=1 A0=0 Device ID is : 6
A2=1 A1=1 A0=1 Device ID is : 7


you can connect a LCD to the SPI Expander and any more.
you can connect a second to portB or more..

If you set the ports as Input you can make a 64 switch

with 8 devices you will have many possible's

have fun and thanks for watching!

best wishes

rudi ;-)

Re: ESP8266 & SPI Portexpansion with MCP23S17

PostPosted: Fri Jan 16, 2015 1:34 am
by captain_morgan
Can you show the source of this as an example? I'm struggling to get SPI working and any functioning example could would probably help.

Re: ESP8266 & SPI Portexpansion with MCP23S17

PostPosted: Sat Jan 17, 2015 11:53 am
by rudi
captain_morgan wrote:Can you show the source of this as an example?
I'm struggling to get SPI working and any functioning example could would probably help.


where is the problem? show your code please.

SPI itself? or with the ESP8266?
have you test spi to an other mcu before?
is your code runing?
then make the same thing with esp8266,
there is no difference to go on,

one thing
esp12 and esp7 are the pin gpio4 and gpio5 swapped
they have be wrong painted to the pcb
gpio4 = gpio5
gpio5 = gpio4
..
rudi

Re: ESP8266 & SPI Portexpansion with MCP23S17

PostPosted: Mon Feb 09, 2015 5:38 pm
by Allan Madsen
Hi Byrudi
Will you shere your ESp8266 spi code?