Page 1 of 1

Multiple Serial devices connection with ESP32-S2

Posted: Wed Mar 08, 2023 7:42 am
by zunuran
I am using ESP32-S2 chip in my design. ESP32-S2 supports only two serial hardware channels. But I have three devices that needs serial communication. 1- USB to UART converter chip, 2- Coin dispenser device, 3- RPI serial communication. Can I use SPDT switch for selecting from two serial devices? Will there be any issue with lines? I am attaching sketch for it

2nd question is i have 4 DC motors which i need to control from esp32-s2. Does this chip support Motor PWM control?

Re: Multiple Serial devices connection with ESP32-S2

Posted: Wed Mar 08, 2023 11:09 am
by rudi ;-)
zunuran wrote:
Wed Mar 08, 2023 7:42 am
I am using ESP32-S2 chip in my design. ESP32-S2 supports only two serial hardware channels. But I have three devices that needs serial communication. 1- USB to UART converter chip, 2- Coin dispenser device, 3- RPI serial communication. Can I use SPDT switch for selecting from two serial devices? Will there be any issue with lines? I am attaching sketch for it

2nd question is i have 4 DC motors which i need to control from esp32-s2. Does this chip support Motor PWM control?
For the first question, using an SPDT switch between the ESP32-S2 and the three serial devices may work, but it may not be the most efficient solution. Another solution would be to use software serial or I2C communication for one of the devices instead of a hardware serial connection. This would leave two hardware serial channels for the remaining two devices.

As for the second question, yes, the ESP32-S2 does support motor PWM control. It has multiple channels that can be used for PWM output, and it can generate PWM signals with different frequencies and duty cycles. However, you will need to use an H-bridge or some other motor driver circuit to interface with the DC motors. The ESP32-S2 cannot directly drive a DC motor.


"AskRudi"

Re: Multiple Serial devices connection with ESP32-S2

Posted: Thu Mar 09, 2023 12:32 am
by ESP_Sprite
As for the second question, yes, the ESP32-S2 does support motor PWM control.
Specifically, you'll need to use the LED PWM peripheral for this as there is no dedicated MPWM peripheral.