Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By sumotoy
#35296 Again, you miss the point, the SPI should be TRISTATE, dealing just with polarity don't solve problem. For example, MISO should be floating when not acquiring data, this allow the other devices to correctly use it.
Same thing on SCLK and MOSI, they should stay tristate otherwise will affect the other devices and (I suspect but I'm not sure on the ESP8266 the FLASH chip it's using the same SPI line).
A possible solution it's use a tristate buffer like 74HC125 followed by 74HC04 to invert SPI lines, the buffer should have all enable lines tied to CS so the whole device will be active only when CS is low then return high impedance and result imvisible to the other SPI devices.
User avatar
By freedom2000
#35303
sumotoy wrote:Again, you miss the point, the SPI should be TRISTATE, dealing just with polarity don't solve problem. For example, MISO should be floating when not acquiring data, this allow the other devices to correctly use it.
Same thing on SCLK and MOSI, they should stay tristate otherwise will affect the other devices and (I suspect but I'm not sure on the ESP8266 the FLASH chip it's using the same SPI line).
A possible solution it's use a tristate buffer like 74HC125 followed by 74HC04 to invert SPI lines, the buffer should have all enable lines tied to CS so the whole device will be active only when CS is low then return high impedance and result imvisible to the other SPI devices.


Ok it's clear now... Not so easy :-(
User avatar
By martinayotte
#35320 Yes, Somotoy is right !
Since MISO is the output of slave devices, their outputs should be high impedance if their SPI_CS isn't selected.
Of course, MOFSET can help their too, if guilty device doesn't follow that spec, by making tristate output becoming an open-drain with pullup (a bit like level translator), as long as that "quiet" devices doesn't "speak", and remain "quiet", when they are not requested for.
User avatar
By sumotoy
#35331 It's always good to see thread like this, where there's proposal and sharing ideas, so thanks everyone!
In the meantime I've updated the library since I'm using eagle_soc.h function vs digitalWrite for SPI transactions and works fast but using WiFi in the same time will stop the library working so I have a couple of questions:

1) Why eagle_soc.h get broken when using wifi operations? (like connect AP, etc.)
2) The FLASH chip of the ESP8266 it's actually sharing the SPI line of the module?