0

When I connect GP4 (UART1 TX) on one pi pico to GP5 (UART1 RX) on the second pipico and vice versa, I keep getting "NONE" as my received data.

Pico #1:

from machine import Pin, UART
uart = UART(1,115200)
while True:
    uart.write ("Hello")

Pico #2:

from machine import UART,Pin
uart = UART(1, 115200)
while True:
    if uart.any():
        rcvChar = uart.read()
        print(rcvChar.decode("ascii"),end="")

This prints out nothing. If I continuously print uart.read() I get a slew of "NONE" values.

I also tried doing a loopback where I connected the TX and RX pins on one of the picos (GP0 and GP1), and sending/reading information that way using:

from machine import UART,Pin
uart = UART(0, 115200)
uart.write('hello')
c=uart.read(5)
print(c)

And still got "NONE" Am I missing something obvious here? Thanks in advance

  • 1
    What were you expecting to get? – Bruce Abbott Jul 30 '22 at 01:01
  • I was hoping to get "H", "e", "l", "l", "o" back. I tried connecting the TX pin to RX and running a simple test code to see if I was receiving data and didn't get anything either, I think I might be missing some conceptual thing about using UART to send data – gradStudent Jul 30 '22 at 02:42
  • 2
    How are your Pis powered? Do they share a common ground wire? – brhans Jul 30 '22 at 03:22
  • Have you tried to loopback one board to itself so it can reveive the same bytes it sends? – Justme Jul 30 '22 at 08:37
  • @Justme, I think loopback is what the OP is trying to describe in their comment, though it's ambiguously written, unfortunately. OP, please edit your question to add new information, don't put it in comments. Otherwise, readers have to piece together your full question from scattered fragments. Thanks. – TonyM Jul 30 '22 at 10:08
  • @TonyM I have updated the original question to discuss the loopback, thank you! – gradStudent Jul 30 '22 at 14:37
  • @brhans One is powered using a DC Power supply, and the other through a USB to my computer. I just tried connecting the ground pins between the two, and that got it working!! Thank you so much!! – gradStudent Jul 30 '22 at 14:39

0 Answers0