Extend ESP32 UART interfaces, Is it possible?

Prasad
Posts: 48
Joined: Sun Jul 23, 2017 5:26 pm

Extend ESP32 UART interfaces, Is it possible?

Postby Prasad » Wed Jul 26, 2017 2:47 pm

I'm looking to have a 5 serial connections with ESP32 and preferably with hardware UART connections, But we can use only 2 out of total 3 UART peripherals because one is already using for serial flash. So i'm wondering if there is a way to extend UART interfaces or should i go with Software UART interfaces? If so how? Please advice.

samsam
Posts: 50
Joined: Sun Jun 04, 2017 5:26 pm

Re: Extend ESP32 UART interfaces, Is it possible?

Postby samsam » Thu Jul 27, 2017 4:15 am

You have 3 on the chip that you can use on almost any of the pads available through the driver provided with esp-idf!
And 2 more you can get with external IC like NXP SC16IC7x2 which is Dual UART with I²C-bus/SPI interface

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

Re: Extend ESP32 UART interfaces, Is it possible?

Postby ESP_Sprite » Fri Jul 28, 2017 1:40 am

Also, if your connections are half-duplex with the ESP32 sending commands and the peripherals just replying, you may get away using only one UART channel and using the GPIO matrix to multiplex it to different pins. Does have the disadvantage that you cannot receive data on a channel that is not currently muxed to RX, hence the restriction of half-duplex with the ESP32 sending commands.

Prasad
Posts: 48
Joined: Sun Jul 23, 2017 5:26 pm

Re: Extend ESP32 UART interfaces, Is it possible?

Postby Prasad » Fri Jul 28, 2017 3:33 am

Actually i need full duplex function for my application so i thought to use SC16IS762IBS from NXP as @samsam mentioned. Any better modules provide dual UART before i order this?

https://www.digikey.com/product-detail/ ... -ND/946249

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: Extend ESP32 UART interfaces, Is it possible?

Postby loboris » Fri Jul 28, 2017 8:56 am

I'm usualy using Atmel ATXMega microcontrollers for situations like this. For example, with ATXMEGA32 you can get 4 UARTS and I2C interface to ESP32, and you can program it to work in a way you want it. You can also use it as port expander, spi expander, etc.

Prasad
Posts: 48
Joined: Sun Jul 23, 2017 5:26 pm

Re: Extend ESP32 UART interfaces, Is it possible?

Postby Prasad » Fri Jul 28, 2017 10:33 am

So is ATXMEGA32 capable of handling simultaneous 4 UART channels. Actually i'm trying to communicate with 5 SIM900 modules simultaneously with ESP32 and i'm running FreeRTOS. Any suitable recommendations for that purpose? I'm also worried that i have to program the Atmel chip to achieve above purpose?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Extend ESP32 UART interfaces, Is it possible?

Postby WiFive » Fri Jul 28, 2017 11:35 am

You can't use flow control and timeshare the uarts?

Prasad
Posts: 48
Joined: Sun Jul 23, 2017 5:26 pm

Re: Extend ESP32 UART interfaces, Is it possible?

Postby Prasad » Fri Jul 28, 2017 11:51 am

I'm not sure what you are referring here. Can you explain little bit more how to achieve this with freeRTOS?

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: Extend ESP32 UART interfaces, Is it possible?

Postby loboris » Fri Jul 28, 2017 3:55 pm

Prasad wrote:So is ATXMEGA32 capable of handling simultaneous 4 UART channels. Actually i'm trying to communicate with 5 SIM900 modules simultaneously with ESP32 and i'm running FreeRTOS. Any suitable recommendations for that purpose? I'm also worried that i have to program the Atmel chip to achieve above purpose?
ATXMEGA is perfectly capable to handle simultaneous 4 UART channels (interrupt based, and xmega works at 32MHz), of course, you have to program it to achieve this (or any) functionality.
If I may ask, for what purpose do you need 5 SIM900 modules? I'm working with SIM800 module attached to ESP32 using PPPoS, so it is possible to use all network functions the same way they are used with WiFi. It works perfectly for couple of months now. ESP32 is comunicating with couple of servers using ftp, sftp, mqtt, ...
You can look at my basic example and example with cURL .

Another approach could be to simply multiplex Tx&Rx pins with external multiplexer (for example 74HC4052D). I've used this configuration in some other projects and it works well. It is the most simple & cheapest approach.

Prasad
Posts: 48
Joined: Sun Jul 23, 2017 5:26 pm

Re: Extend ESP32 UART interfaces, Is it possible?

Postby Prasad » Fri Jul 28, 2017 5:32 pm

Thanks @loboris for the valuable explanation. Now i'm interested in multiplex Tx&Rx solution as you mentioned and it seems to be the simplest approach. Before that i was considering(Well, couldn't try that yet) switch a single UART connection between 5 SIM900 modules to perform actions, Then it will not be simultaneous of course.

I'm using 5 SIM900 modules to build online top up mechanism for selected telco carriers in here. So it requires 5 telco carriers to be standby to perform topup requests coming through MQTT connection. Any thoughts/corrections/suggestions about my design architecture would be greatly appreciated :)

Who is online

Users browsing this forum: sangk82 and 124 guests