Multiple Serial devices connection with ESP32-S2

zunuran
Posts: 1
Joined: Wed Mar 08, 2023 7:36 am

Multiple Serial devices connection with ESP32-S2

Postby zunuran » 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?
Attachments
WhatsApp Image 2023-03-08 at 12.25.03.jpg
WhatsApp Image 2023-03-08 at 12.25.03.jpg (120.41 KiB) Viewed 1331 times

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: Multiple Serial devices connection with ESP32-S2

Postby rudi ;-) » Wed Mar 08, 2023 11:09 am

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"
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: Multiple Serial devices connection with ESP32-S2

Postby ESP_Sprite » Thu Mar 09, 2023 12:32 am

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.

Who is online

Users browsing this forum: joglz8 and 174 guests