'0x00' in UART buffer before writing anything. #12217
Replies: 7 comments 4 replies
-
You did not mention the MicroPython version. And you should show the code sequence you use. |
Beta Was this translation helpful? Give feedback.
-
I assume you did the test on a Pi Pico.
rp2 uart pins see
The pin numbers are the GPIO numbers, not the PIN labels, i.e. for UART1(4,5) connect PIN labelled 6 and 7 together (I used a paper clip!). Now, what happens if I disconnect the two GPIOs?
You may want to check your connection or try different PIN connections. |
Beta Was this translation helpful? Give feedback.
-
Sorry if I ask for an obvious topic, but did you connect the GND of both devices as well as TX and TX. |
Beta Was this translation helpful? Give feedback.
-
Robert, in my test the two gpio pins are on the same board. I just short-circuited them. This is just to test if the machine.UART() works or not. So I suggest trying different legal GPIO combinations. |
Beta Was this translation helpful? Give feedback.
-
After power up I often find junk in the Rx buffer, even when the 2 uarts are on the same chip. I just do a uart.read() before any write to make sure the buffer is clear. |
Beta Was this translation helpful? Give feedback.
-
As I tried to explain before, in this test the Rxd pin is floating, which is not a valid condition. It should be pulled up to 3.3V, for example with a resistor. UART lines should be high in the idle state otherwise garbage will be read. |
Beta Was this translation helpful? Give feedback.
-
Exactly! The point I want to make is that a wrong connection has been made. For example, PIN#4 and PIN#5 have been connected, which are not GPIO(4) and GPIO(5), which are PIN#6 and PIN#7. According to pico_pinout
Both RP-Pico and RP-Pico-W boards have GPIO numbers on the bottom. It is not confusing. I do not know what kind of RP2040 board @ihchang has been trying the test on. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying to debug not receiving anything over UART when I write something and among other things encountering an odd situation where upon program start, UART.any() always returns 1 and the value read is always
b'0x00'
prior to me sending anything at all. I was wondering if I am misconfiguration anything that's causing this to happen? For reference I a have just been trying this in the REPL shell (https://github.com/orgs/micropython/discussions/11848#discussioncomment-6325045) for testing serial communications. Thank youBeta Was this translation helpful? Give feedback.
All reactions