UART ?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
uxhamby
Posts: 34
Joined: Thu Nov 14, 2019 9:47 pm

UART ?

Post by uxhamby » Wed Mar 18, 2020 8:25 pm

Hi,

I am trying to talk to a serial display. I only need to TX to it, there is no RX involved. Is it ok to set up the UART as follows:

uart.init(9600, bits=8, parity=None, stop=1, tx=4) # init parameters

with only the TX pin specified? Or do I need to use TX/RX as pairs?

Thanks,

Brian H.
Uxbridge Ont

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: UART ?

Post by Roberthh » Wed Mar 18, 2020 8:33 pm

If you do not specify rx, the default will be used. Which pin that is, depends on the board and UART number. The defaults e.g. for UART 2 on ESP32 are pin 16 and 17 and should not be used (old bug). The defaults for UART1 are pin 9 (rx) and 10 (tx).

uxhamby
Posts: 34
Joined: Thu Nov 14, 2019 9:47 pm

Re: UART ?

Post by uxhamby » Wed Mar 18, 2020 9:32 pm

Thanks Robert.

BJH

Post Reply