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

User avatar
By Reinier
#36388 I have something real strange

I have connected my Huzzah break out to the USB, using the USB 5V output for power.

Now when I let the led flash with an interval of 1sec, there is no problem. But when I go to 0,7sec I get regular crashes: Hard Restart. So I expected that the USB 5V is not good enough and connected an external power suply.
From that moment I can not connect to the Huzzah board anymore, getting a message to check the baudrate.

GND is connected to the USB...

any idea's?
User avatar
By Reinier
#36417 This is the very basic code I use:

while 1 do
gpio.write(3, gpio.HIGH)
tmr.delay(900000)
gpio.write(3, gpio.LOW)
tmr.delay(900000)
end

This code results in a crash, as soon as I change the timer value to 1000000 (=1sec) there are no more crashes.

I tried adding a 100uF capacitor, no difference

to solve the connection problem
I tried buffering the TX signal with a transistor to 5V, also no result

I tried another Huzzah module, no result

I'm getting desperate here
User avatar
By Trickuncle
#36519 I saw the same thing - short delays reset the module while long ones sort of seemed to work. Try this code below; it should solve two problems at once.

First, notice there is no while loop. The while loop fails to let the module run it's own code when it wants to so it crashes. To get the code to perform periodic activity (ie., blink on/off), see the timer alarm line - it is programmed here for 250 ms and to endlessly repeat. When it goes off, the function 'ledblink' is called which simply checks the state of the output pin and toggles it. All the time waiting for the timer to go off is now given up to the module and it's wifi stack.

I don't know what power supply problem you are having but try this first off...

Code: Select all        gpio.mode(3, gpio.OUTPUT)

        function ledblink()
            if blink then
                blink = false
                gpio.write(3, 1)
           else
                blink = true
                gpio.write(3, 0)
            end
        end

        tmr.alarm(1, 250, 1, ledblink)