Using the tx/rx pins not for UART
Using the tx/rx pins not for UART
As usual, I'm getting ahead of what is available right now, but that's mostly due to excitement -- I'm planning my future projects using Micropython. And I'm wondering whether it's reasonable to assume that I will be able to use the rx and tx pins as normal gpio pins, or, say, i2c or spi pins.
The eight "regular" pins on the ESP8266 is quite a lot for most uses, but it's still much fewer then 20-something on the arduino or similar boards. So it becomes important to conserve the pins. With webrepl available, the hardware serial console, while still useful and needed in most projects, could be probably disabled, freeing two additional pins.
Now, the way things work right now, it doesn't seem like it's possible to just disable the uart. Not only the console doesn't stop when webrepl is started, but also there is a lot of debugging and system stuff being output there. So my question is more about the future -- is the ability to disable the uart and reclaim the two pins for other purposes planned?
The answer would let me plan accordingly and already order the PCBs.
The eight "regular" pins on the ESP8266 is quite a lot for most uses, but it's still much fewer then 20-something on the arduino or similar boards. So it becomes important to conserve the pins. With webrepl available, the hardware serial console, while still useful and needed in most projects, could be probably disabled, freeing two additional pins.
Now, the way things work right now, it doesn't seem like it's possible to just disable the uart. Not only the console doesn't stop when webrepl is started, but also there is a lot of debugging and system stuff being output there. So my question is more about the future -- is the ability to disable the uart and reclaim the two pins for other purposes planned?
The answer would let me plan accordingly and already order the PCBs.
-
- Posts: 7
- Joined: Tue Jul 08, 2014 5:30 pm
- Location: Connecticut, USA
Re: Using the tx/rx pins not for UART
Hear hear! Except, I would like to use the UART pins as UART pins, but without the REPL.
I'm going to connect an ESP-01 module to a serial camera module. Problem right now is, there are Control-C characters (0x03) in the binary data returned by the module. This is interpreted as a KeyboardInterrupt by the REPL, causing the program to stop.
(Thank you to whoever enabled BBCode for my account!)
I'm going to connect an ESP-01 module to a serial camera module. Problem right now is, there are Control-C characters (0x03) in the binary data returned by the module. This is interpreted as a KeyboardInterrupt by the REPL, causing the program to stop.
(Thank you to whoever enabled BBCode for my account!)
Re: Using the tx/rx pins not for UART
By the way, related to this, if those pins can be used for something else than UART in the future, would there also be a chance to enable PWM for them?
Re: Using the tx/rx pins not for UART
I am also interested in disabling the REPL over UART. I would like to use a serial controlled e-Paper display.
Re: Using the tx/rx pins not for UART
Hi,
I am very excited about this whole development and I realise it is very early days but I would agree with this entire thread. I need to be able to disable the REPL and use the UART as a true UART.
When interfacing to any other board (or in my instance to a camera) I need to be able to communicate over the UART.
Any development on this?
I am very excited about this whole development and I realise it is very early days but I would agree with this entire thread. I need to be able to disable the REPL and use the UART as a true UART.
When interfacing to any other board (or in my instance to a camera) I need to be able to communicate over the UART.
Any development on this?
Re: Using the tx/rx pins not for UART
BUMP.
Need to free UART for other application.I am also interested in disabling the REPL over UART
RegardsAny development on this?
Re: Using the tx/rx pins not for UART
You might be interested in http://forum.micropython.org/viewtopic.php?f=16&t=2078
Re: Using the tx/rx pins not for UART
Thanks Deshipu,
Hardware mod is a temporary band-aid fix.
Uart is a prime communication interface for many applications requiring reliable functionality.
I don't know what complexities are involved in finalizing Uart functionality in firmware and hopefully to include an option to turn uart Repl off and/or redirect.
Regards
Hardware mod is a temporary band-aid fix.
Uart is a prime communication interface for many applications requiring reliable functionality.
I don't know what complexities are involved in finalizing Uart functionality in firmware and hopefully to include an option to turn uart Repl off and/or redirect.
Regards
Re: Using the tx/rx pins not for UART
It's not just the REPL but also the manufacturer's stuff that comes out at 75k baud at startup. Later messages like "ip=..." do seem to go away with esp.osdebug(None)
Re: Using the tx/rx pins not for UART
Definitely would be useful to be able to "disconnect" the REPL from UART0, and use it independently. Yes, you still have to tolerate the startup garbage, but after that the UART could be fully under application control - while still using WebREPL for example. @deshipu's recent change gets one step closer (thanks!) but would be really nice to have something like the inverse of os.dupterm() or pyb.repl_uart() function.
Update:
I made a patch to do this which works nicely, but I'm not sure what the "proper" API should be to disconnect REPL from UART0. For my purposes I just overloaded the meaning of esp.osdebug(None) to also disconnect the REPL from that UART. It's a small change to uart.c and esp_mphal.c to give the dupterm its own ringbuf independent of the UART, and skip the CTRL-C processing when receiving bytes in non-stdio mode.
So - what's the right API to have this feature accepted into Micropython?
Update:
I made a patch to do this which works nicely, but I'm not sure what the "proper" API should be to disconnect REPL from UART0. For my purposes I just overloaded the meaning of esp.osdebug(None) to also disconnect the REPL from that UART. It's a small change to uart.c and esp_mphal.c to give the dupterm its own ringbuf independent of the UART, and skip the CTRL-C processing when receiving bytes in non-stdio mode.
So - what's the right API to have this feature accepted into Micropython?