Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By blark
#43409 Is there any way to enable the ESP8266 clock on one of the output pins?

I believe that I read somewhere that when it reboots it automatically sends the clock out for a short period and then stops. I assume that it's stopping because of software? Any way to re-enable this using the Arduino IDE?

Thanks
Mark
User avatar
By Mr. Anderson
#48316 Hello,

I would like a ask a follow-up question.
Right now I'm trying to enable a continuous clock signal of at least 2 MHz (max 4Mhz) on GPIO14. With the information from the link above I came up with following code.

Code: Select all#include <SPI.h>
SPI.begin();
SPI.setFrequency(4000000);
// pinMode(pin, SPECIAL); 14 = SPI_CLK
pinMode(14, 14);
// FUNCTION_2: set GPIO14 (MTMS) to HSPICLK
pinMode(14, FUNCTION_2)


Sadly it's not working. I'm just not sure if my code is wrong or if SPI.setFrequency() doesn't work in this case and the clock speed is just way too high.
Is this even the right approach or should I try something completely different?
User avatar
By lethe
#48338 SPI clock is only running during data transmission, so regardless of whether your code is correct or not, the pin will remain low unless you are sending data. And even if you do, the clock will stop between 2 transfers, so SPI would be a poor choice to generate a steady clock signal.