• Hi MaBe,

    I'm using the hardware SPI of the ESP8266 (SPI1), and it has only one configuration. The documentation says I don't have to manually specify the MISO/MOSI/SCK pins if I'm okay with the defaults.

    If sck,miso and mosi are left out, they will automatically be chosen.
    However if one or more is specified then the unspecified pins will not
    be set up.

    But you are right, it won't hurt to try manually specify everything if it doesn't work.

    However the error is related to the digitalPulse call, not SPI. The line with the "wait for completion" comment fails as you can see with the timer timeout. The documentation of this function says:

    It uses a hardware timer to produce accurate pulses, and returns
    immediately (before the pulse has finished). Use digitalPulse(A0,1,0)
    to wait until a previous pulse has finished.

    I have to wait for the pulses to go out before I can issue the reset command on the SPI bus.
    Though today while I was browsing the documentation I've also found on the ESP8266 specific page that

    The esp8266 uses FreeRTOS with non-preemptible tasks and has extremely
    limited code space for interrupt handlers, as a result, it is not
    possible to handle certain peripherals at interrupt time and a task
    has to be scheduled instead, which would be OK if tasks were
    pre-emptible, but they are not. This means that functions like
    digitalPulse have to use busy-waiting between edge transitions instead
    of being interrupt driven.

    So maybe it's not even necessary, since the digitalPulse will be a blocking call on the ESP8266 if I understood correctly.

    Anyway, I'm going to dig out my logic analyzer and see what's going on with the pins.

    I've seen your previous comment sent out in the email related to the firmware version :)
    As you can see I'm on 2v04 (below the logo). I don't understand why the espruno-cli says "You have pre-1v96 firmware. Upload size is limited by available RAM".


Avatar for nistvan.86 @nistvan.86 started