I have a design I am working on using the nodeMCU ESP8266 board and a BTS 7960 motor controller (IBT_2). The BTS 7960 is controlled by two PWM pins for forward/reverse and one common enable pin to connect to the two enable contacts. To cause rotation, voltage is applied to enable, then a (PWM varied) voltage to the direction going. On boot, the motor fires off intermittently. This means that at times both the enable pin and one of the PWM pins are going high. Per the information I can find, the nodeMCU ESP8266 has six internal pins that go high on boot: 1, 2, 3, 9, 10 & 16 so I avoided them in my design. So, I took an nodeMCU board and connected it to LEDs only for testing and found that all but two pins go high on boot (4 & 5) which are SCL/SDA and I am using them for I2C. What am I missing? How can I get the pins that supposedly don’t go high on boot to stay low?
Thank you.
Pins going high on boot question
Re: Pins going high on boot question
Kindly check the power supply. It's possible that the power supply is not giving sufficient voltage and current to the ESP and the motor controller.
Re: Pins going high on boot question
According to this chart https://randomnerdtutorials.com/esp8266 ... nce-gpios/ three of the SPI pins aren't specified to be HIGH at boot. (12, 13, 14) I don't recall what are their default setting, but you can use a pull down resistor on the one you want and shouldn't affect the boot process.
-
- Posts: 4
- Joined: Thu Mar 21, 2024 2:45 pm
Re: Pins going high on boot question
Liaifat85: “Kindly check the power supply. It's possible that the power supply is not giving sufficient voltage and current to the ESP and the motor controller.”
Thank you. I am new to this forum and don’t see a way to respond directly to each response so have pasted yours for reference.
I was using the USB to power it during development. This goes through a USB-C to USB-A adapter so maybe something is going on there as you suggest. I am in the process of building the prototype with the actual power supply built in. I will see what that results in.
Thank you. I am new to this forum and don’t see a way to respond directly to each response so have pasted yours for reference.
I was using the USB to power it during development. This goes through a USB-C to USB-A adapter so maybe something is going on there as you suggest. I am in the process of building the prototype with the actual power supply built in. I will see what that results in.
-
- Posts: 4
- Joined: Thu Mar 21, 2024 2:45 pm
Re: Pins going high on boot question
Inq720: "According to this chart https://randomnerdtutorials.com/esp8266 ... nce-gpios/ three of the SPI pins aren't specified to be HIGH at boot. (12, 13, 14) I don't recall what are their default setting, but you can use a pull down resistor on the one you want and shouldn't affect the boot process."
Thank you. I am new to this forum and don’t see a way to respond directly to each response so have pasted yours for reference.
Yes, that is exactly the chart I referenced from the beginning to decide on what pins to use. But my experience is that 12, 13 and 14 go high regardless.
The nodeMCU has built-in pull-up resistors. It seems counter intuitive to me to put a pull-down resistor on top of a built-in pull-up resistor. Can you explain that further? Thanks.
Thank you. I am new to this forum and don’t see a way to respond directly to each response so have pasted yours for reference.
Yes, that is exactly the chart I referenced from the beginning to decide on what pins to use. But my experience is that 12, 13 and 14 go high regardless.
The nodeMCU has built-in pull-up resistors. It seems counter intuitive to me to put a pull-down resistor on top of a built-in pull-up resistor. Can you explain that further? Thanks.
Re: Pins going high on boot question
In my experience, you can't rely on any pin to be (and remain) either high or low during booting. The thing is, although some of them should be pulled high or low (depending on the desired operating mode), for a brief moment all I/O pin have their default function (c.q. default mux destination). These are mostly output functions and include functions like various clocks and status. So you can't prevent a glitch there.
As I2C is mostly quite forgiving for having garbage on the bus, I usually designate GPIO 0 for SDA and GPIO 2 for SCL, that works, no problem, even though they're quite noisy on bootup. GPIO 4 and GPIO 5 are indeed probably the better candidate for a glitch-free PWM output.
If I want real glitch-free output, I tend to use an I/O extender, which do the job quite well. Something like MCP23017 (I2C) or MCP23S17 (SPI). If you really need to have PWM output, a specialised PWM chip controlled by I2C or SPI may be the solution, I have no experience there. I only use PWM for light and there a small glitch on boot up is not an issue.
As I2C is mostly quite forgiving for having garbage on the bus, I usually designate GPIO 0 for SDA and GPIO 2 for SCL, that works, no problem, even though they're quite noisy on bootup. GPIO 4 and GPIO 5 are indeed probably the better candidate for a glitch-free PWM output.
If I want real glitch-free output, I tend to use an I/O extender, which do the job quite well. Something like MCP23017 (I2C) or MCP23S17 (SPI). If you really need to have PWM output, a specialised PWM chip controlled by I2C or SPI may be the solution, I have no experience there. I only use PWM for light and there a small glitch on boot up is not an issue.
-
- Posts: 4
- Joined: Thu Mar 21, 2024 2:45 pm
Re: Pins going high on boot question
It was an issue with power supply. When booted using power from the USB, it has issues as described. Most pins go high at some point on boot. When booted with power from the permanent power supply, it works fine.
Re: Pins going high on boot question
Interesting.
Maybe the issue can be solved by adding capacitors to the power supply line. A large one, electrolytic, something like 16 uF and a small one, ceramic, something like 100 nF, will mostly do.
Maybe the issue can be solved by adding capacitors to the power supply line. A large one, electrolytic, something like 16 uF and a small one, ceramic, something like 100 nF, will mostly do.
Who is online
Users browsing this forum: No registered users and 16 guests