UART0 use
#12753
Replies: 2 comments
-
The comment is confusing: This will set GPIO6, not GPIO0 About read after write: uart.read() will return that data which is present at the time of calling, which may be None. If you want read() to wait, you have to set a timeout. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, Got it, it was just relly slow to reply, may be due to the 600baud... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Anyone have an idea why i can not read data from UART0 - i can TX the data and i have verified the data is on the line (both rx/tx)?
I have also compiled my own port with:
// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
#define MICROPY_HW_ENABLE_UART_REPL (0)
from machine import UART
from machine import Pin
import time
p6 = Pin(6, Pin.OUT) # create output pin on GPIO0
p6.on() # set pin to "on" (high) level
s = UART(0, baudrate=600, tx=21, rx=20)#serial.Serial(port=portname, baudrate=600)
s.write(b'\x00')
rb = s.read(3)
print(rb)
result : None
I hve checked there is 3 bytes on the line with baud 600 - also i have checked the 0 i send is in baud 600.
The GPIO is to un-reset the chip...
/Kasper
Beta Was this translation helpful? Give feedback.
All reactions