Skip to content

ESP8266 Crash when using analogWriteFreq(freq) #4868

Closed
@vangalvin

Description

@vangalvin

I am developing a system that uses a thermal block and fan with several temperature sensors.
The core uses a PID to deal with the heat block and that works perfectly, I have a second PID that handles the fan speed however using the default frequency for the PWM the fan squeals because the PWM frequency is too low.

I tried to implement analogWriteFreq(12000) and this removes all the noise, heat block continues to work as expected but the ESP8266 crashes., sometimes just locking up and other times fires a watchdog error and attempts to reboot.

I made a simple sketch to test the fan on it own and removed the PID and have the same issues.
as soon as I use analogWriteFreq(12000) i get what appears to be random lockup's of the ESP.

I did read that you need to reduce the input range (0 - 256) normally done by analogWriteResolution(8);
however that does not seem to work with the ESP.

I have tried just sending 0254 using analogWrite but I do not get the full speed of the fan and it appears to still be wanting an input of 01024 in order to get to full speed but then this causes the system to crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions