Page 1 of 1

Using software serial for debug so I can use Uart0 for peripheral

Posted: Sat Aug 22, 2020 10:22 pm
by hacksome
Hi all

I need to connect to three serial devices and also want to connect to debug so see the logs. Is it possible to use some software serial library say that outputs at 9600 and use the UART0 for the peripheral. Unfortunately I cannot add an external UART IC or swap a hardware UART quickly between the peripherals

The TXD0 and RXD0 pins are connected to programming/debug port. I am hoping that at startup the code can switch the debug over to software UART on TXD0 Pin while the hardware is re-directed to PIN26/27 on my custom board

I see some people have used something on these lines for Arduino but I cannot find an IDF example.

Thanks

Re: Using software serial for debug so I can use Uart0 for peripheral

Posted: Sun Aug 23, 2020 1:29 pm
by markxr
I imagine it's easy to make the "rmt" peripheral do transmit-only serial, it can operate on any gpio pin as far as I can tell.

Just dynamically build a pulses array with the correct lengths of high/low for the serial bits. Should work no problem at 9600 or indeed, much faster.

Re: Using software serial for debug so I can use Uart0 for peripheral

Posted: Mon Aug 24, 2020 12:12 pm
by hacksome
Yes I have seen the RMT being mentioned before but I have not seen an Implementation as software uart anywhere. Was hoping for a ready made solution, it can't be just me who needs 4 uarts :)

Re: Using software serial for debug so I can use Uart0 for peripheral

Posted: Wed Jul 20, 2022 11:12 am
by starofslytherin
Any update on this? I'm looking for Software Serial for debugging or for GPS peripherals, a low baud rate (4800 or 9600) application.