0
\$\begingroup\$

I have an Arduino that accepts its UART I/O from a wired and a wireless connection. The wired portion is a standard CP2104 USB to UART bridge and the wireless portion is done, for now, through an HC-05 BT module. The two are switched using a MUX/DEMUX scheme in which the USB 5V acts as the select line. When the USB is unplugged, the BT module is turned on. While the USB cable is plugged in, the BT module is turned off. The MCU is used to control 4xTB6600 stepper drivers.

enter image description here

Here is the weird bit: When the motors are plugged in to the drivers, and the USB is unplugged to allow the BT module to take over (when the motors are off and there is no software actively using the USB), the MCU behaves very erratically constantly switching ON and OFF the enable pin (The MCU runs grbl. A video showing this behavior is shown here). This does not happen when the motors are unplugged and it works fine. I'd really appreciate it if anyone can help me understand why this is happening and give me some ideas on making this work.

\$\endgroup\$
0
\$\begingroup\$

Could it be because DTR is floating when USB is unplugged, and that is somehow implicated in reset of your MCU as is common in many Arduino designs?

\$\endgroup\$
  • \$\begingroup\$ Could you explain more? The reset design is the same as any Arduino Uno, i.e. a 0.1u capacitor to the reset line that is usually held high with a 10K resistor and a physical reset switch to ground common. \$\endgroup\$ – electrophile Dec 16 '17 at 17:07
  • \$\begingroup\$ Insufficient context available for further comment. Put a scope on the reset line to three micro. \$\endgroup\$ – vicatcu Dec 16 '17 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.