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

hacksome
Posts: 14
Joined: Sat Apr 13, 2019 8:23 am

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

Postby hacksome » Sat Aug 22, 2020 10:22 pm

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

markxr
Posts: 15
Joined: Sun Aug 16, 2020 7:32 pm

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

Postby markxr » Sun Aug 23, 2020 1:29 pm

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.

hacksome
Posts: 14
Joined: Sat Apr 13, 2019 8:23 am

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

Postby hacksome » Mon Aug 24, 2020 12:12 pm

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 :)

starofslytherin
Posts: 2
Joined: Mon Jun 27, 2022 6:23 am

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

Postby starofslytherin » Wed Jul 20, 2022 11:12 am

Any update on this? I'm looking for Software Serial for debugging or for GPS peripherals, a low baud rate (4800 or 9600) application.

Who is online

Users browsing this forum: No registered users and 105 guests